diff options
-rw-r--r-- | account.php | 10 | ||||
-rw-r--r-- | includes/locale.inc | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/account.php b/account.php index a2668074b..ade3e1ea2 100644 --- a/account.php +++ b/account.php @@ -139,10 +139,12 @@ function account_site_edit() { $output .= "<SELECT NAME=\"edit[timezone]\">\n$options2</SELECT><BR>\n"; $output .= "<I>". t("Select what time you currently have and your timezone settings will be set appropriate.") ."</I><P>\n"; - $output .= "<B>". t("Language" ) .":</B><BR>\n"; - foreach ($languages as $key=>$value) $options3 .= " <OPTION VALUE=\"$key\"". (($user->language == $key) ? " SELECTED" : "") .">$value - $key</OPTION>\n"; - $output .= "<SELECT NAME=\"edit[language]\">\n$options3</SELECT><BR>\n"; - $output .= "<I>". t("Selecting a different language will change the language the site.") ."</I><P>\n"; + if ($languages) { + $output .= "<B>". t("Language" ) .":</B><BR>\n"; + foreach ($languages as $key=>$value) $options3 .= " <OPTION VALUE=\"$key\"". (($user->language == $key) ? " SELECTED" : "") .">$value - $key</OPTION>\n"; + $output .= "<SELECT NAME=\"edit[language]\">\n$options3</SELECT><BR>\n"; + $output .= "<I>". t("Selecting a different language will change the language the site.") ."</I><P>\n"; + } $output .= "<B>". t("Maximum number of stories to display") .":</B><BR>\n"; for ($stories = 10; $stories <= 30; $stories += 5) $options4 .= "<OPTION VALUE=\"$stories\"". (($user->stories == $stories) ? " SELECTED" : "") .">$stories</OPTION>\n"; diff --git a/includes/locale.inc b/includes/locale.inc index 873ee8606..4fd927c56 100644 --- a/includes/locale.inc +++ b/includes/locale.inc @@ -2,7 +2,7 @@ function locale_init() { global $languages, $user; - return ($user->id && $user->language) ? $user->language : key($languages); + return ($languages ? (($user->id && $user->language) ? $user->language : key($languages)) : 0); } function t($string) { |