summaryrefslogtreecommitdiffstats
path: root/inc/dictionary.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2018-03-15 16:03:16 +0100
committerSimon Rettberg2018-03-15 16:03:16 +0100
commit04d87141d2bdaabd081cbe64d5e0fb7ffa54d41c (patch)
treeeffb5e3c958dd97f6d03365596871834fe1584aa /inc/dictionary.inc.php
parent[inc/Util] Print profiling info to error_log on redirect (diff)
downloadslx-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.php4
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;