summaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authorSimon Rettberg2016-05-09 18:07:50 +0200
committerSimon Rettberg2016-05-09 18:07:50 +0200
commitfca3b58e5b5a9821f99bfafb833a3cf85c9478d9 (patch)
tree2290edcfc1d3d0432476b6fbceb26d9ab82711da /inc
parentWork on translations: templates and messages work (diff)
downloadslx-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.php16
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;
+ }
}