getFallbackLanguageToLoad(); require_once "lang/" . $language .".php"; $this->addTranslationArray($translations); $language = $this->getLanguageToLoad(); require_once "lang/" . $language .".php"; $this->addTranslationArray($translations); setlocale(LC_ALL, $GLOBALS['Piwik_translations']['General_Locale']); } public function addTranslationArray($translation) { if(!isset($GLOBALS['Piwik_translations'])) { $GLOBALS['Piwik_translations'] = array(); } // we could check that no string overlap here $GLOBALS['Piwik_translations'] = array_merge($GLOBALS['Piwik_translations'], $translation); } /** * @return string the language filename prefix, eg "en" for english * @throws exception if the language set in the config file is not a valid filename */ public function getLanguageToLoad() { $language = Zend_Registry::get('config')->Language->current; if( Piwik_Common::isValidFilename($language)) { return $language; } else { throw new Exception("The language selected ('$language') is not a valid language file "); } } protected function getFallbackLanguageToLoad() { return Zend_Registry::get('config')->Language->fallback; } /** * Generate javascript translations array * * @return string containing javascript code with translations array (including