diff options
author | Simon Rettberg | 2016-05-09 18:07:50 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-05-09 18:07:50 +0200 |
commit | fca3b58e5b5a9821f99bfafb833a3cf85c9478d9 (patch) | |
tree | 2290edcfc1d3d0432476b6fbceb26d9ab82711da /inc | |
parent | Work on translations: templates and messages work (diff) | |
download | slx-admin-fca3b58e5b5a9821f99bfafb833a3cf85c9478d9.tar.gz slx-admin-fca3b58e5b5a9821f99bfafb833a3cf85c9478d9.tar.xz slx-admin-fca3b58e5b5a9821f99bfafb833a3cf85c9478d9.zip |
Message string editing works now
Diffstat (limited to 'inc')
-rw-r--r-- | inc/dictionary.inc.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/inc/dictionary.inc.php b/inc/dictionary.inc.php index c139c8bf..72139601 100644 --- a/inc/dictionary.inc.php +++ b/inc/dictionary.inc.php @@ -118,8 +118,9 @@ class Dictionary self::$languagesLong = array(); foreach (self::$languages as $lang) { if (file_exists("lang/$lang/name.txt")) { - $name = @file_get_contents("lang/$lang/name.txt"); - } else { + $name = file_get_contents("lang/$lang/name.txt"); + } + if (!isset($name) || $name === false) { $name = $lang; } self::$languagesLong[] = array( @@ -130,6 +131,17 @@ class Dictionary } return self::$languagesLong; } + + public static function getLanguageName($langCC) + { + if (file_exists("lang/$langCC/name.txt")) { + $name = file_get_contents("lang/$langCC/name.txt"); + } + if (!isset($name) || $name === false) { + $name = $langCC; + } + return $name; + } } |