- $cfg = $GLOBALS['cfg'];
- $languages_list = $GLOBALS['languages_list'];
-
- /* Detect user's langage if we are in automatic mode. */
- if (strcmp($cfg['lang'], 'auto') == 0) {
- if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
- $l = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
- } else {
- $l = "en";
- }
- } else {
- $l = $cfg['lang'];
- }
-
- /* Is the langage in the list ? */
- $found = false;
- foreach ($languages_list as $key => $v) {
- if (strcmp($l, $key) == 0) {
- $found = true;
+ $r = t_in($string_id, t_select_lang());
+ if ($r === false) {
+ $r = t_in($string_id, "en");
+ if ($r === false) {
+ return "";