X-Git-Url: https://git.p6c8.net/jirafeau.git/blobdiff_plain/b2186ae902b055a52ba879e232c799581a1c657c..a1bcc5b88c09dcbbfb2f2ad0d509d32731ff04c3:/lib/functions.js.php diff --git a/lib/functions.js.php b/lib/functions.js.php index 79d7c95..2080386 100644 --- a/lib/functions.js.php +++ b/lib/functions.js.php @@ -28,12 +28,21 @@ require(JIRAFEAU_ROOT . 'lib/lang.php'); ?> var web_root = ""; -function translate (expr) -{ - var lang_array = ; - if (lang_array.hasOwnProperty(expr)) - return lang_array[expr]; - return expr; +var lang_array = ; +var lang_array_fallback = ; + +function translate (expr) { + if (lang_array.hasOwnProperty(expr)) { + var e = lang_array[expr]; + if (!isEmpty(e)) + return e; + } + if (lang_array_fallback.hasOwnProperty(expr)) { + var e = lang_array_fallback[expr]; + if (!isEmpty(e)) + return e; + } + return "FIXME: " + expr; } function isEmpty(str) {