Vanilla\AddonManager::getEnabledTranslationPaths PHP Method

getEnabledTranslationPaths() public method

Get the paths to the current translation files.
public getEnabledTranslationPaths ( string $locale ) : array
$locale string The locale to get the translation paths for.
return array Returns an array of paths.
    public function getEnabledTranslationPaths($locale)
    {
        $addons = array_reverse($this->getEnabled(), true);
        $result = [];
        foreach ($addons as $addon) {
            /* @var Addon $addon */
            foreach ($addon->getTranslationPaths($locale) as $path) {
                $result[] = $addon->path($path);
            }
        }
        return $result;
    }

Usage Example

コード例 #1
0
ファイル: class.locale.php プロジェクト: vanilla/vanilla
 /**
  * Gets the locale sources for a given locale.
  *
  * @param string $locale The name of the locale.
  * @return array Returns an array of paths to the translations for the locale.
  * @deprecated Use the {@link AddonManager} for this.
  */
 public function getLocaleSources($locale)
 {
     deprecated('Gdn_PluginManager->getLocaleSources()', 'AddonManager->getEnabledLocaleSources()');
     $result = $this->addonManager->getEnabledTranslationPaths($locale);
     return $result;
 }