diff options
author | Anika Henke <anika@selfthinker.org> | 2013-08-04 10:41:00 +0100 |
---|---|---|
committer | Anika Henke <anika@selfthinker.org> | 2013-08-04 10:41:00 +0100 |
commit | 71c1143e8785954ea00a62aeb755ca7d8fa47e56 (patch) | |
tree | c813b1fe3590314fcb1f20a30811d5de92871583 /lib/exe/js.php | |
parent | d637819dca760b20f6e53e5847a92d08d8d15b8c (diff) | |
parent | 90d5fa676926189b265430239dca3b7ba668b30b (diff) | |
download | rpg-71c1143e8785954ea00a62aeb755ca7d8fa47e56.tar.gz rpg-71c1143e8785954ea00a62aeb755ca7d8fa47e56.tar.bz2 |
Merge remote-tracking branch 'origin/master' into video-audio
Diffstat (limited to 'lib/exe/js.php')
-rw-r--r-- | lib/exe/js.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/exe/js.php b/lib/exe/js.php index 06769d895..4b4b598de 100644 --- a/lib/exe/js.php +++ b/lib/exe/js.php @@ -96,6 +96,10 @@ function js_out(){ // load JS specific translations $json = new JSON(); $lang['js']['plugins'] = js_pluginstrings(); + $templatestrings = js_templatestrings(); + if(!empty($templatestrings)) { + $lang['js']['template'] = $templatestrings; + } echo 'LANG = '.$json->encode($lang['js']).";\n"; // load toolbar @@ -210,6 +214,21 @@ function js_pluginstrings() return $pluginstrings; } +function js_templatestrings() { + global $conf; + $templatestrings = array(); + if (@file_exists(tpl_incdir()."lang/en/lang.php")) { + include tpl_incdir()."lang/en/lang.php"; + } + if (isset($conf['lang']) && $conf['lang']!='en' && @file_exists(tpl_incdir()."lang/".$conf['lang']."/lang.php")) { + include tpl_incdir()."lang/".$conf['lang']."/lang.php"; + } + if (isset($lang['js'])) { + $templatestrings[$conf['template']] = $lang['js']; + } + return $templatestrings; +} + /** * Escapes a String to be embedded in a JavaScript call, keeps \n * as newline |