@lingui/format-po-gettext 4.0.0-next.4 → 4.0.0-next.6
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/dist/po-gettext.cjs +5 -3
- package/dist/po-gettext.mjs +4 -2
- package/package.json +6 -5
package/dist/po-gettext.cjs
CHANGED
|
@@ -4,7 +4,7 @@ const parser = require('@messageformat/parser');
|
|
|
4
4
|
const pluralsCldr = require('plurals-cldr');
|
|
5
5
|
const PO = require('pofile');
|
|
6
6
|
const gettextPlurals = require('node-gettext/lib/plurals');
|
|
7
|
-
const
|
|
7
|
+
const generateMessageId = require('@lingui/message-utils/generateMessageId');
|
|
8
8
|
const formatPo = require('@lingui/format-po');
|
|
9
9
|
|
|
10
10
|
function stringifyICUCase(icuCase) {
|
|
@@ -163,8 +163,10 @@ function formatter(options = {}) {
|
|
|
163
163
|
serialize(catalog, ctx) {
|
|
164
164
|
const po = PO.parse(formatter2.serialize(catalog, ctx));
|
|
165
165
|
po.items = po.items.map((item) => {
|
|
166
|
-
const isGeneratedId = !item.
|
|
167
|
-
|
|
166
|
+
const isGeneratedId = !item.extractedComments.includes(
|
|
167
|
+
"js-lingui-explicit-id"
|
|
168
|
+
);
|
|
169
|
+
const id = isGeneratedId ? generateMessageId.generateMessageId(item.msgid, item.msgctxt) : item.msgid;
|
|
168
170
|
const message = catalog[id];
|
|
169
171
|
return serializePlurals(item, message, id, isGeneratedId, options);
|
|
170
172
|
});
|
package/dist/po-gettext.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { parse } from '@messageformat/parser';
|
|
|
2
2
|
import pluralsCldr from 'plurals-cldr';
|
|
3
3
|
import PO from 'pofile';
|
|
4
4
|
import gettextPlurals from 'node-gettext/lib/plurals';
|
|
5
|
-
import { generateMessageId } from '@lingui/
|
|
5
|
+
import { generateMessageId } from '@lingui/message-utils/generateMessageId';
|
|
6
6
|
import { formatter as formatter$1 } from '@lingui/format-po';
|
|
7
7
|
|
|
8
8
|
function stringifyICUCase(icuCase) {
|
|
@@ -161,7 +161,9 @@ function formatter(options = {}) {
|
|
|
161
161
|
serialize(catalog, ctx) {
|
|
162
162
|
const po = PO.parse(formatter2.serialize(catalog, ctx));
|
|
163
163
|
po.items = po.items.map((item) => {
|
|
164
|
-
const isGeneratedId = !item.
|
|
164
|
+
const isGeneratedId = !item.extractedComments.includes(
|
|
165
|
+
"js-lingui-explicit-id"
|
|
166
|
+
);
|
|
165
167
|
const id = isGeneratedId ? generateMessageId(item.msgid, item.msgctxt) : item.msgid;
|
|
166
168
|
const message = catalog[id];
|
|
167
169
|
return serializePlurals(item, message, id, isGeneratedId, options);
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingui/format-po-gettext",
|
|
3
|
-
"version": "4.0.0-next.
|
|
3
|
+
"version": "4.0.0-next.6",
|
|
4
4
|
"description": "Gettext PO format with gettext-style plurals for Lingui Catalogs",
|
|
5
5
|
"main": "./dist/po-gettext.cjs",
|
|
6
6
|
"module": "./dist/po-gettext.mjs",
|
|
7
7
|
"types": "./dist/po-gettext.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
8
9
|
"license": "MIT",
|
|
9
10
|
"keywords": [
|
|
10
11
|
"i18n",
|
|
@@ -39,9 +40,9 @@
|
|
|
39
40
|
"dist/"
|
|
40
41
|
],
|
|
41
42
|
"dependencies": {
|
|
42
|
-
"@lingui/
|
|
43
|
-
"@lingui/
|
|
44
|
-
"@lingui/
|
|
43
|
+
"@lingui/conf": "^4.0.0-next.6",
|
|
44
|
+
"@lingui/format-po": "^4.0.0-next.6",
|
|
45
|
+
"@lingui/message-utils": "^4.0.0-next.6",
|
|
45
46
|
"@messageformat/parser": "^5.0.0",
|
|
46
47
|
"node-gettext": "^3.0.0",
|
|
47
48
|
"plurals-cldr": "^2.0.1",
|
|
@@ -53,5 +54,5 @@
|
|
|
53
54
|
"tsd": "^0.28.0",
|
|
54
55
|
"unbuild": "^1.1.2"
|
|
55
56
|
},
|
|
56
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "d4d9e149b2419d1796e14176d53703a7cff4b82c"
|
|
57
58
|
}
|