diff options
author | Simon Rettberg | 2018-03-15 16:03:16 +0100 |
---|---|---|
committer | Simon Rettberg | 2018-03-15 16:03:16 +0100 |
commit | 04d87141d2bdaabd081cbe64d5e0fb7ffa54d41c (patch) | |
tree | effb5e3c958dd97f6d03365596871834fe1584aa /inc/dictionary.inc.php | |
parent | [inc/Util] Print profiling info to error_log on redirect (diff) | |
download | slx-admin-04d87141d2bdaabd081cbe64d5e0fb7ffa54d41c.tar.gz slx-admin-04d87141d2bdaabd081cbe64d5e0fb7ffa54d41c.tar.xz slx-admin-04d87141d2bdaabd081cbe64d5e0fb7ffa54d41c.zip |
[inc/Dictionary] Hide languages that are missing flag.png AND name.txt
Diffstat (limited to 'inc/dictionary.inc.php')
-rw-r--r-- | inc/dictionary.inc.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/inc/dictionary.inc.php b/inc/dictionary.inc.php index ee196f59..fcbfdfb8 100644 --- a/inc/dictionary.inc.php +++ b/inc/dictionary.inc.php @@ -17,6 +17,8 @@ class Dictionary { self::$languages = array(); foreach (glob('lang/??', GLOB_ONLYDIR) as $lang) { + if (!file_exists($lang . '/name.txt') && !file_exists($lang . '/flag.png')) + continue; $lang = basename($lang); if ($lang === '..') continue; @@ -191,6 +193,8 @@ class Dictionary foreach (self::$languages as $lang) { if (file_exists("lang/$lang/name.txt")) { $name = file_get_contents("lang/$lang/name.txt"); + } else { + $name = false; } if (!isset($name) || $name === false) { $name = $lang; |