From c3afc4d3ddaa36a280f7ad83f25e44d8d052976b Mon Sep 17 00:00:00 2001 From: pzinovkin Date: Mon, 23 Aug 2010 16:04:12 +0000 Subject: [PATCH] I18n changed git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/branches/evo@151 4cb57b5f-5bbd-dd11-951b-001d605cbbc5 --- i18n/I18N.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/i18n/I18N.php b/i18n/I18N.php index 08a2294..e4f0f25 100644 --- a/i18n/I18N.php +++ b/i18n/I18N.php @@ -49,12 +49,16 @@ class I18N self::$lang = Env::Cookie('lang', self::getAcceptLanguage()); self::setLang(self::$lang); self::$locale = self::$locales[self::$lang]; - - putenv('LANG=' . self::$locale); - setlocale(LC_ALL, self::$locale . '.UTF-8'); + self::initForLocale(self::$locale); + } + + static public function initForLocale($locale) + { + putenv('LANG=' . $locale); + setlocale(LC_ALL, $locale . '.UTF-8'); bindtextdomain(self::$domain, PATH . '/' . APP . '/src/i18n/'); textdomain(self::$domain); - bind_textdomain_codeset(self::$domain, 'UTF-8'); + bind_textdomain_codeset(self::$domain, 'UTF-8'); } static protected function getAcceptLanguage()