Esempio n. 1
0
 static function setActiveTranslation($locale, $permanently = true)
 {
     if (!eZTranslatorManager::dynamicTranslationsEnabled()) {
         return;
     }
     if ($permanently) {
         $siteINI = eZINI::instance('site.ini.append', 'settings/override', null, null, false, true);
     } else {
         $siteINI = eZINI::instance();
     }
     $siteINI->setVariable('RegionalSettings', 'Locale', $locale);
     $siteINI->setVariable('RegionalSettings', 'TextTranslation', 'enabled');
     if ($permanently) {
         $siteINI->save('site.ini.append', '.php', false, false);
         eZINI::resetInstance("site.ini");
     }
     eZTranslatorManager::resetTranslations();
 }