@angular/localize 19.0.0-next.1 → 19.0.0-next.3
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/fesm2022/init.mjs +1 -1
- package/fesm2022/localize.mjs +18 -8
- package/fesm2022/localize.mjs.map +1 -1
- package/init/index.d.ts +1 -1
- package/package.json +3 -8
- package/schematics/ng-add/ng_add_bundle.js +2 -2
- package/schematics/ng-add/ng_add_bundle.js.map +1 -1
- package/tools/bundles/{chunk-OWGLQY27.js → chunk-GGL5GE7J.js} +3 -3
- package/tools/bundles/{chunk-IO35W7IH.js → chunk-NCEP4OH2.js} +18 -18
- package/tools/bundles/{chunk-BXL2U6FQ.js → chunk-URWRI34O.js} +18 -18
- package/tools/bundles/index.js +4 -4
- package/tools/bundles/src/extract/cli.js +5 -5
- package/tools/bundles/src/migrate/cli.js +5 -5
- package/tools/bundles/src/translate/cli.js +11 -11
- package/tools/bundles_metadata.json +1 -1
- package/esm2022/index.mjs +0 -12
- package/esm2022/init/index.mjs +0 -12
- package/esm2022/localize.mjs +0 -12
- package/esm2022/private.mjs +0 -12
- package/esm2022/src/localize/doc_index.mjs +0 -9
- package/esm2022/src/localize/index.mjs +0 -9
- package/esm2022/src/localize/src/localize.mjs +0 -136
- package/esm2022/src/translate.mjs +0 -81
- package/esm2022/src/utils/index.mjs +0 -11
- package/esm2022/src/utils/src/constants.mjs +0 -58
- package/esm2022/src/utils/src/messages.mjs +0 -193
- package/esm2022/src/utils/src/translations.mjs +0 -119
- /package/tools/bundles/{chunk-OWGLQY27.js.map → chunk-GGL5GE7J.js.map} +0 -0
- /package/tools/bundles/{chunk-IO35W7IH.js.map → chunk-NCEP4OH2.js.map} +0 -0
- /package/tools/bundles/{chunk-BXL2U6FQ.js.map → chunk-URWRI34O.js.map} +0 -0
|
@@ -12,9 +12,9 @@ import {
|
|
|
12
12
|
unwrapMessagePartsFromLocalizeCall,
|
|
13
13
|
unwrapMessagePartsFromTemplateLiteral,
|
|
14
14
|
unwrapSubstitutionsFromLocalizeCall
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-GGL5GE7J.js";
|
|
16
16
|
|
|
17
|
-
// bazel-out/
|
|
17
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/source_files/es2015_translate_plugin.mjs
|
|
18
18
|
import { getFileSystem } from "@angular/compiler-cli/private/localize";
|
|
19
19
|
function makeEs2015TranslatePlugin(diagnostics, translations, { missingTranslation = "error", localizeName = "$localize" } = {}, fs = getFileSystem()) {
|
|
20
20
|
return {
|
|
@@ -39,7 +39,7 @@ function makeEs2015TranslatePlugin(diagnostics, translations, { missingTranslati
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
// bazel-out/
|
|
42
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/source_files/es5_translate_plugin.mjs
|
|
43
43
|
import { getFileSystem as getFileSystem2 } from "@angular/compiler-cli/private/localize";
|
|
44
44
|
function makeEs5TranslatePlugin(diagnostics, translations, { missingTranslation = "error", localizeName = "$localize" } = {}, fs = getFileSystem2()) {
|
|
45
45
|
return {
|
|
@@ -65,7 +65,7 @@ function makeEs5TranslatePlugin(diagnostics, translations, { missingTranslation
|
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
// bazel-out/
|
|
68
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/source_files/locale_plugin.mjs
|
|
69
69
|
import { types as t } from "@babel/core";
|
|
70
70
|
function makeLocalePlugin(locale, { localizeName = "$localize" } = {}) {
|
|
71
71
|
return {
|
|
@@ -105,7 +105,7 @@ function isLocalizeGuard(expression, localizeName) {
|
|
|
105
105
|
return left.isUnaryExpression({ operator: "typeof" }) && isLocalize(left.get("argument"), localizeName) && right.isStringLiteral({ value: "undefined" }) || right.isUnaryExpression({ operator: "typeof" }) && isLocalize(right.get("argument"), localizeName) && left.isStringLiteral({ value: "undefined" });
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
// bazel-out/
|
|
108
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/arb_translation_parser.mjs
|
|
109
109
|
import { \u0275parseTranslation } from "@angular/localize";
|
|
110
110
|
var ArbTranslationParser = class {
|
|
111
111
|
analyze(_filePath, contents) {
|
|
@@ -144,7 +144,7 @@ var ArbTranslationParser = class {
|
|
|
144
144
|
}
|
|
145
145
|
};
|
|
146
146
|
|
|
147
|
-
// bazel-out/
|
|
147
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/simple_json_translation_parser.mjs
|
|
148
148
|
import { \u0275parseTranslation as \u0275parseTranslation2 } from "@angular/localize";
|
|
149
149
|
import { extname } from "path";
|
|
150
150
|
var SimpleJsonTranslationParser = class {
|
|
@@ -189,10 +189,10 @@ var SimpleJsonTranslationParser = class {
|
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
191
|
|
|
192
|
-
// bazel-out/
|
|
192
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/xliff1_translation_parser.mjs
|
|
193
193
|
import { ParseErrorLevel as ParseErrorLevel3, visitAll as visitAll2 } from "@angular/compiler";
|
|
194
194
|
|
|
195
|
-
// bazel-out/
|
|
195
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/base_visitor.mjs
|
|
196
196
|
var BaseVisitor = class {
|
|
197
197
|
visitElement(_element, _context) {
|
|
198
198
|
}
|
|
@@ -214,10 +214,10 @@ var BaseVisitor = class {
|
|
|
214
214
|
}
|
|
215
215
|
};
|
|
216
216
|
|
|
217
|
-
// bazel-out/
|
|
217
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/message_serialization/message_serializer.mjs
|
|
218
218
|
import { Element as Element2, visitAll } from "@angular/compiler";
|
|
219
219
|
|
|
220
|
-
// bazel-out/
|
|
220
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/translation_parse_error.mjs
|
|
221
221
|
import { ParseErrorLevel } from "@angular/compiler";
|
|
222
222
|
var TranslationParseError = class extends Error {
|
|
223
223
|
constructor(span, msg, level = ParseErrorLevel.ERROR) {
|
|
@@ -239,7 +239,7 @@ At ${span.start}${span.details ? `, ${span.details}` : ""}:
|
|
|
239
239
|
return msg;
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
// bazel-out/
|
|
242
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/translation_utils.mjs
|
|
243
243
|
import { Element, ParseError, ParseErrorLevel as ParseErrorLevel2, XmlParser } from "@angular/compiler";
|
|
244
244
|
function getAttrOrThrow(element, attrName) {
|
|
245
245
|
const attrValue = getAttribute(element, attrName);
|
|
@@ -315,7 +315,7 @@ function addErrorsToBundle(bundle, errors) {
|
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
-
// bazel-out/
|
|
318
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/message_serialization/message_serializer.mjs
|
|
319
319
|
var MessageSerializer = class extends BaseVisitor {
|
|
320
320
|
constructor(renderer, config) {
|
|
321
321
|
super();
|
|
@@ -377,7 +377,7 @@ var MessageSerializer = class extends BaseVisitor {
|
|
|
377
377
|
}
|
|
378
378
|
};
|
|
379
379
|
|
|
380
|
-
// bazel-out/
|
|
380
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/message_serialization/target_message_renderer.mjs
|
|
381
381
|
import { \u0275makeParsedTranslation } from "@angular/localize";
|
|
382
382
|
var TargetMessageRenderer = class {
|
|
383
383
|
constructor() {
|
|
@@ -435,7 +435,7 @@ var TargetMessageRenderer = class {
|
|
|
435
435
|
}
|
|
436
436
|
};
|
|
437
437
|
|
|
438
|
-
// bazel-out/
|
|
438
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/serialize_translation_message.mjs
|
|
439
439
|
function serializeTranslationMessage(element, config) {
|
|
440
440
|
const { rootNodes, errors: parseErrors } = parseInnerRange(element);
|
|
441
441
|
try {
|
|
@@ -447,7 +447,7 @@ function serializeTranslationMessage(element, config) {
|
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
-
// bazel-out/
|
|
450
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/xliff1_translation_parser.mjs
|
|
451
451
|
var Xliff1TranslationParser = class {
|
|
452
452
|
analyze(filePath, contents) {
|
|
453
453
|
return canParseXml(filePath, contents, "xliff", { version: "1.2" });
|
|
@@ -524,7 +524,7 @@ var XliffTranslationVisitor = class extends BaseVisitor {
|
|
|
524
524
|
}
|
|
525
525
|
};
|
|
526
526
|
|
|
527
|
-
// bazel-out/
|
|
527
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/xliff2_translation_parser.mjs
|
|
528
528
|
import { Element as Element3, ParseErrorLevel as ParseErrorLevel4, visitAll as visitAll3 } from "@angular/compiler";
|
|
529
529
|
var Xliff2TranslationParser = class {
|
|
530
530
|
analyze(filePath, contents) {
|
|
@@ -607,7 +607,7 @@ function isFileElement(node) {
|
|
|
607
607
|
return node instanceof Element3 && node.name === "file";
|
|
608
608
|
}
|
|
609
609
|
|
|
610
|
-
// bazel-out/
|
|
610
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/xtb_translation_parser.mjs
|
|
611
611
|
import { ParseErrorLevel as ParseErrorLevel5, visitAll as visitAll4 } from "@angular/compiler";
|
|
612
612
|
import { extname as extname2 } from "path";
|
|
613
613
|
var XtbTranslationParser = class {
|
|
@@ -688,4 +688,4 @@ export {
|
|
|
688
688
|
* Use of this source code is governed by an MIT-style license that can be
|
|
689
689
|
* found in the LICENSE file at https://angular.io/license
|
|
690
690
|
*/
|
|
691
|
-
//# sourceMappingURL=chunk-
|
|
691
|
+
//# sourceMappingURL=chunk-NCEP4OH2.js.map
|
|
@@ -14,9 +14,9 @@ import {
|
|
|
14
14
|
unwrapMessagePartsFromLocalizeCall,
|
|
15
15
|
unwrapMessagePartsFromTemplateLiteral,
|
|
16
16
|
unwrapSubstitutionsFromLocalizeCall
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-GGL5GE7J.js";
|
|
18
18
|
|
|
19
|
-
// bazel-out/
|
|
19
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/duplicates.mjs
|
|
20
20
|
function checkDuplicateMessages(fs, messages, duplicateMessageHandling, basePath) {
|
|
21
21
|
const diagnostics = new Diagnostics();
|
|
22
22
|
if (duplicateMessageHandling === "ignore")
|
|
@@ -50,11 +50,11 @@ function serializeMessage(fs, basePath, message) {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
// bazel-out/
|
|
53
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/extraction.mjs
|
|
54
54
|
import { SourceFileLoader } from "@angular/compiler-cli/private/localize";
|
|
55
55
|
import { transformSync } from "@babel/core";
|
|
56
56
|
|
|
57
|
-
// bazel-out/
|
|
57
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/source_files/es2015_extract_plugin.mjs
|
|
58
58
|
import { \u0275parseMessage } from "@angular/localize";
|
|
59
59
|
function makeEs2015ExtractPlugin(fs, messages, localizeName = "$localize") {
|
|
60
60
|
return {
|
|
@@ -74,7 +74,7 @@ function makeEs2015ExtractPlugin(fs, messages, localizeName = "$localize") {
|
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
// bazel-out/
|
|
77
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/source_files/es5_extract_plugin.mjs
|
|
78
78
|
import { \u0275parseMessage as \u0275parseMessage2 } from "@angular/localize";
|
|
79
79
|
function makeEs5ExtractPlugin(fs, messages, localizeName = "$localize") {
|
|
80
80
|
return {
|
|
@@ -102,7 +102,7 @@ function makeEs5ExtractPlugin(fs, messages, localizeName = "$localize") {
|
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
// bazel-out/
|
|
105
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/extraction.mjs
|
|
106
106
|
var MessageExtractor = class {
|
|
107
107
|
constructor(fs, logger, { basePath, useSourceMaps = true, localizeName = "$localize" }) {
|
|
108
108
|
this.fs = fs;
|
|
@@ -169,7 +169,7 @@ var MessageExtractor = class {
|
|
|
169
169
|
}
|
|
170
170
|
};
|
|
171
171
|
|
|
172
|
-
// bazel-out/
|
|
172
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/utils.mjs
|
|
173
173
|
function consolidateMessages(messages, getMessageId2) {
|
|
174
174
|
const messageGroups = /* @__PURE__ */ new Map();
|
|
175
175
|
for (const message of messages) {
|
|
@@ -210,7 +210,7 @@ function compareLocations({ location: location1 }, { location: location2 }) {
|
|
|
210
210
|
return 0;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
// bazel-out/
|
|
213
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/arb_translation_serializer.mjs
|
|
214
214
|
var ArbTranslationSerializer = class {
|
|
215
215
|
constructor(sourceLocale, basePath, fs) {
|
|
216
216
|
this.sourceLocale = sourceLocale;
|
|
@@ -271,7 +271,7 @@ function getMessageId(message) {
|
|
|
271
271
|
return message.customId || message.id;
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
-
// bazel-out/
|
|
274
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/json_translation_serializer.mjs
|
|
275
275
|
var SimpleJsonTranslationSerializer = class {
|
|
276
276
|
constructor(sourceLocale) {
|
|
277
277
|
this.sourceLocale = sourceLocale;
|
|
@@ -285,7 +285,7 @@ var SimpleJsonTranslationSerializer = class {
|
|
|
285
285
|
}
|
|
286
286
|
};
|
|
287
287
|
|
|
288
|
-
// bazel-out/
|
|
288
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/legacy_message_id_migration_serializer.mjs
|
|
289
289
|
var LegacyMessageIdMigrationSerializer = class {
|
|
290
290
|
constructor(_diagnostics) {
|
|
291
291
|
this._diagnostics = _diagnostics;
|
|
@@ -314,7 +314,7 @@ function shouldMigrate(message) {
|
|
|
314
314
|
return !message.customId && !!message.legacyIds && message.legacyIds.length > 0;
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
-
// bazel-out/
|
|
317
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/format_options.mjs
|
|
318
318
|
function validateOptions(name, validOptions, options) {
|
|
319
319
|
const validOptionsMap = new Map(validOptions);
|
|
320
320
|
for (const option in options) {
|
|
@@ -334,10 +334,10 @@ function parseFormatOptions(optionString = "{}") {
|
|
|
334
334
|
return JSON.parse(optionString);
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
// bazel-out/
|
|
337
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/xliff1_translation_serializer.mjs
|
|
338
338
|
import { getFileSystem } from "@angular/compiler-cli/private/localize";
|
|
339
339
|
|
|
340
|
-
// bazel-out/
|
|
340
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/icu_parsing.mjs
|
|
341
341
|
function extractIcuPlaceholders(text) {
|
|
342
342
|
const state = new StateStack();
|
|
343
343
|
const pieces = new IcuPieces();
|
|
@@ -434,7 +434,7 @@ function assert(test, message) {
|
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
|
|
437
|
-
// bazel-out/
|
|
437
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/xml_file.mjs
|
|
438
438
|
var XmlFile = class {
|
|
439
439
|
constructor() {
|
|
440
440
|
this.output = '<?xml version="1.0" encoding="UTF-8" ?>\n';
|
|
@@ -516,7 +516,7 @@ function escapeXml(text) {
|
|
|
516
516
|
return _ESCAPED_CHARS.reduce((text2, entry) => text2.replace(entry[0], entry[1]), text);
|
|
517
517
|
}
|
|
518
518
|
|
|
519
|
-
// bazel-out/
|
|
519
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/xliff1_translation_serializer.mjs
|
|
520
520
|
var LEGACY_XLIFF_MESSAGE_LENGTH = 40;
|
|
521
521
|
var Xliff1TranslationSerializer = class {
|
|
522
522
|
constructor(sourceLocale, basePath, useLegacyIds, formatOptions = {}, fs = getFileSystem()) {
|
|
@@ -664,7 +664,7 @@ var TAG_MAP = {
|
|
|
664
664
|
"UNORDERED_LIST": "ul"
|
|
665
665
|
};
|
|
666
666
|
|
|
667
|
-
// bazel-out/
|
|
667
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/xliff2_translation_serializer.mjs
|
|
668
668
|
import { getFileSystem as getFileSystem2 } from "@angular/compiler-cli/private/localize";
|
|
669
669
|
var MAX_LEGACY_XLIFF_2_MESSAGE_LENGTH = 20;
|
|
670
670
|
var Xliff2TranslationSerializer = class {
|
|
@@ -806,7 +806,7 @@ function getTypeForPlaceholder(placeholder) {
|
|
|
806
806
|
}
|
|
807
807
|
}
|
|
808
808
|
|
|
809
|
-
// bazel-out/
|
|
809
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/xmb_translation_serializer.mjs
|
|
810
810
|
import { getFileSystem as getFileSystem3 } from "@angular/compiler-cli/private/localize";
|
|
811
811
|
var XMB_HANDLER = "angular";
|
|
812
812
|
var XmbTranslationSerializer = class {
|
|
@@ -902,4 +902,4 @@ export {
|
|
|
902
902
|
* Use of this source code is governed by an MIT-style license that can be
|
|
903
903
|
* found in the LICENSE file at https://angular.io/license
|
|
904
904
|
*/
|
|
905
|
-
//# sourceMappingURL=chunk-
|
|
905
|
+
//# sourceMappingURL=chunk-URWRI34O.js.map
|
package/tools/bundles/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
Xliff2TranslationSerializer,
|
|
12
12
|
XmbTranslationSerializer,
|
|
13
13
|
checkDuplicateMessages
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-URWRI34O.js";
|
|
15
15
|
import {
|
|
16
16
|
ArbTranslationParser,
|
|
17
17
|
SimpleJsonTranslationParser,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
makeEs2015TranslatePlugin,
|
|
22
22
|
makeEs5TranslatePlugin,
|
|
23
23
|
makeLocalePlugin
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-NCEP4OH2.js";
|
|
25
25
|
import {
|
|
26
26
|
Diagnostics,
|
|
27
27
|
buildLocalizeReplacement,
|
|
@@ -31,9 +31,9 @@ import {
|
|
|
31
31
|
unwrapMessagePartsFromLocalizeCall,
|
|
32
32
|
unwrapMessagePartsFromTemplateLiteral,
|
|
33
33
|
unwrapSubstitutionsFromLocalizeCall
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-GGL5GE7J.js";
|
|
35
35
|
|
|
36
|
-
// bazel-out/
|
|
36
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/index.mjs
|
|
37
37
|
import { NodeJSFileSystem, setFileSystem } from "@angular/compiler-cli/private/localize";
|
|
38
38
|
setFileSystem(new NodeJSFileSystem());
|
|
39
39
|
export {
|
|
@@ -13,15 +13,15 @@ import {
|
|
|
13
13
|
XmbTranslationSerializer,
|
|
14
14
|
checkDuplicateMessages,
|
|
15
15
|
parseFormatOptions
|
|
16
|
-
} from "../../chunk-
|
|
17
|
-
import "../../chunk-
|
|
16
|
+
} from "../../chunk-URWRI34O.js";
|
|
17
|
+
import "../../chunk-GGL5GE7J.js";
|
|
18
18
|
|
|
19
|
-
// bazel-out/
|
|
19
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/cli.mjs
|
|
20
20
|
import { ConsoleLogger, LogLevel, NodeJSFileSystem, setFileSystem } from "@angular/compiler-cli/private/localize";
|
|
21
21
|
import glob from "fast-glob";
|
|
22
22
|
import yargs from "yargs";
|
|
23
23
|
|
|
24
|
-
// bazel-out/
|
|
24
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/index.mjs
|
|
25
25
|
function extractTranslations({ rootPath: rootPath2, sourceFilePaths: sourceFilePaths2, sourceLocale, format: format2, outputPath: output, logger: logger2, useSourceMaps, useLegacyIds, duplicateMessageHandling: duplicateMessageHandling2, formatOptions: formatOptions2 = {}, fileSystem: fs }) {
|
|
26
26
|
const basePath = fs.resolve(rootPath2);
|
|
27
27
|
const extractor = new MessageExtractor(fs, logger2, { basePath, useSourceMaps });
|
|
@@ -64,7 +64,7 @@ function getSerializer(format2, sourceLocale, rootPath2, useLegacyIds, formatOpt
|
|
|
64
64
|
throw new Error(`No translation serializer can handle the provided format: ${format2}`);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
// bazel-out/
|
|
67
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/cli.mjs
|
|
68
68
|
process.title = "Angular Localization Message Extractor (localize-extract)";
|
|
69
69
|
var args = process.argv.slice(2);
|
|
70
70
|
var options = yargs(args).option("l", {
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
const require = __cjsCompatRequire(import.meta.url);
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
// bazel-out/
|
|
7
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/migrate/cli.mjs
|
|
8
8
|
import { ConsoleLogger, LogLevel, NodeJSFileSystem, setFileSystem } from "@angular/compiler-cli/private/localize";
|
|
9
9
|
import glob from "fast-glob";
|
|
10
10
|
import yargs from "yargs";
|
|
11
11
|
|
|
12
|
-
// bazel-out/
|
|
12
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/migrate/index.mjs
|
|
13
13
|
import { getFileSystem } from "@angular/compiler-cli/private/localize";
|
|
14
14
|
|
|
15
|
-
// bazel-out/
|
|
15
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/migrate/migrate.mjs
|
|
16
16
|
function migrateFile(sourceCode, mapping) {
|
|
17
17
|
const legacyIds = Object.keys(mapping);
|
|
18
18
|
for (const legacyId of legacyIds) {
|
|
@@ -26,7 +26,7 @@ function escapeRegExp(str) {
|
|
|
26
26
|
return str.replace(/([.*+?^=!:${}()|[\]\/\\])/g, "\\$1");
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
// bazel-out/
|
|
29
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/migrate/index.mjs
|
|
30
30
|
function migrateFiles({ rootPath: rootPath2, translationFilePaths: translationFilePaths2, mappingFilePath, logger: logger2 }) {
|
|
31
31
|
const fs2 = getFileSystem();
|
|
32
32
|
const absoluteMappingPath = fs2.resolve(rootPath2, mappingFilePath);
|
|
@@ -42,7 +42,7 @@ function migrateFiles({ rootPath: rootPath2, translationFilePaths: translationFi
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
// bazel-out/
|
|
45
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/migrate/cli.mjs
|
|
46
46
|
var args = process.argv.slice(2);
|
|
47
47
|
var options = yargs(args).option("r", {
|
|
48
48
|
alias: "root",
|
|
@@ -12,26 +12,26 @@ import {
|
|
|
12
12
|
makeEs2015TranslatePlugin,
|
|
13
13
|
makeEs5TranslatePlugin,
|
|
14
14
|
makeLocalePlugin
|
|
15
|
-
} from "../../chunk-
|
|
15
|
+
} from "../../chunk-NCEP4OH2.js";
|
|
16
16
|
import {
|
|
17
17
|
Diagnostics
|
|
18
|
-
} from "../../chunk-
|
|
18
|
+
} from "../../chunk-GGL5GE7J.js";
|
|
19
19
|
|
|
20
|
-
// bazel-out/
|
|
20
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/cli.mjs
|
|
21
21
|
import { NodeJSFileSystem, setFileSystem } from "@angular/compiler-cli/private/localize";
|
|
22
22
|
import glob from "fast-glob";
|
|
23
23
|
import yargs from "yargs";
|
|
24
24
|
|
|
25
|
-
// bazel-out/
|
|
25
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/output_path.mjs
|
|
26
26
|
function getOutputPathFn(fs2, outputFolder) {
|
|
27
27
|
const [pre, post] = outputFolder.split("{{LOCALE}}");
|
|
28
28
|
return post === void 0 ? (_locale, relativePath) => fs2.join(pre, relativePath) : (locale, relativePath) => fs2.join(pre + locale + post, relativePath);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
// bazel-out/
|
|
31
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/index.mjs
|
|
32
32
|
import { getFileSystem, relativeFrom } from "@angular/compiler-cli/private/localize";
|
|
33
33
|
|
|
34
|
-
// bazel-out/
|
|
34
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/asset_files/asset_translation_handler.mjs
|
|
35
35
|
import { absoluteFrom } from "@angular/compiler-cli/private/localize";
|
|
36
36
|
var AssetTranslationHandler = class {
|
|
37
37
|
constructor(fs2) {
|
|
@@ -59,7 +59,7 @@ var AssetTranslationHandler = class {
|
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
// bazel-out/
|
|
62
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/source_files/source_file_translation_handler.mjs
|
|
63
63
|
import { absoluteFrom as absoluteFrom2 } from "@angular/compiler-cli/private/localize";
|
|
64
64
|
import babel from "@babel/core";
|
|
65
65
|
var SourceFileTranslationHandler = class {
|
|
@@ -130,7 +130,7 @@ var SourceFileTranslationHandler = class {
|
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
132
|
|
|
133
|
-
// bazel-out/
|
|
133
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_loader.mjs
|
|
134
134
|
var TranslationLoader = class {
|
|
135
135
|
constructor(fs2, translationParsers, duplicateTranslation2, diagnostics2) {
|
|
136
136
|
this.fs = fs2;
|
|
@@ -200,7 +200,7 @@ ${parser.constructor.name} cannot parse translation file.`));
|
|
|
200
200
|
}
|
|
201
201
|
};
|
|
202
202
|
|
|
203
|
-
// bazel-out/
|
|
203
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translator.mjs
|
|
204
204
|
var Translator = class {
|
|
205
205
|
constructor(fs2, resourceHandlers, diagnostics2) {
|
|
206
206
|
this.fs = fs2;
|
|
@@ -222,7 +222,7 @@ var Translator = class {
|
|
|
222
222
|
}
|
|
223
223
|
};
|
|
224
224
|
|
|
225
|
-
// bazel-out/
|
|
225
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/index.mjs
|
|
226
226
|
function translateFiles({ sourceRootPath: sourceRootPath2, sourceFilePaths: sourceFilePaths2, translationFilePaths: translationFilePaths2, translationFileLocales: translationFileLocales2, outputPathFn: outputPathFn2, diagnostics: diagnostics2, missingTranslation: missingTranslation2, duplicateTranslation: duplicateTranslation2, sourceLocale: sourceLocale2 }) {
|
|
227
227
|
const fs2 = getFileSystem();
|
|
228
228
|
const translationLoader = new TranslationLoader(fs2, [
|
|
@@ -239,7 +239,7 @@ function translateFiles({ sourceRootPath: sourceRootPath2, sourceFilePaths: sour
|
|
|
239
239
|
resourceProcessor.translateFiles(sourceFilePaths2.map(relativeFrom), fs2.resolve(sourceRootPath2), outputPathFn2, translations, sourceLocale2);
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
// bazel-out/
|
|
242
|
+
// bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/cli.mjs
|
|
243
243
|
process.title = "Angular Localization Message Translator (localize-translate)";
|
|
244
244
|
var args = process.argv.slice(2);
|
|
245
245
|
var options = yargs(args).option("r", {
|