diff options
author | Mark Wells <mark@freeside.biz> | 2015-07-10 18:15:08 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2015-07-10 18:15:08 -0700 |
commit | 88bf5db0cca989c51237c661a13078eef08b3674 (patch) | |
tree | 0a84e1b5e7fd239f57fab678bf40c5311b0064a0 /rt/share/static/js/i18n.js | |
parent | 9c15ffe3a5ee987e30e10c6a0ad1b5bf0b2a12e3 (diff) | |
parent | e7eb845db1afab1cbdbc34ff9c387c5ac554659e (diff) |
Merge branch 'FREESIDE_4_BRANCH' of git.freeside.biz:/home/git/freeside into 4.x
Diffstat (limited to 'rt/share/static/js/i18n.js')
-rw-r--r-- | rt/share/static/js/i18n.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/rt/share/static/js/i18n.js b/rt/share/static/js/i18n.js new file mode 100644 index 000000000..29ea07855 --- /dev/null +++ b/rt/share/static/js/i18n.js @@ -0,0 +1,15 @@ +function loc_key(key) { + if (arguments.length > 1 && console && console.log) + console.log("loc_key() does not support substitution! (for key: " + key + ")") + + var msg; + if (RT.I18N && RT.I18N.Catalog) + msg = RT.I18N.Catalog[key]; + + if (msg == null && console && console.log) { + console.log("I18N key '" + key + "' not found in catalog"); + msg = "(no translation for key: " + key + ")"; + } + + return msg; +} |