summaryrefslogtreecommitdiff
path: root/modules/user/helpers
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2009-02-10 02:37:16 +0000
committerAndy Staudacher <andy.st@gmail.com>2009-02-10 02:37:16 +0000
commitc2eee4746533af10779934f705138fe9bb567550 (patch)
tree1b97e2e233906117db905bab5d5c2668bfc4c93c /modules/user/helpers
parentdce6548431c4d61ab6c532375a0f030d8de72fd1 (diff)
Move site default_locale into DB (vars) and add a per user locale preference.
There's no UI to select the locale yet.
Diffstat (limited to 'modules/user/helpers')
-rw-r--r--modules/user/helpers/user_event.php6
-rw-r--r--modules/user/helpers/user_installer.php1
2 files changed, 7 insertions, 0 deletions
diff --git a/modules/user/helpers/user_event.php b/modules/user/helpers/user_event.php
index 21848e2e..4af1d22f 100644
--- a/modules/user/helpers/user_event.php
+++ b/modules/user/helpers/user_event.php
@@ -23,5 +23,11 @@ class user_event_Core {
*/
static function gallery_ready() {
user::load_user();
+
+ $locale = user::active()->locale;
+ if (!empty($locale)) {
+ // TODO(andy_st): Check session data as well.
+ I18n::instance()->setLocale($locale);
+ }
}
}
diff --git a/modules/user/helpers/user_installer.php b/modules/user/helpers/user_installer.php
index 8f2f25a6..806ed14b 100644
--- a/modules/user/helpers/user_installer.php
+++ b/modules/user/helpers/user_installer.php
@@ -35,6 +35,7 @@ class user_installer {
`guest` BOOLEAN default 0,
`hash` char(32) default NULL,
`url` varchar(255) default NULL,
+ `locale` char(10) default NULL,
PRIMARY KEY (`id`),
UNIQUE KEY(`hash`),
UNIQUE KEY(`name`))