diff options
Diffstat (limited to 'core/libraries/I18n.php')
| -rw-r--r-- | core/libraries/I18n.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/libraries/I18n.php b/core/libraries/I18n.php index 19215325..7323ea1d 100644 --- a/core/libraries/I18n.php +++ b/core/libraries/I18n.php @@ -56,7 +56,6 @@ class I18n_Core { private $_cache = array(); - private function __construct($config) { $this->_config = $config; } @@ -64,12 +63,19 @@ class I18n_Core { public static function instance($config=null) { if (self::$_instance == NULL || isset($config)) { $config = isset($config) ? $config : Kohana::config('locale'); + if (empty($config['default_locale'])) { + $config['default_locale'] = module::get_var('core', 'default_locale'); + } self::$_instance = new I18n_Core($config); } return self::$_instance; } + public function setLocale($locale) { + $this->_config['default_locale'] = $locale; + } + /** * Translates a localizable message. * @param $message String|array The message to be translated. E.g. "Hello world" |
