@opensea/i18n-extract
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -83,5 +83,5 @@ #!/usr/bin/env node | ||
return [4 /*yield*/, Promise.all(Object.keys(allTranslations).map(function (namespace) { return __awaiter(void 0, void 0, void 0, function () { | ||
var outfile, translations, old, _a, _b; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
var outfile, translations, old, _a, _b, _c; | ||
return __generator(this, function (_d) { | ||
switch (_d.label) { | ||
case 0: | ||
@@ -92,7 +92,16 @@ outfile = path_1.default.join(out, "".concat(namespace, ".json")); | ||
case 1: | ||
if (!_c.sent()) return [3 /*break*/, 3]; | ||
if (!_d.sent()) return [3 /*break*/, 6]; | ||
old = {}; | ||
_d.label = 2; | ||
case 2: | ||
_d.trys.push([2, 4, , 5]); | ||
_b = (_a = JSON).parse; | ||
return [4 /*yield*/, promises_1.default.readFile(outfile, { encoding: 'utf-8' })]; | ||
case 2: | ||
old = _b.apply(_a, [_c.sent()]); | ||
case 3: | ||
old = _b.apply(_a, [_d.sent()]); | ||
return [3 /*break*/, 5]; | ||
case 4: | ||
_c = _d.sent(); | ||
return [3 /*break*/, 5]; | ||
case 5: | ||
translations = (0, merge_1.mergeTranslations)(translations, old); | ||
@@ -103,4 +112,4 @@ if (check && !(0, lodash_isequal_1.default)(old, translations)) { | ||
} | ||
_c.label = 3; | ||
case 3: return [2 /*return*/, promises_1.default.writeFile(outfile, "".concat(JSON.stringify((0, sort_1.deepSort)(translations), null, 2), "\n"))]; | ||
_d.label = 6; | ||
case 6: return [2 /*return*/, promises_1.default.writeFile(outfile, "".concat(JSON.stringify((0, sort_1.deepSort)(translations), null, 2), "\n"))]; | ||
} | ||
@@ -107,0 +116,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
export declare const ENGLISH_PLURALS: readonly ["one", "other"]; | ||
export declare const ENGLISH_PLURALS: readonly ["0", "one", "other"]; | ||
type PluralMatch = { | ||
@@ -3,0 +3,0 @@ keyIdentifier: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isDefaultPlural = exports.getPluralMatch = exports.ENGLISH_PLURALS = void 0; | ||
exports.ENGLISH_PLURALS = ['one', 'other']; | ||
exports.ENGLISH_PLURALS = ['0', 'one', 'other']; | ||
var PLURAL_REGEX = /(.+)_(other|one|\d+)/; | ||
@@ -6,0 +6,0 @@ var getPluralMatch = function (key) { |
{ | ||
"name": "@opensea/i18n-extract", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "Package for i18n key extractions", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
66596
611