i18next-conv
Advanced tools
Comparing version 9.0.0 to 9.1.0
@@ -0,1 +1,5 @@ | ||
### 9.1.0 | ||
- add option `persistMsgIdPlural` to merge msgid and msgid_plural (po -> json -> po) | ||
### 9.0.0 | ||
@@ -2,0 +6,0 @@ |
@@ -128,2 +128,12 @@ "use strict"; | ||
const values = context[key].msgstr; | ||
if (options.persistMsgIdPlural) { | ||
// eslint-disable-next-line camelcase | ||
const _context$key = context[key], | ||
msgid = _context$key.msgid, | ||
msgid_plural = _context$key.msgid_plural; // eslint-disable-next-line camelcase | ||
if (msgid_plural && msgid !== msgid_plural) targetKey = `${msgid}|#|${msgid_plural}`; | ||
} | ||
const newValues = getGettextValues(values, locale, targetKey, options); | ||
@@ -130,0 +140,0 @@ Object.assign(appendTo, newValues); |
"use strict"; | ||
/* eslint-disable prefer-destructuring */ | ||
const GettextParser = require('gettext-parser'); | ||
@@ -122,6 +123,17 @@ | ||
} else { | ||
let msgid = kv.key; // eslint-disable-next-line camelcase | ||
let msgid_plural = kv.key; | ||
if (options.persistMsgIdPlural && kv.key.indexOf('|#|') > -1) { | ||
const p = kv.key.split('|#|'); | ||
msgid = p[0]; // eslint-disable-next-line camelcase | ||
msgid_plural = p[1]; | ||
} | ||
trans[kv.context][kv.key] = { | ||
msgctxt: kv.context, | ||
msgid: kv.key, | ||
msgid_plural: kv.key, | ||
msgid, | ||
msgid_plural, | ||
msgstr: pArray | ||
@@ -128,0 +140,0 @@ }; |
@@ -9,3 +9,3 @@ { | ||
], | ||
"version": "9.0.0", | ||
"version": "9.1.0", | ||
"private": false, | ||
@@ -50,3 +50,2 @@ "main": "lib", | ||
"lint": "eslint '**/*.js'", | ||
"pretest": "npm run lint", | ||
"test": "mocha", | ||
@@ -53,0 +52,0 @@ "build": "babel src --out-dir .", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43860
1229