summaryrefslogtreecommitdiffstats
path: root/inc/dictionary.inc.php
diff options
context:
space:
mode:
authorChristian Klinger2016-08-22 11:24:03 +0200
committerChristian Klinger2016-08-22 11:24:03 +0200
commitd3c689c6730ca6749c03ffd01c670f7b191e8355 (patch)
tree9e2d7caa1ed3c45b4757621202087a64e5e87cc9 /inc/dictionary.inc.php
parentcss fix/hack to get roomplanner to work on medium sized screens. (diff)
parent[dozmod] Expect the client to tell wether it is running in exam mode and comp... (diff)
downloadslx-admin-d3c689c6730ca6749c03ffd01c670f7b191e8355.tar.gz
slx-admin-d3c689c6730ca6749c03ffd01c670f7b191e8355.tar.xz
slx-admin-d3c689c6730ca6749c03ffd01c670f7b191e8355.zip
Merge branch 'modularization' of git.openslx.org:openslx-ng/slx-admin into modularization
Diffstat (limited to 'inc/dictionary.inc.php')
-rw-r--r--inc/dictionary.inc.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/inc/dictionary.inc.php b/inc/dictionary.inc.php
index cb23d0b2..634b1c3c 100644
--- a/inc/dictionary.inc.php
+++ b/inc/dictionary.inc.php
@@ -69,10 +69,13 @@ class Dictionary
return self::$stringCache[$file] = $json;
}
- public static function translateFileModule($moduleId, $path, $tag)
+ public static function translateFileModule($moduleId, $path, $tag, $returnTagOnMissing = false)
{
$strings = self::getArray($moduleId, $path);
if (!isset($strings[$tag])) {
+ if ($returnTagOnMissing) {
+ return '{{' . $tag . '}}';
+ }
return false;
}
return $strings[$tag];
@@ -85,12 +88,15 @@ class Dictionary
return self::translateFileModule(Page::getModule()->getIdentifier(), $path, $tag);
}
- public static function translate($tag)
+ public static function translate($tag, $returnTagOnMissing = false)
{
$string = self::translateFile('module', $tag);
if ($string !== false)
return $string;
- return self::translateFileModule('main', 'global-tags', $tag);
+ $string = self::translateFileModule('main', 'global-tags', $tag);
+ if ($string !== false || !$returnTagOnMissing)
+ return $string;
+ return '{{' . $tag . '}}';
}
public static function getMessage($module, $id)