mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 10:45:56 +00:00
pass translations to frontend as a json object
This commit is contained in:
16
js/common.js
16
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);
|
||||
|
||||
Reference in New Issue
Block a user