##// END OF EJS Templates
i18n: added JS utils for translation.
marcink -
r324:98b8711e stable
parent child Browse files
Show More
@@ -0,0 +1,36 b''
1 // # Copyright (C) 2016-2016 RhodeCode GmbH
2 // #
3 // # This program is free software: you can redistribute it and/or modify
4 // # it under the terms of the GNU Affero General Public License, version 3
5 // # (only), as published by the Free Software Foundation.
6 // #
7 // # This program is distributed in the hope that it will be useful,
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // # GNU General Public License for more details.
11 // #
12 // # You should have received a copy of the GNU Affero General Public License
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 // #
15 // # This program is dual-licensed. If you wish to learn more about the
16 // # RhodeCode Enterprise Edition, including its added features, Support services,
17 // # and proprietary license terms, please see https://rhodecode.com/licenses/
18
19 i18nLog = Logger.get('i18n');
20
21 var _gettext = function (s) {
22 if (_TM.hasOwnProperty(s)) {
23 return _TM[s];
24 }
25 i18nLog.error(
26 'String `' + s + '` was requested but cannot be ' +
27 'found in translation table');
28 return s
29 };
30
31 var _ngettext = function (singular, plural, n) {
32 if (n === 1) {
33 return _gettext(singular)
34 }
35 return _gettext(plural)
36 };
@@ -19,6 +19,7 b' module.exports = function(grunt) {'
19 19 '<%= dirs.js.src %>/mousetrap.js',
20 20 '<%= dirs.js.src %>/moment.js',
21 21 '<%= dirs.js.src %>/appenlight-client-0.4.1.min.js',
22 '<%= dirs.js.src %>/i18n_utils.js',
22 23
23 24 // Plugins
24 25 '<%= dirs.js.src %>/plugins/jquery.pjax.js',
General Comments 0
You need to be logged in to leave comments. Login now