summaryrefslogtreecommitdiff
path: root/core/libraries
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2009-02-10 05:37:42 +0000
committerAndy Staudacher <andy.st@gmail.com>2009-02-10 05:37:42 +0000
commit62f3724acbdf60b7a17c452e74f099b5236d41cb (patch)
treebcf7ad27946413681c1774bad65e754001f37777 /core/libraries
parentfe5240730a0f281db1ed6ad3be0a3c63c72868bc (diff)
Adding UI for site language selection and user language preference.
Diffstat (limited to 'core/libraries')
-rw-r--r--core/libraries/I18n.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/libraries/I18n.php b/core/libraries/I18n.php
index f69aa66f..475b14b6 100644
--- a/core/libraries/I18n.php
+++ b/core/libraries/I18n.php
@@ -55,6 +55,7 @@ class I18n_Core {
private function __construct($config) {
$this->_config = $config;
+ $this->setLocale($config['default_locale']);
}
public static function instance($config=null) {
@@ -71,6 +72,11 @@ class I18n_Core {
public function setLocale($locale) {
$this->_config['default_locale'] = $locale;
+ // Attempt to set PHP's locale as well (for number formatting, collation, etc.)
+ // TODO: See G2 for better fallack code.
+ $locale_prefs = array($locale);
+ $locale_prefs[] = 'en_US';
+ setlocale(LC_ALL, $locale_prefs);
}
/**