@esgettext/runtime 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +19 -0
- package/README.md +411 -0
- package/_bundles/runtime.js +1356 -0
- package/_bundles/runtime.js.map +1 -0
- package/_bundles/runtime.min.js +2 -0
- package/_bundles/runtime.min.js.map +1 -0
- package/api-docs/assets/highlight.css +127 -0
- package/api-docs/assets/main.js +59 -0
- package/api-docs/assets/navigation.js +1 -0
- package/api-docs/assets/search.js +1 -0
- package/api-docs/assets/style.css +1414 -0
- package/api-docs/classes/Textdomain.html +364 -0
- package/api-docs/index.html +222 -0
- package/api-docs/interfaces/Catalog.html +20 -0
- package/api-docs/interfaces/CatalogEntries.html +11 -0
- package/api-docs/interfaces/LocaleContainer.html +19 -0
- package/api-docs/interfaces/Placeholders.html +9 -0
- package/api-docs/modules.html +6 -0
- package/lib/core/browser-environment.d.ts +1 -0
- package/lib/core/browser-environment.js +12 -0
- package/lib/core/browser-environment.js.map +1 -0
- package/lib/core/catalog-cache.d.ts +10 -0
- package/lib/core/catalog-cache.js +39 -0
- package/lib/core/catalog-cache.js.map +1 -0
- package/lib/core/catalog-cache.spec.d.ts +1 -0
- package/lib/core/catalog-cache.spec.js +24 -0
- package/lib/core/catalog-cache.spec.js.map +1 -0
- package/lib/core/catalog-format.spec.d.ts +1 -0
- package/lib/core/catalog-format.spec.js +35 -0
- package/lib/core/catalog-format.spec.js.map +1 -0
- package/lib/core/catalog.d.ts +9 -0
- package/lib/core/catalog.js +3 -0
- package/lib/core/catalog.js.map +1 -0
- package/lib/core/data-viewlet.d.ts +11 -0
- package/lib/core/data-viewlet.js +57 -0
- package/lib/core/data-viewlet.js.map +1 -0
- package/lib/core/data-viewlet.spec.d.ts +1 -0
- package/lib/core/data-viewlet.spec.js +62 -0
- package/lib/core/data-viewlet.spec.js.map +1 -0
- package/lib/core/explode-locale.d.ts +3 -0
- package/lib/core/explode-locale.js +37 -0
- package/lib/core/explode-locale.js.map +1 -0
- package/lib/core/explode-locale.spec.d.ts +1 -0
- package/lib/core/explode-locale.spec.js +41 -0
- package/lib/core/explode-locale.spec.js.map +1 -0
- package/lib/core/germanic-plural.d.ts +1 -0
- package/lib/core/germanic-plural.js +8 -0
- package/lib/core/germanic-plural.js.map +1 -0
- package/lib/core/gettext-impl.d.ts +10 -0
- package/lib/core/gettext-impl.js +38 -0
- package/lib/core/gettext-impl.js.map +1 -0
- package/lib/core/gettext.spec.d.ts +1 -0
- package/lib/core/gettext.spec.js +391 -0
- package/lib/core/gettext.spec.js.map +1 -0
- package/lib/core/index.d.ts +4 -0
- package/lib/core/index.js +21 -0
- package/lib/core/index.js.map +1 -0
- package/lib/core/locale-container.d.ts +8 -0
- package/lib/core/locale-container.js +3 -0
- package/lib/core/locale-container.js.map +1 -0
- package/lib/core/path-separator.d.ts +1 -0
- package/lib/core/path-separator.js +12 -0
- package/lib/core/path-separator.js.map +1 -0
- package/lib/core/resolve-impl.d.ts +3 -0
- package/lib/core/resolve-impl.js +253 -0
- package/lib/core/resolve-impl.js.map +1 -0
- package/lib/core/resolve.spec.d.ts +1 -0
- package/lib/core/resolve.spec.js +345 -0
- package/lib/core/resolve.spec.js.map +1 -0
- package/lib/core/select-locale.d.ts +1 -0
- package/lib/core/select-locale.js +43 -0
- package/lib/core/select-locale.js.map +1 -0
- package/lib/core/select-locale.spec.d.ts +1 -0
- package/lib/core/select-locale.spec.js +27 -0
- package/lib/core/select-locale.spec.js.map +1 -0
- package/lib/core/set-locale-browser.spec.d.ts +1 -0
- package/lib/core/set-locale-browser.spec.js +17 -0
- package/lib/core/set-locale-browser.spec.js.map +1 -0
- package/lib/core/set-locale-node.spec.d.ts +1 -0
- package/lib/core/set-locale-node.spec.js +26 -0
- package/lib/core/set-locale-node.spec.js.map +1 -0
- package/lib/core/split-locale.d.ts +7 -0
- package/lib/core/split-locale.js +39 -0
- package/lib/core/split-locale.js.map +1 -0
- package/lib/core/split-locale.spec.d.ts +1 -0
- package/lib/core/split-locale.spec.js +59 -0
- package/lib/core/split-locale.spec.js.map +1 -0
- package/lib/core/textdomain.d.ts +55 -0
- package/lib/core/textdomain.js +277 -0
- package/lib/core/textdomain.js.map +1 -0
- package/lib/core/textdomain.spec.d.ts +1 -0
- package/lib/core/textdomain.spec.js +33 -0
- package/lib/core/textdomain.spec.js.map +1 -0
- package/lib/core/user-locales.d.ts +1 -0
- package/lib/core/user-locales.js +12 -0
- package/lib/core/user-locales.js.map +1 -0
- package/lib/index-browser.d.ts +2 -0
- package/lib/index-browser.js +44 -0
- package/lib/index-browser.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +37 -0
- package/lib/index.js.map +1 -0
- package/lib/parser/index.d.ts +2 -0
- package/lib/parser/index.js +19 -0
- package/lib/parser/index.js.map +1 -0
- package/lib/parser/parse-json-catalog.d.ts +3 -0
- package/lib/parser/parse-json-catalog.js +37 -0
- package/lib/parser/parse-json-catalog.js.map +1 -0
- package/lib/parser/parse-json-catalog.spec.d.ts +1 -0
- package/lib/parser/parse-json-catalog.spec.js +41 -0
- package/lib/parser/parse-json-catalog.spec.js.map +1 -0
- package/lib/parser/parse-mo-catalog.d.ts +2 -0
- package/lib/parser/parse-mo-catalog.js +86 -0
- package/lib/parser/parse-mo-catalog.js.map +1 -0
- package/lib/parser/parse-mo-catalog.spec.d.ts +1 -0
- package/lib/parser/parse-mo-catalog.spec.js +115 -0
- package/lib/parser/parse-mo-catalog.spec.js.map +1 -0
- package/lib/transport/fs.d.ts +4 -0
- package/lib/transport/fs.js +18 -0
- package/lib/transport/fs.js.map +1 -0
- package/lib/transport/http.d.ts +4 -0
- package/lib/transport/http.js +27 -0
- package/lib/transport/http.js.map +1 -0
- package/lib/transport/http.spec.d.ts +1 -0
- package/lib/transport/http.spec.js +119 -0
- package/lib/transport/http.spec.js.map +1 -0
- package/lib/transport/index.d.ts +3 -0
- package/lib/transport/index.js +20 -0
- package/lib/transport/index.js.map +1 -0
- package/lib/transport/transport.interface.d.ts +3 -0
- package/lib/transport/transport.interface.js +3 -0
- package/lib/transport/transport.interface.js.map +1 -0
- package/lib-esm/core/browser-environment.d.ts +1 -0
- package/lib-esm/core/browser-environment.js +8 -0
- package/lib-esm/core/browser-environment.js.map +1 -0
- package/lib-esm/core/catalog-cache.d.ts +10 -0
- package/lib-esm/core/catalog-cache.js +36 -0
- package/lib-esm/core/catalog-cache.js.map +1 -0
- package/lib-esm/core/catalog-cache.spec.d.ts +1 -0
- package/lib-esm/core/catalog-cache.spec.js +22 -0
- package/lib-esm/core/catalog-cache.spec.js.map +1 -0
- package/lib-esm/core/catalog-format.spec.d.ts +1 -0
- package/lib-esm/core/catalog-format.spec.js +33 -0
- package/lib-esm/core/catalog-format.spec.js.map +1 -0
- package/lib-esm/core/catalog.d.ts +9 -0
- package/lib-esm/core/catalog.js +2 -0
- package/lib-esm/core/catalog.js.map +1 -0
- package/lib-esm/core/data-viewlet.d.ts +11 -0
- package/lib-esm/core/data-viewlet.js +54 -0
- package/lib-esm/core/data-viewlet.js.map +1 -0
- package/lib-esm/core/data-viewlet.spec.d.ts +1 -0
- package/lib-esm/core/data-viewlet.spec.js +60 -0
- package/lib-esm/core/data-viewlet.spec.js.map +1 -0
- package/lib-esm/core/explode-locale.d.ts +3 -0
- package/lib-esm/core/explode-locale.js +33 -0
- package/lib-esm/core/explode-locale.js.map +1 -0
- package/lib-esm/core/explode-locale.spec.d.ts +1 -0
- package/lib-esm/core/explode-locale.spec.js +39 -0
- package/lib-esm/core/explode-locale.spec.js.map +1 -0
- package/lib-esm/core/germanic-plural.d.ts +1 -0
- package/lib-esm/core/germanic-plural.js +4 -0
- package/lib-esm/core/germanic-plural.js.map +1 -0
- package/lib-esm/core/gettext-impl.d.ts +10 -0
- package/lib-esm/core/gettext-impl.js +34 -0
- package/lib-esm/core/gettext-impl.js.map +1 -0
- package/lib-esm/core/gettext.spec.d.ts +1 -0
- package/lib-esm/core/gettext.spec.js +389 -0
- package/lib-esm/core/gettext.spec.js.map +1 -0
- package/lib-esm/core/index.d.ts +4 -0
- package/lib-esm/core/index.js +5 -0
- package/lib-esm/core/index.js.map +1 -0
- package/lib-esm/core/locale-container.d.ts +8 -0
- package/lib-esm/core/locale-container.js +2 -0
- package/lib-esm/core/locale-container.js.map +1 -0
- package/lib-esm/core/path-separator.d.ts +1 -0
- package/lib-esm/core/path-separator.js +8 -0
- package/lib-esm/core/path-separator.js.map +1 -0
- package/lib-esm/core/resolve-impl.d.ts +3 -0
- package/lib-esm/core/resolve-impl.js +249 -0
- package/lib-esm/core/resolve-impl.js.map +1 -0
- package/lib-esm/core/resolve.spec.d.ts +1 -0
- package/lib-esm/core/resolve.spec.js +340 -0
- package/lib-esm/core/resolve.spec.js.map +1 -0
- package/lib-esm/core/select-locale.d.ts +1 -0
- package/lib-esm/core/select-locale.js +39 -0
- package/lib-esm/core/select-locale.js.map +1 -0
- package/lib-esm/core/select-locale.spec.d.ts +1 -0
- package/lib-esm/core/select-locale.spec.js +25 -0
- package/lib-esm/core/select-locale.spec.js.map +1 -0
- package/lib-esm/core/set-locale-browser.spec.d.ts +1 -0
- package/lib-esm/core/set-locale-browser.spec.js +15 -0
- package/lib-esm/core/set-locale-browser.spec.js.map +1 -0
- package/lib-esm/core/set-locale-node.spec.d.ts +1 -0
- package/lib-esm/core/set-locale-node.spec.js +24 -0
- package/lib-esm/core/set-locale-node.spec.js.map +1 -0
- package/lib-esm/core/split-locale.d.ts +7 -0
- package/lib-esm/core/split-locale.js +35 -0
- package/lib-esm/core/split-locale.js.map +1 -0
- package/lib-esm/core/split-locale.spec.d.ts +1 -0
- package/lib-esm/core/split-locale.spec.js +57 -0
- package/lib-esm/core/split-locale.spec.js.map +1 -0
- package/lib-esm/core/textdomain.d.ts +55 -0
- package/lib-esm/core/textdomain.js +274 -0
- package/lib-esm/core/textdomain.js.map +1 -0
- package/lib-esm/core/textdomain.spec.d.ts +1 -0
- package/lib-esm/core/textdomain.spec.js +31 -0
- package/lib-esm/core/textdomain.spec.js.map +1 -0
- package/lib-esm/core/user-locales.d.ts +1 -0
- package/lib-esm/core/user-locales.js +8 -0
- package/lib-esm/core/user-locales.js.map +1 -0
- package/lib-esm/index-browser.d.ts +2 -0
- package/lib-esm/index-browser.js +26 -0
- package/lib-esm/index-browser.js.map +1 -0
- package/lib-esm/index.d.ts +2 -0
- package/lib-esm/index.js +19 -0
- package/lib-esm/index.js.map +1 -0
- package/lib-esm/parser/index.d.ts +2 -0
- package/lib-esm/parser/index.js +3 -0
- package/lib-esm/parser/index.js.map +1 -0
- package/lib-esm/parser/parse-json-catalog.d.ts +3 -0
- package/lib-esm/parser/parse-json-catalog.js +32 -0
- package/lib-esm/parser/parse-json-catalog.js.map +1 -0
- package/lib-esm/parser/parse-json-catalog.spec.d.ts +1 -0
- package/lib-esm/parser/parse-json-catalog.spec.js +39 -0
- package/lib-esm/parser/parse-json-catalog.spec.js.map +1 -0
- package/lib-esm/parser/parse-mo-catalog.d.ts +2 -0
- package/lib-esm/parser/parse-mo-catalog.js +82 -0
- package/lib-esm/parser/parse-mo-catalog.js.map +1 -0
- package/lib-esm/parser/parse-mo-catalog.spec.d.ts +1 -0
- package/lib-esm/parser/parse-mo-catalog.spec.js +113 -0
- package/lib-esm/parser/parse-mo-catalog.spec.js.map +1 -0
- package/lib-esm/transport/fs.d.ts +4 -0
- package/lib-esm/transport/fs.js +15 -0
- package/lib-esm/transport/fs.js.map +1 -0
- package/lib-esm/transport/http.d.ts +4 -0
- package/lib-esm/transport/http.js +24 -0
- package/lib-esm/transport/http.js.map +1 -0
- package/lib-esm/transport/http.spec.d.ts +1 -0
- package/lib-esm/transport/http.spec.js +114 -0
- package/lib-esm/transport/http.spec.js.map +1 -0
- package/lib-esm/transport/index.d.ts +3 -0
- package/lib-esm/transport/index.js +4 -0
- package/lib-esm/transport/index.js.map +1 -0
- package/lib-esm/transport/transport.interface.d.ts +3 -0
- package/lib-esm/transport/transport.interface.js +2 -0
- package/lib-esm/transport/transport.interface.js.map +1 -0
- package/package.json +72 -0
- package/webpack.common.js +38 -0
- package/webpack.dev.js +9 -0
- package/webpack.prod.js +8 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var split_locale_1 = require("./split-locale");
|
|
4
|
+
var explode_locale_1 = require("./explode-locale");
|
|
5
|
+
describe('explode locale', function () {
|
|
6
|
+
describe('web', function () {
|
|
7
|
+
it('de', function () {
|
|
8
|
+
var paths = (0, explode_locale_1.explodeLocale)((0, split_locale_1.splitLocale)('de'));
|
|
9
|
+
expect(paths).toEqual([['de']]);
|
|
10
|
+
});
|
|
11
|
+
it('de-at', function () {
|
|
12
|
+
var paths = (0, explode_locale_1.explodeLocale)((0, split_locale_1.splitLocale)('de-at'));
|
|
13
|
+
expect(paths).toEqual([['de-at']]);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
describe('server', function () {
|
|
17
|
+
it('de_DE', function () {
|
|
18
|
+
var paths = (0, explode_locale_1.explodeLocale)((0, split_locale_1.splitLocale)('de_DE'), true);
|
|
19
|
+
expect(paths).toEqual([['de'], ['de_DE']]);
|
|
20
|
+
});
|
|
21
|
+
it('de_DE@ksh', function () {
|
|
22
|
+
var paths = (0, explode_locale_1.explodeLocale)((0, split_locale_1.splitLocale)('de_DE@ksh'), true);
|
|
23
|
+
expect(paths).toEqual([['de@ksh'], ['de_DE@ksh']]);
|
|
24
|
+
});
|
|
25
|
+
it('de_DE.UTF-8@ksh', function () {
|
|
26
|
+
var paths = (0, explode_locale_1.explodeLocale)((0, split_locale_1.splitLocale)('de_DE.UTF-8@ksh'), true);
|
|
27
|
+
expect(paths).toEqual([
|
|
28
|
+
['de.UTF-8@ksh', 'de@ksh'],
|
|
29
|
+
['de_DE.UTF-8@ksh', 'de_DE@ksh'],
|
|
30
|
+
]);
|
|
31
|
+
});
|
|
32
|
+
it('de_DE.utf-8@ksh', function () {
|
|
33
|
+
var paths = (0, explode_locale_1.explodeLocale)((0, split_locale_1.splitLocale)('de_DE.utf-8@ksh'), true);
|
|
34
|
+
expect(paths).toEqual([
|
|
35
|
+
['de.utf-8@ksh', 'de.UTF-8@ksh', 'de@ksh'],
|
|
36
|
+
['de_DE.utf-8@ksh', 'de_DE.UTF-8@ksh', 'de_DE@ksh'],
|
|
37
|
+
]);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=explode-locale.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explode-locale.spec.js","sourceRoot":"","sources":["../../src/core/explode-locale.spec.ts"],"names":[],"mappings":";;AAAA,+CAA0D;AAC1D,mDAAiD;AAEjD,QAAQ,CAAC,gBAAgB,EAAE;IAC1B,QAAQ,CAAC,KAAK,EAAE;QACf,EAAE,CAAC,IAAI,EAAE;YACR,IAAM,KAAK,GAAG,IAAA,8BAAa,EAAC,IAAA,0BAAW,EAAC,IAAI,CAAgB,CAAC,CAAC;YAC9D,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,OAAO,EAAE;YACX,IAAM,KAAK,GAAG,IAAA,8BAAa,EAAC,IAAA,0BAAW,EAAC,OAAO,CAAgB,CAAC,CAAC;YACjE,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,QAAQ,EAAE;QAClB,EAAE,CAAC,OAAO,EAAE;YACX,IAAM,KAAK,GAAG,IAAA,8BAAa,EAAC,IAAA,0BAAW,EAAC,OAAO,CAAgB,EAAE,IAAI,CAAC,CAAC;YACvE,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,WAAW,EAAE;YACf,IAAM,KAAK,GAAG,IAAA,8BAAa,EAAC,IAAA,0BAAW,EAAC,WAAW,CAAgB,EAAE,IAAI,CAAC,CAAC;YAC3E,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,iBAAiB,EAAE;YACrB,IAAM,KAAK,GAAG,IAAA,8BAAa,EAAC,IAAA,0BAAW,EAAC,iBAAiB,CAAgB,EAAE,IAAI,CAAC,CAAC;YACjF,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;gBACrB,CAAC,cAAc,EAAE,QAAQ,CAAC;gBAC1B,CAAC,iBAAiB,EAAE,WAAW,CAAC;aAChC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,iBAAiB,EAAE;YACrB,IAAM,KAAK,GAAG,IAAA,8BAAa,EAAC,IAAA,0BAAW,EAAC,iBAAiB,CAAgB,EAAE,IAAI,CAAC,CAAC;YACjF,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;gBACrB,CAAC,cAAc,EAAE,cAAc,EAAE,QAAQ,CAAC;gBAC1C,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,WAAW,CAAC;aACnD,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function germanicPlural(numItems: number): number;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.germanicPlural = void 0;
|
|
4
|
+
function germanicPlural(numItems) {
|
|
5
|
+
return numItems === 1 ? 0 : 1;
|
|
6
|
+
}
|
|
7
|
+
exports.germanicPlural = germanicPlural;
|
|
8
|
+
//# sourceMappingURL=germanic-plural.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"germanic-plural.js","sourceRoot":"","sources":["../../src/core/germanic-plural.ts"],"names":[],"mappings":";;;AAOA,SAAgB,cAAc,CAAC,QAAgB;IAC9C,OAAO,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/B,CAAC;AAFD,wCAEC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gettextImpl = void 0;
|
|
4
|
+
var germanic_plural_1 = require("./germanic-plural");
|
|
5
|
+
function gettextImpl(args) {
|
|
6
|
+
var _a;
|
|
7
|
+
var key = typeof args.msgctxt === 'undefined'
|
|
8
|
+
? args.msgid
|
|
9
|
+
: args.msgctxt + '\u0004' + args.msgid;
|
|
10
|
+
var translations = args.catalog.entries[key];
|
|
11
|
+
var numItems = (_a = args.numItems) !== null && _a !== void 0 ? _a : 1;
|
|
12
|
+
if (translations && translations.length) {
|
|
13
|
+
if (typeof args.msgidPlural === 'undefined') {
|
|
14
|
+
return translations[0];
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
var pluralForm = args.catalog.pluralFunction(numItems);
|
|
18
|
+
if (pluralForm >= translations.length) {
|
|
19
|
+
if (translations.length === 1) {
|
|
20
|
+
return translations[0];
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
pluralForm = (0, germanic_plural_1.germanicPlural)(numItems);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return translations[pluralForm];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else if (typeof args.msgidPlural !== 'undefined') {
|
|
30
|
+
var pluralform = args.catalog.pluralFunction(numItems);
|
|
31
|
+
if (pluralform === 1) {
|
|
32
|
+
return args.msgidPlural;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return args.msgid;
|
|
36
|
+
}
|
|
37
|
+
exports.gettextImpl = gettextImpl;
|
|
38
|
+
//# sourceMappingURL=gettext-impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gettext-impl.js","sourceRoot":"","sources":["../../src/core/gettext-impl.ts"],"names":[],"mappings":";;;AACA,qDAAmD;AAUnD,SAAgB,WAAW,CAAC,IAAqB;;IAChD,IAAM,GAAG,GACR,OAAO,IAAI,CAAC,OAAO,KAAK,WAAW;QAClC,CAAC,CAAC,IAAI,CAAC,KAAK;QACZ,CAAC,CAAC,IAAI,CAAC,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC;IACzC,IAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/C,IAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,QAAQ,mCAAI,CAAC,CAAC;IAEpC,IAAI,YAAY,IAAI,YAAY,CAAC,MAAM,EAAE,CAAC;QACzC,IAAI,OAAO,IAAI,CAAC,WAAW,KAAK,WAAW,EAAE,CAAC;YAC7C,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC;QACxB,CAAC;aAAM,CAAC;YACP,IAAI,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;YACvD,IAAI,UAAU,IAAI,YAAY,CAAC,MAAM,EAAE,CAAC;gBACvC,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBAC/B,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC;gBACxB,CAAC;qBAAM,CAAC;oBACP,UAAU,GAAG,IAAA,gCAAc,EAAC,QAAQ,CAAC,CAAC;gBACvC,CAAC;YACF,CAAC;YACD,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC;QACjC,CAAC;IACF,CAAC;SAAM,IAAI,OAAO,IAAI,CAAC,WAAW,KAAK,WAAW,EAAE,CAAC;QACpD,IAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QACzD,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC,WAAW,CAAC;QACzB,CAAC;IACF,CAAC;IAED,OAAO,IAAI,CAAC,KAAK,CAAC;AACnB,CAAC;AA9BD,kCA8BC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var textdomain_1 = require("./textdomain");
|
|
4
|
+
var gettext_impl_1 = require("./gettext-impl");
|
|
5
|
+
describe('translation functions without catalog', function () {
|
|
6
|
+
var gtx = textdomain_1.Textdomain.getInstance('test');
|
|
7
|
+
describe('normal gettext (_)', function () {
|
|
8
|
+
it('should echo its argument', function () {
|
|
9
|
+
expect(gtx._('foobar')).toEqual('foobar');
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
describe('gettext with expansion (_x)', function () {
|
|
13
|
+
it('should expand placeholders', function () {
|
|
14
|
+
expect(gtx._x('Hello, {name}!', { name: 'world' })).toEqual('Hello, world!');
|
|
15
|
+
});
|
|
16
|
+
it('should preserve unknown placeholders', function () {
|
|
17
|
+
expect(gtx._x('Hello, {name}!', {})).toEqual('Hello, {name}!');
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
describe('existing translations for locale de', function () {
|
|
22
|
+
var gtx = textdomain_1.Textdomain.getInstance('existing');
|
|
23
|
+
beforeAll(function () {
|
|
24
|
+
textdomain_1.Textdomain.locale = 'de';
|
|
25
|
+
return gtx.resolve();
|
|
26
|
+
});
|
|
27
|
+
describe('locale should be de indeed', function () {
|
|
28
|
+
it('should use the locale de', function () {
|
|
29
|
+
expect(textdomain_1.Textdomain.locale).toEqual('de');
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
describe('normal strings', function () {
|
|
33
|
+
it('should translate "December"', function () {
|
|
34
|
+
expect(gtx._('December')).toEqual('Dezember');
|
|
35
|
+
});
|
|
36
|
+
it('should translate "September" to an identical string', function () {
|
|
37
|
+
expect(gtx._('September')).toEqual('September');
|
|
38
|
+
});
|
|
39
|
+
it('should translate "January" to German not Austrian', function () {
|
|
40
|
+
expect(gtx._('January')).toEqual('Januar');
|
|
41
|
+
});
|
|
42
|
+
it('should translate "February" to German not Austrian', function () {
|
|
43
|
+
expect(gtx._('February')).toEqual('Februar');
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
describe('translations from multiple packages de', function () {
|
|
48
|
+
var gtx1 = textdomain_1.Textdomain.getInstance('existing');
|
|
49
|
+
var gtx2 = textdomain_1.Textdomain.getInstance('additional');
|
|
50
|
+
beforeAll(function () {
|
|
51
|
+
textdomain_1.Textdomain.locale = 'de';
|
|
52
|
+
return gtx1.resolve();
|
|
53
|
+
});
|
|
54
|
+
describe('locale should be de indeed', function () {
|
|
55
|
+
it('should use the locale de', function () {
|
|
56
|
+
expect(textdomain_1.Textdomain.locale).toEqual('de');
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
describe('normal strings', function () {
|
|
60
|
+
it('should translate "January" from first domain', function () {
|
|
61
|
+
expect(gtx1._('January')).toEqual('Januar');
|
|
62
|
+
});
|
|
63
|
+
it('should translate "Saturday" from second domain', function () {
|
|
64
|
+
expect(gtx2._('Saturday')).toEqual('Samstag');
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
describe('existing translations for locale de_AT', function () {
|
|
69
|
+
var gtx = textdomain_1.Textdomain.getInstance('existing');
|
|
70
|
+
beforeAll(function () {
|
|
71
|
+
textdomain_1.Textdomain.locale = 'de_AT';
|
|
72
|
+
return gtx.resolve();
|
|
73
|
+
});
|
|
74
|
+
describe('locale should be de_AT indeed', function () {
|
|
75
|
+
it('should use the locale de_AT', function () {
|
|
76
|
+
expect(textdomain_1.Textdomain.locale).toEqual('de_AT');
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
describe('normal strings', function () {
|
|
80
|
+
it('should translate "December"', function () {
|
|
81
|
+
expect(gtx._('December')).toEqual('Dezember');
|
|
82
|
+
});
|
|
83
|
+
it('should translate "September" to an identical string', function () {
|
|
84
|
+
expect(gtx._('September')).toEqual('September');
|
|
85
|
+
});
|
|
86
|
+
it('should translate "January" to Austrian not German', function () {
|
|
87
|
+
expect(gtx._('January')).toEqual('Jänner');
|
|
88
|
+
});
|
|
89
|
+
it('should translate "February" to Austrian not German', function () {
|
|
90
|
+
expect(gtx._('February')).toEqual('Feber');
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
describe('_x() (placeholder strings)', function () {
|
|
95
|
+
var gtx = textdomain_1.Textdomain.getInstance('existing');
|
|
96
|
+
beforeAll(function () {
|
|
97
|
+
textdomain_1.Textdomain.locale = 'de_AT';
|
|
98
|
+
return gtx.resolve();
|
|
99
|
+
});
|
|
100
|
+
describe('locale should be de_AT indeed', function () {
|
|
101
|
+
it('should use the locale de_AT', function () {
|
|
102
|
+
expect(textdomain_1.Textdomain.locale).toEqual('de_AT');
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
describe('tests', function () {
|
|
106
|
+
it('should expand all placeholders', function () {
|
|
107
|
+
expect(gtx._x('The colors are {color1}, {color2}, and {color3}.', {
|
|
108
|
+
color1: gtx._('red'),
|
|
109
|
+
color2: gtx._('green'),
|
|
110
|
+
color3: gtx._('blue'),
|
|
111
|
+
})).toEqual('Die Farben sind Rot, Grün und Blau.');
|
|
112
|
+
});
|
|
113
|
+
it('should preserve undefined placeholders', function () {
|
|
114
|
+
expect(gtx._x('The colors are {color1}, {color2}, and {color3}.', {
|
|
115
|
+
color1: gtx._('red'),
|
|
116
|
+
colorTypo: gtx._('green'),
|
|
117
|
+
color3: gtx._('blue'),
|
|
118
|
+
})).toEqual('Die Farben sind Rot, {color2} und Blau.');
|
|
119
|
+
});
|
|
120
|
+
it('should ignore excess placeholders', function () {
|
|
121
|
+
expect(gtx._x('The colors are {color1}, {color2}, and {color3}.', {
|
|
122
|
+
color1: gtx._('red'),
|
|
123
|
+
color2: gtx._('green'),
|
|
124
|
+
color3: gtx._('blue'),
|
|
125
|
+
color4: gtx._('brown'),
|
|
126
|
+
})).toEqual('Die Farben sind Rot, Grün und Blau.');
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
describe('_n() (plural forms)', function () {
|
|
131
|
+
var gtx = textdomain_1.Textdomain.getInstance('existing');
|
|
132
|
+
beforeAll(function () {
|
|
133
|
+
textdomain_1.Textdomain.locale = 'de_AT';
|
|
134
|
+
return gtx.resolve();
|
|
135
|
+
});
|
|
136
|
+
describe('locale should be de_AT indeed', function () {
|
|
137
|
+
it('should use the locale de_AT', function () {
|
|
138
|
+
expect(textdomain_1.Textdomain.locale).toEqual('de_AT');
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
describe('tests', function () {
|
|
142
|
+
it('should select the plural', function () {
|
|
143
|
+
expect(gtx._n('Singular', 'Plural', 0)).toEqual('Mehrzahl');
|
|
144
|
+
});
|
|
145
|
+
it('should select the singular', function () {
|
|
146
|
+
expect(gtx._n('Singular', 'Plural', 1)).toEqual('Einzahl');
|
|
147
|
+
});
|
|
148
|
+
it('should select the plural', function () {
|
|
149
|
+
expect(gtx._n('Singular', 'Plural', 2)).toEqual('Mehrzahl');
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
describe('_nx() (plural forms with placeholder expansion)', function () {
|
|
154
|
+
var gtx = textdomain_1.Textdomain.getInstance('existing');
|
|
155
|
+
beforeAll(function () {
|
|
156
|
+
textdomain_1.Textdomain.locale = 'de_AT';
|
|
157
|
+
return gtx.resolve();
|
|
158
|
+
});
|
|
159
|
+
describe('locale should be de_AT indeed', function () {
|
|
160
|
+
it('should use the locale de_AT', function () {
|
|
161
|
+
expect(textdomain_1.Textdomain.locale).toEqual('de_AT');
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
describe('tests', function () {
|
|
165
|
+
it('should select the singular', function () {
|
|
166
|
+
expect(gtx._nx('One directory has been deleted.', '{num} directories have been deleted.', 1, { num: 1 })).toEqual('Ein Verzeichnis wurde gelöscht.');
|
|
167
|
+
});
|
|
168
|
+
it('should select the singular', function () {
|
|
169
|
+
expect(gtx._nx('One directory has been deleted.', '{numDirs} directories have been deleted.', 2304, { num: 2304 })).toEqual('2304 Verzeichnisse wurden gelöscht.');
|
|
170
|
+
});
|
|
171
|
+
it('should work without placeholders', function () {
|
|
172
|
+
expect(gtx._nx('One directory has been deleted.', '{numDirs} directories have been deleted.', 2304)).toEqual('{num} Verzeichnisse wurden gelöscht.');
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
describe('_p() (with context)', function () {
|
|
177
|
+
var gtx = textdomain_1.Textdomain.getInstance('existing');
|
|
178
|
+
beforeAll(function () {
|
|
179
|
+
textdomain_1.Textdomain.locale = 'de_AT';
|
|
180
|
+
return gtx.resolve();
|
|
181
|
+
});
|
|
182
|
+
describe('locale should be de_AT indeed', function () {
|
|
183
|
+
it('should use the locale de_AT', function () {
|
|
184
|
+
expect(textdomain_1.Textdomain.locale).toEqual('de_AT');
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
describe('tests', function () {
|
|
188
|
+
it('should select no context', function () {
|
|
189
|
+
expect(gtx._('View')).toEqual('Anzeigen');
|
|
190
|
+
});
|
|
191
|
+
it('should select the 1st context', function () {
|
|
192
|
+
expect(gtx._p('Which folder would you like to view?', 'View')).toEqual('Ansicht');
|
|
193
|
+
});
|
|
194
|
+
it('should select the 2nd context', function () {
|
|
195
|
+
expect(gtx._p('Which folder would you like to view? (2)', 'View')).toEqual('View 2');
|
|
196
|
+
});
|
|
197
|
+
it('should use the original string for unknown contexts', function () {
|
|
198
|
+
expect(gtx._p('gips.net', 'View')).toEqual('View');
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
describe('_px() (with context and placeholders)', function () {
|
|
203
|
+
var gtx = textdomain_1.Textdomain.getInstance('existing');
|
|
204
|
+
beforeAll(function () {
|
|
205
|
+
textdomain_1.Textdomain.locale = 'de_AT';
|
|
206
|
+
return gtx.resolve();
|
|
207
|
+
});
|
|
208
|
+
describe('locale should be de_AT indeed', function () {
|
|
209
|
+
it('should use the locale de_AT', function () {
|
|
210
|
+
expect(textdomain_1.Textdomain.locale).toEqual('de_AT');
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
describe('tests', function () {
|
|
214
|
+
it('should select no context', function () {
|
|
215
|
+
expect(gtx._x('The colors are {color1}, {color2}, and {color3}.', {
|
|
216
|
+
color1: gtx._('red'),
|
|
217
|
+
color2: gtx._('green'),
|
|
218
|
+
color3: gtx._('blue'),
|
|
219
|
+
})).toEqual('Die Farben sind Rot, Grün und Blau.');
|
|
220
|
+
});
|
|
221
|
+
it("should select the 'colon' context", function () {
|
|
222
|
+
expect(gtx._px('colon', 'The colors are {color1}, {color2}, and {color3}.', {
|
|
223
|
+
color1: gtx._('red'),
|
|
224
|
+
color2: gtx._('green'),
|
|
225
|
+
color3: gtx._('blue'),
|
|
226
|
+
})).toEqual('Die Farben sind: Rot, Grün und Blau.');
|
|
227
|
+
});
|
|
228
|
+
it('should use the original string for unknown contexts', function () {
|
|
229
|
+
expect(gtx._px('gips.net', 'The colors are {color1}, {color2}, and {color3}.', {
|
|
230
|
+
color1: gtx._('red'),
|
|
231
|
+
color2: gtx._('green'),
|
|
232
|
+
color3: gtx._('blue'),
|
|
233
|
+
})).toEqual('The colors are Rot, Grün, and Blau.');
|
|
234
|
+
});
|
|
235
|
+
it('should work without placeholders', function () {
|
|
236
|
+
expect(gtx._px('gips.net', 'The colors are {color1}, {color2}, and {color3}.')).toEqual('The colors are {color1}, {color2}, and {color3}.');
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
describe('_np() (with context and placeholders)', function () {
|
|
241
|
+
var gtx = textdomain_1.Textdomain.getInstance('existing');
|
|
242
|
+
beforeAll(function () {
|
|
243
|
+
textdomain_1.Textdomain.locale = 'de_AT';
|
|
244
|
+
return gtx.resolve();
|
|
245
|
+
});
|
|
246
|
+
describe('locale should be de_AT indeed', function () {
|
|
247
|
+
it('should use the locale de_AT', function () {
|
|
248
|
+
expect(textdomain_1.Textdomain.locale).toEqual('de_AT');
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
describe('tests', function () {
|
|
252
|
+
it('should select the singular without context', function () {
|
|
253
|
+
expect(gtx._n('Singular', 'Plural', 1)).toEqual('Einzahl');
|
|
254
|
+
});
|
|
255
|
+
it('should select the plural without context', function () {
|
|
256
|
+
expect(gtx._n('Singular', 'Plural', 2)).toEqual('Mehrzahl');
|
|
257
|
+
});
|
|
258
|
+
it('should select the singular with context', function () {
|
|
259
|
+
expect(gtx._np('Context here (2)', 'Singular', 'Plural', 1)).toEqual('Einzahl 2');
|
|
260
|
+
});
|
|
261
|
+
it('should select the plural with context', function () {
|
|
262
|
+
expect(gtx._np('Context here (2)', 'Singular', 'Plural', 2)).toEqual('Mehrzahl 2');
|
|
263
|
+
});
|
|
264
|
+
it('should select the singular with unknown context', function () {
|
|
265
|
+
expect(gtx._np('gips.net', 'Singular', 'Plural', 1)).toEqual('Singular');
|
|
266
|
+
});
|
|
267
|
+
it('should select the plural with unknown context', function () {
|
|
268
|
+
expect(gtx._np('gips.net', 'Singular', 'Plural', 2)).toEqual('Plural');
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
describe('_npx() (with plural, context and placeholders)', function () {
|
|
273
|
+
var gtx = textdomain_1.Textdomain.getInstance('existing');
|
|
274
|
+
beforeAll(function () {
|
|
275
|
+
textdomain_1.Textdomain.locale = 'de_AT';
|
|
276
|
+
return gtx.resolve();
|
|
277
|
+
});
|
|
278
|
+
describe('locale should be de_AT indeed', function () {
|
|
279
|
+
it('should use the locale de_AT', function () {
|
|
280
|
+
expect(textdomain_1.Textdomain.locale).toEqual('de_AT');
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
describe('tests', function () {
|
|
284
|
+
it('should select no context and the singular', function () {
|
|
285
|
+
expect(gtx._nx('One directory has been deleted.', '{num} directories have been deleted.', 1, { num: 1 })).toEqual('Ein Verzeichnis wurde gelöscht.');
|
|
286
|
+
});
|
|
287
|
+
it('should select no context and the plural', function () {
|
|
288
|
+
expect(gtx._nx('One directory has been deleted.', '{num} directories have been deleted.', 2304, { num: 2304 })).toEqual('2304 Verzeichnisse wurden gelöscht.');
|
|
289
|
+
});
|
|
290
|
+
it('should select windows context and the singular', function () {
|
|
291
|
+
expect(gtx._npx('Windows', 'One directory has been deleted.', '{num} directories have been deleted.', 1, { num: 1 })).toEqual('Ein Ordner wurde gelöscht.');
|
|
292
|
+
});
|
|
293
|
+
it('should select windows context and the plural', function () {
|
|
294
|
+
expect(gtx._npx('Windows', 'One directory has been deleted.', '{num} directories have been deleted.', 2304, { num: 2304 })).toEqual('2304 Ordner wurden gelöscht.');
|
|
295
|
+
});
|
|
296
|
+
it('should select unknown context and the singular', function () {
|
|
297
|
+
expect(gtx._npx('Linux', 'One directory has been deleted.', '{num} directories have been deleted.', 1, { num: 1 })).toEqual('One directory has been deleted.');
|
|
298
|
+
});
|
|
299
|
+
it('should select unknown context and the plural', function () {
|
|
300
|
+
expect(gtx._npx('Linux', 'One directory has been deleted.', '{num} directories have been deleted.', 2304, { num: 2304 })).toEqual('2304 directories have been deleted.');
|
|
301
|
+
});
|
|
302
|
+
it('should work without placeholders', function () {
|
|
303
|
+
expect(gtx._npx('Linux', 'One directory has been deleted.', '{num} directories have been deleted.', 2304)).toEqual('{num} directories have been deleted.');
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
});
|
|
307
|
+
describe('_l methods with fixed locale', function () {
|
|
308
|
+
var gtx = textdomain_1.Textdomain.getInstance('existing');
|
|
309
|
+
beforeAll(function () {
|
|
310
|
+
return gtx.resolve('de');
|
|
311
|
+
});
|
|
312
|
+
describe('tests', function () {
|
|
313
|
+
describe('_l', function () {
|
|
314
|
+
it('should translate "January"', function () {
|
|
315
|
+
expect(gtx._l('de', 'January')).toEqual('Januar');
|
|
316
|
+
});
|
|
317
|
+
it('should expand all placeholders', function () {
|
|
318
|
+
expect(gtx._lx('de', 'The colors are {color1}, {color2}, and {color3}.', {
|
|
319
|
+
color1: gtx._('red'),
|
|
320
|
+
color2: gtx._('green'),
|
|
321
|
+
color3: gtx._('blue'),
|
|
322
|
+
})).toEqual('Die Farben sind Rot, Grün und Blau.');
|
|
323
|
+
});
|
|
324
|
+
});
|
|
325
|
+
});
|
|
326
|
+
});
|
|
327
|
+
describe('no-op methods', function () {
|
|
328
|
+
var gtx = textdomain_1.Textdomain.getInstance('test');
|
|
329
|
+
describe('N_()', function () {
|
|
330
|
+
it('the instance method should return the msgid', function () {
|
|
331
|
+
expect(gtx.N_('one')).toEqual('one');
|
|
332
|
+
});
|
|
333
|
+
it('the class method should return the msgid', function () {
|
|
334
|
+
expect(textdomain_1.Textdomain.N_('one')).toEqual('one');
|
|
335
|
+
});
|
|
336
|
+
});
|
|
337
|
+
describe('N_x()', function () {
|
|
338
|
+
it('the instance method should return the expanded msgid', function () {
|
|
339
|
+
expect(gtx.N_x('age: {age}', { age: 7 })).toEqual('age: 7');
|
|
340
|
+
});
|
|
341
|
+
it('the class method should return the expanded msgid', function () {
|
|
342
|
+
expect(textdomain_1.Textdomain.N_x('age: {age}', { age: 7 })).toEqual('age: 7');
|
|
343
|
+
});
|
|
344
|
+
});
|
|
345
|
+
describe('N_p()', function () {
|
|
346
|
+
it('the instance method should return the msgid', function () {
|
|
347
|
+
expect(gtx.N_p('whatever', 'one')).toEqual('one');
|
|
348
|
+
});
|
|
349
|
+
it('the class method should return the msgid', function () {
|
|
350
|
+
expect(textdomain_1.Textdomain.N_p('whatever', 'one')).toEqual('one');
|
|
351
|
+
});
|
|
352
|
+
});
|
|
353
|
+
describe('N_px()', function () {
|
|
354
|
+
it('the instance method should return the expanded msgid', function () {
|
|
355
|
+
expect(gtx.N_px('whatever', 'age: {age}', { age: 7 })).toEqual('age: 7');
|
|
356
|
+
});
|
|
357
|
+
it('the class method should return the expanded msgid', function () {
|
|
358
|
+
expect(textdomain_1.Textdomain.N_px('whatever', 'age: {age}', { age: 7 })).toEqual('age: 7');
|
|
359
|
+
});
|
|
360
|
+
});
|
|
361
|
+
});
|
|
362
|
+
describe('plural inconsistencies', function () {
|
|
363
|
+
var catalog = {
|
|
364
|
+
major: 0,
|
|
365
|
+
minor: 0,
|
|
366
|
+
pluralFunction: function () { return 42; },
|
|
367
|
+
entries: {
|
|
368
|
+
one: ['yksi'],
|
|
369
|
+
two: ['yksi', 'kaksi'],
|
|
370
|
+
},
|
|
371
|
+
};
|
|
372
|
+
it('should pick the only translation', function () {
|
|
373
|
+
var trans = (0, gettext_impl_1.gettextImpl)({
|
|
374
|
+
catalog: catalog,
|
|
375
|
+
msgid: 'one',
|
|
376
|
+
msgidPlural: 'two',
|
|
377
|
+
numItems: 1,
|
|
378
|
+
});
|
|
379
|
+
expect(trans).toEqual('yksi');
|
|
380
|
+
});
|
|
381
|
+
it('should use germanic plural', function () {
|
|
382
|
+
var trans = (0, gettext_impl_1.gettextImpl)({
|
|
383
|
+
catalog: catalog,
|
|
384
|
+
msgid: 'two',
|
|
385
|
+
msgidPlural: 'twos',
|
|
386
|
+
numItems: 2,
|
|
387
|
+
});
|
|
388
|
+
expect(trans).toEqual('kaksi');
|
|
389
|
+
});
|
|
390
|
+
});
|
|
391
|
+
//# sourceMappingURL=gettext.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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K;YAClB,QAAQ,EAAE,CAAC;SACX,CAAC,CAAC;QACH,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4BAA4B,EAAE;QAChC,IAAM,KAAK,GAAG,IAAA,0BAAW,EAAC;YACzB,OAAO,SAAA;YACP,KAAK,EAAE,KAAK;YACZ,WAAW,EAAE,MAAM;YACnB,QAAQ,EAAE,CAAC;SACX,CAAC,CAAC;QACH,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./catalog"), exports);
|
|
18
|
+
__exportStar(require("./textdomain"), exports);
|
|
19
|
+
__exportStar(require("./catalog-cache"), exports);
|
|
20
|
+
__exportStar(require("./locale-container"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,+CAA6B;AAC7B,kDAAgC;AAChC,qDAAmC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale-container.js","sourceRoot":"","sources":["../../src/core/locale-container.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function pathSeparator(sep?: string): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pathSeparator = void 0;
|
|
4
|
+
var usePathSeparator = '/';
|
|
5
|
+
function pathSeparator(sep) {
|
|
6
|
+
if (typeof sep !== 'undefined') {
|
|
7
|
+
usePathSeparator = sep;
|
|
8
|
+
}
|
|
9
|
+
return usePathSeparator;
|
|
10
|
+
}
|
|
11
|
+
exports.pathSeparator = pathSeparator;
|
|
12
|
+
//# sourceMappingURL=path-separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-separator.js","sourceRoot":"","sources":["../../src/core/path-separator.ts"],"names":[],"mappings":";;;AAAA,IAAI,gBAAgB,GAAG,GAAG,CAAC;AAM3B,SAAgB,aAAa,CAAC,GAAY;IACzC,IAAI,OAAO,GAAG,KAAK,WAAW,EAAE,CAAC;QAChC,gBAAgB,GAAG,GAAG,CAAC;IACxB,CAAC;IAED,OAAO,gBAAgB,CAAC;AACzB,CAAC;AAND,sCAMC"}
|