Bug 18433: Display the number of selected items
[koha.git] / koha-tmpl / intranet-tmpl / js / i18n.js
blob4c2df9a0e1d6b2ba7acb6281979f3fa0bef02374
1 (function() {
2   var params = {
3     "domain": "Koha"
4   };
5   if (typeof json_locale_data !== 'undefined') {
6     params.locale_data = json_locale_data;
7   }
9   Koha.i18n = {
10     gt: new Gettext(params),
12     expand: function(text, vars) {
13       var replace_callback = function(match, name) {
14         return name in vars ? vars[name] : match;
15       };
16       return text.replace(/\{(.*?)\}/g, replace_callback);
17     }
18   };
19 })();
21 function __(msgid) {
22   return Koha.i18n.gt.gettext(msgid);
25 function __x(msgid, vars) {
26   return Koha.i18n.expand(__(msgid), vars);
29 function __n(msgid, msgid_plural, count) {
30   return Koha.i18n.gt.ngettext(msgid, msgid_plural, count);
33 function __nx(msgid, msgid_plural, count, vars) {
34   return Koha.i18n.expand(__n(msgid, msgid_plural, count), vars);
37 function __p(msgctxt, msgid) {
38   return Koha.i18n.gt.pgettext(msgctxt, msgid);
41 function __px(msgctxt, msgid, vars) {
42   return Koha.i18n.expand(__p(msgctxt, msgid), vars);
45 function __np(msgctxt, msgid, msgid_plural, count) {
46   return Koha.i18n.gt.npgettext(msgctxt, msgid, msgid_plural, count);
49 function __npx(msgctxt, msgid, msgid_plural, count, vars) {
50   return Koha.i18n.expand(__np(msgctxt, msgid, msgid_plural, count), vars);