$languages_list = array ('auto' => 'Automatic',\r
'de' => 'Deutsch',\r
'en' => 'English',\r
+ 'el' => 'Ελληνικά',\r
+ 'es' => 'Español',\r
+ 'hu' => 'Magyar',\r
'fi' => 'Suomi',\r
'fr' => 'Français',\r
'it' => 'Italiano',\r
'nl' => 'Nederlands',\r
'ro' => 'Limba română',\r
- 'sk' => 'Slovenčina');\r
+ 'ru' => 'ру́сский',\r
+ 'sk' => 'Slovenčina',\r
+ 'zh' => '汉语');\r
\r
/* Translation */\r
function t ($text)\r
\r
/* Detect user's langage if we are in automatic mode. */\r
if (strcmp ($cfg['lang'], 'auto') == 0)\r
- $l = substr ($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\r
+ {\r
+ if (isset ($_SERVER['HTTP_ACCEPT_LANGUAGE']))\r
+ $l = substr ($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\r
+ else\r
+ $l = "en";\r
+ }\r
else\r
$l = $cfg['lang'];\r
\r
\r
/* Detect user's langage if we are in automatic mode. */\r
if (strcmp ($cfg['lang'], 'auto') == 0)\r
- $l = substr ($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\r
+ {\r
+ if (isset ($_SERVER['HTTP_ACCEPT_LANGUAGE']))\r
+ $l = substr ($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\r
+ else\r
+ $l = "en";\r
+ }\r
else\r
$l = $cfg['lang'];\r
\r
\r
/* Open translation file. */\r
$trans_j = file_get_contents (JIRAFEAU_ROOT . "lib/locales/$l.json");\r
- return $trans_j; \r
+ return $trans_j;\r
}\r
\r
?>\r