public function getTranslationsForLanguage($languageCode)
    {
        if (!$this->isLanguageAvailable($languageCode)) {
            return false;
        }
        $data = file_get_contents(PIWIK_INCLUDE_PATH . "/lang/$languageCode.json");
        $translations = json_decode($data, true);
        $languageInfo = array();
        foreach ($translations as $module => $keys) {
            foreach ($keys as $key => $value) {
                $languageInfo[] = array(
                    'label' => sprintf("%s_%s", $module, $key),
                    'value' => $value
                );
            }
        }

        foreach (PluginManager::getInstance()->getLoadedPluginsName() as $pluginName) {
            $translations = $this->getPluginTranslationsForLanguage($pluginName, $languageCode);

            if (!empty($translations)) {
                foreach ($translations as $keys) {
                    $languageInfo[] = $keys;
                }
            }
        }

        return $languageInfo;
    }
public function getTranslationsForLanguage($languageCode)
    {
        if (!$this->isLanguageAvailable($languageCode)) {
            return false;
        }
        $data = file_get_contents(PIWIK_INCLUDE_PATH . "/lang/$languageCode.json");
        $translations = json_decode($data, true);
        $languageInfo = array();
        foreach ($translations as $module => $keys) {
            foreach ($keys as $key => $value) {
                $languageInfo[] = array(
                    'label' => sprintf("%s_%s", $module, $key),
                    'value' => $value
                );
            }
        }

        foreach (PluginManager::getInstance()->getLoadedPluginsName() as $pluginName) {
            $translations = $this->getPluginTranslationsForLanguage($pluginName, $languageCode);

            if (!empty($translations)) {
                foreach ($translations as $keys) {
                    $languageInfo[] = $keys;
                }
            }
        }

        return $languageInfo;
    }
public function getTranslationsForLanguage ( $ languageCode ) { if ( ! $ this -> isLanguageAvailable ( $ languageCode ) ) { return false ; } $ data = file_get_contents ( PIWIK_INCLUDE_PATH . "/lang/$languageCode.json" ) ; $ translations = json_decode ( $ data , true ) ; $ languageInfo = array ( ) ; foreach ( $ translations as $ module => $ keys ) { foreach ( $ keys as $ key => $ value ) { $ languageInfo [ ] = array ( 'label' => sprintf ( "%s_%s" , $ module , $ key ) , 'value' => $ value ) ; } } foreach ( PluginManager :: getInstance ( ) -> getLoadedPluginsName ( ) as $ pluginName ) { $ translations = $ this -> getPluginTranslationsForLanguage ( $ pluginName , $ languageCode ) ; if ( ! empty ( $ translations ) ) { foreach ( $ translations as $ keys ) { $ languageInfo [ ] = $ keys ; } } } return $ languageInfo ; }
Returns translation strings by language

@param string $languageCode ISO language code
@return array|false Array of arrays, each containing 'label' (translation index)  and 'value' (translated string); false if language unavailable
Returns translation strings by language