1
0
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:
Andrew Dolgov
2021-02-26 09:21:17 +03:00
parent fd9cd52929
commit 56b10fea18
7 changed files with 70 additions and 47 deletions

View File

@@ -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);