diff options
Diffstat (limited to 'js/common.js')
-rwxr-xr-x | js/common.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/js/common.js b/js/common.js index 670ee1b30..1544e6d0b 100755 --- a/js/common.js +++ b/js/common.js @@ -1,8 +1,22 @@ 'use strict'; -/* global dijit, __, App, dojo, __csrf_token */ +/* global dijit, App, dojo, __csrf_token */ /* eslint-disable no-new */ +/* exported __ */ +function __(msg) { + if (typeof App != "undefined") { + return App.l10n.__(msg); + } else { + return msg; + } +} + +/* exported ngettext */ +function ngettext(msg1, msg2, n) { + return __((parseInt(n) > 1) ? msg2 : msg1); +} + /* exported $ */ function $(id) { console.warn("FIXME: please use App.byId() or document.getElementById() instead of $():", id); |