protected function load_lang(HTTPRequestCustom $request)
 {
     $locale = TextHelper::htmlspecialchars($request->get_string('lang', UpdateController::DEFAULT_LOCALE));
     LangLoader::set_locale($locale);
     UpdateUrlBuilder::set_locale($locale);
     $this->lang = LangLoader::get('update', 'update');
 }
Beispiel #2
0
 public function test_get_imbricated_with_locale()
 {
     LangLoader::set_locale('french');
     $lang = LangLoader::get('mylang', '/test/data/');
     $expected = array('common_lang_var1' => 'hello1', 'common_lang_var2' => 'hello2', 'common_lang_var3' => 'hello3', 'lang_var1' => 'coucou1', 'lang_var2' => 'coucou2', 'lang_var3' => 'coucou3');
     self::assertEquals($expected, $lang);
 }
 protected function load_lang(HTTPRequestCustom $request)
 {
     $locale = TextHelper::htmlspecialchars($request->get_string('lang', self::DEFAULT_LOCALE));
     $locale = in_array($locale, InstallationServices::get_available_langs()) ? $locale : self::DEFAULT_LOCALE;
     LangLoader::set_locale($locale);
     InstallUrlBuilder::set_locale($locale);
     $this->lang = LangLoader::get('install', 'install');
 }
 public function __construct($locale = '')
 {
     $this->token = new File(PATH_TO_ROOT . '/cache/.install_token');
     if (!empty($locale)) {
         LangLoader::set_locale($locale);
     }
     $this->messages = LangLoader::get('install', 'install');
     $this->load_distribution_configuration();
 }
 public function __construct($locale = '')
 {
     $this->token = new File(PATH_TO_ROOT . '/cache/.update_token');
     $this->update_followed_file = new File(PATH_TO_ROOT . '/update/update_followed.txt');
     $this->update_followed_file->delete();
     self::$db_utils = PersistenceContext::get_dbms_utils();
     self::$db_querier = PersistenceContext::get_querier();
     if (!empty($locale)) {
         LangLoader::set_locale($locale);
     }
     $this->messages = LangLoader::get('update', 'update');
 }
 private static function set_locale()
 {
     $locale = AppContext::get_request()->get_getstring('locale', 'french');
     LangLoader::set_locale($locale);
 }
 public static function load_lang_files()
 {
     $locale = AppContext::get_current_user()->get_locale();
     LangLoader::set_locale($locale);
     global $LANG;
     $LANG = array();
     require_once PATH_TO_ROOT . '/lang/' . $locale . '/main.php';
     require_once PATH_TO_ROOT . '/lang/' . $locale . '/errors.php';
     AppContext::get_current_user()->update_visitor_display_name();
 }