@tanda/translation-io 0.3.4 → 0.3.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/lib/extract.js +3 -2
- package/package.json +1 -1
package/lib/extract.js
CHANGED
|
@@ -33,7 +33,8 @@ const JSON_FORMAT = _sarcastic.default.arrayOf(_sarcastic.default.shape({
|
|
|
33
33
|
}));
|
|
34
34
|
|
|
35
35
|
const LINGUI_FORMAT = _sarcastic.default.objectOf(_sarcastic.default.shape({
|
|
36
|
-
defaults: _sarcastic.default.maybe(_sarcastic.default.string)
|
|
36
|
+
defaults: _sarcastic.default.maybe(_sarcastic.default.string),
|
|
37
|
+
message: _sarcastic.default.maybe(_sarcastic.default.string)
|
|
37
38
|
}));
|
|
38
39
|
|
|
39
40
|
const normalizeId = config.normalizeIds() ? key => key.replace(/[^A-Za-z ]/g, '').replace(/ /g, '.').slice(0, 40).toLowerCase() : k => k;
|
|
@@ -54,7 +55,7 @@ const normalize = (json, format) => {
|
|
|
54
55
|
const parsed = (0, _sarcastic.default)(json, LINGUI_FORMAT);
|
|
55
56
|
return Object.keys((0, _sarcastic.default)(json, LINGUI_FORMAT)).map(key => ({
|
|
56
57
|
id: normalizeId(key),
|
|
57
|
-
defaultMessage: normalizeMessage(parsed[key].defaults || key)
|
|
58
|
+
defaultMessage: normalizeMessage(parsed[key].message || parsed[key].defaults || key)
|
|
58
59
|
}));
|
|
59
60
|
|
|
60
61
|
case 'json':
|