summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/config/locale.php14
-rw-r--r--core/helpers/core_installer.php1
-rw-r--r--core/libraries/I18n.php8
3 files changed, 11 insertions, 12 deletions
diff --git a/core/config/locale.php b/core/config/locale.php
index d9f95664..3cea9178 100644
--- a/core/config/locale.php
+++ b/core/config/locale.php
@@ -40,15 +40,7 @@ $config['timezone'] = '';
* The locale of the built-in localization messages (locale of strings in translate() calls).
* This can't be changed easily, unless all localization strings are replaced in all source files
* as well.
+ * Although the actual root is "en_US", the configured root is "en" that all en locales inherit the
+ * built-in strings.
*/
-$config['root_locale'] = 'en';
-
-/**
- * The default locale of this installation.
- */
-$config['default_locale'] = 'en_US';
-
-/**
- * The path to the folder with translation files.
- */
-$config['locale_dir'] = VARPATH . 'locale/'; \ No newline at end of file
+$config['root_locale'] = 'en'; \ No newline at end of file
diff --git a/core/helpers/core_installer.php b/core/helpers/core_installer.php
index 7a83ec8f..e0747d46 100644
--- a/core/helpers/core_installer.php
+++ b/core/helpers/core_installer.php
@@ -207,6 +207,7 @@ class core_installer {
module::set_var("core", "page_size", 9);
module::set_var("core", "thumb_size", 200);
module::set_var("core", "resize_size", 640);
+ module::set_var("core", "default_locale", "en_US");
// Add rules for generating our thumbnails and resizes
graphics::add_rule(
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"