Commit b10c5f42 authored by Dries's avatar Dries

- Small improvement to locale_init().
parent 0876e268
...@@ -138,7 +138,13 @@ function message_throttle() { ...@@ -138,7 +138,13 @@ function message_throttle() {
function locale_init() { function locale_init() {
global $languages, $user; global $languages, $user;
return ($languages ? (($user->uid && $user->language) ? $user->language : key($languages)) : 0);
if ($user->uid && $languages[$user->language]) {
return $user->language;
}
else {
return key($languages);
}
} }
function t($string, $args = 0) { function t($string, $args = 0) {
...@@ -937,4 +943,4 @@ function page_footer() { ...@@ -937,4 +943,4 @@ function page_footer() {
// initialize theme: // initialize theme:
$theme = theme_init(); $theme = theme_init();
?> ?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment