@angular/localize 18.0.0-next.3 → 18.0.0-next.5
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/esm2022/index.mjs +1 -1
- package/esm2022/src/localize/src/localize.mjs +2 -2
- package/fesm2022/init.mjs +2 -2
- package/fesm2022/localize.mjs +3 -3
- package/fesm2022/localize.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/init/index.d.ts +2 -2
- package/localize/index.d.ts +1 -1
- package/package.json +4 -4
- 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-AGG7OSL3.js → chunk-AEXKEUHQ.js} +3 -3
- package/tools/bundles/{chunk-D6MRN5VQ.js → chunk-HTD7ZW6Y.js} +18 -18
- package/tools/bundles/{chunk-RYPILH3L.js → chunk-QB7OQXUU.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/tools/bundles/{chunk-AGG7OSL3.js.map → chunk-AEXKEUHQ.js.map} +0 -0
- /package/tools/bundles/{chunk-D6MRN5VQ.js.map → chunk-HTD7ZW6Y.js.map} +0 -0
- /package/tools/bundles/{chunk-RYPILH3L.js.map → chunk-QB7OQXUU.js.map} +0 -0
|
@@ -12,9 +12,9 @@ import {
|
|
|
12
12
|
unwrapMessagePartsFromLocalizeCall,
|
|
13
13
|
unwrapMessagePartsFromTemplateLiteral,
|
|
14
14
|
unwrapSubstitutionsFromLocalizeCall
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-AEXKEUHQ.js";
|
|
16
16
|
|
|
17
|
-
// bazel-out/
|
|
17
|
+
// bazel-out/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-fastbuild/bin/packages/localize/tools/src/translate/translation_files/base_visitor.mjs
|
|
196
196
|
var BaseVisitor = class {
|
|
197
197
|
visitElement(_element, _context) {
|
|
198
198
|
}
|
|
@@ -212,10 +212,10 @@ var BaseVisitor = class {
|
|
|
212
212
|
}
|
|
213
213
|
};
|
|
214
214
|
|
|
215
|
-
// bazel-out/
|
|
215
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/localize/tools/src/translate/translation_files/message_serialization/message_serializer.mjs
|
|
216
216
|
import { Element as Element2, visitAll } from "@angular/compiler";
|
|
217
217
|
|
|
218
|
-
// bazel-out/
|
|
218
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/translation_parse_error.mjs
|
|
219
219
|
import { ParseErrorLevel } from "@angular/compiler";
|
|
220
220
|
var TranslationParseError = class extends Error {
|
|
221
221
|
constructor(span, msg, level = ParseErrorLevel.ERROR) {
|
|
@@ -237,7 +237,7 @@ At ${span.start}${span.details ? `, ${span.details}` : ""}:
|
|
|
237
237
|
return msg;
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
// bazel-out/
|
|
240
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/translation_utils.mjs
|
|
241
241
|
import { Element, ParseError, ParseErrorLevel as ParseErrorLevel2, XmlParser } from "@angular/compiler";
|
|
242
242
|
function getAttrOrThrow(element, attrName) {
|
|
243
243
|
const attrValue = getAttribute(element, attrName);
|
|
@@ -313,7 +313,7 @@ function addErrorsToBundle(bundle, errors) {
|
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
// bazel-out/
|
|
316
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/localize/tools/src/translate/translation_files/message_serialization/message_serializer.mjs
|
|
317
317
|
var MessageSerializer = class extends BaseVisitor {
|
|
318
318
|
constructor(renderer, config) {
|
|
319
319
|
super();
|
|
@@ -375,7 +375,7 @@ var MessageSerializer = class extends BaseVisitor {
|
|
|
375
375
|
}
|
|
376
376
|
};
|
|
377
377
|
|
|
378
|
-
// bazel-out/
|
|
378
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/localize/tools/src/translate/translation_files/message_serialization/target_message_renderer.mjs
|
|
379
379
|
import { \u0275makeParsedTranslation } from "@angular/localize";
|
|
380
380
|
var TargetMessageRenderer = class {
|
|
381
381
|
constructor() {
|
|
@@ -433,7 +433,7 @@ var TargetMessageRenderer = class {
|
|
|
433
433
|
}
|
|
434
434
|
};
|
|
435
435
|
|
|
436
|
-
// bazel-out/
|
|
436
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/serialize_translation_message.mjs
|
|
437
437
|
function serializeTranslationMessage(element, config) {
|
|
438
438
|
const { rootNodes, errors: parseErrors } = parseInnerRange(element);
|
|
439
439
|
try {
|
|
@@ -445,7 +445,7 @@ function serializeTranslationMessage(element, config) {
|
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
447
|
|
|
448
|
-
// bazel-out/
|
|
448
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/xliff1_translation_parser.mjs
|
|
449
449
|
var Xliff1TranslationParser = class {
|
|
450
450
|
analyze(filePath, contents) {
|
|
451
451
|
return canParseXml(filePath, contents, "xliff", { version: "1.2" });
|
|
@@ -522,7 +522,7 @@ var XliffTranslationVisitor = class extends BaseVisitor {
|
|
|
522
522
|
}
|
|
523
523
|
};
|
|
524
524
|
|
|
525
|
-
// bazel-out/
|
|
525
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/xliff2_translation_parser.mjs
|
|
526
526
|
import { Element as Element3, ParseErrorLevel as ParseErrorLevel4, visitAll as visitAll3 } from "@angular/compiler";
|
|
527
527
|
var Xliff2TranslationParser = class {
|
|
528
528
|
analyze(filePath, contents) {
|
|
@@ -601,7 +601,7 @@ function isFileElement(node) {
|
|
|
601
601
|
return node instanceof Element3 && node.name === "file";
|
|
602
602
|
}
|
|
603
603
|
|
|
604
|
-
// bazel-out/
|
|
604
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/xtb_translation_parser.mjs
|
|
605
605
|
import { ParseErrorLevel as ParseErrorLevel5, visitAll as visitAll4 } from "@angular/compiler";
|
|
606
606
|
import { extname as extname2 } from "path";
|
|
607
607
|
var XtbTranslationParser = class {
|
|
@@ -679,4 +679,4 @@ export {
|
|
|
679
679
|
* Use of this source code is governed by an MIT-style license that can be
|
|
680
680
|
* found in the LICENSE file at https://angular.io/license
|
|
681
681
|
*/
|
|
682
|
-
//# sourceMappingURL=chunk-
|
|
682
|
+
//# sourceMappingURL=chunk-HTD7ZW6Y.js.map
|
|
@@ -14,9 +14,9 @@ import {
|
|
|
14
14
|
unwrapMessagePartsFromLocalizeCall,
|
|
15
15
|
unwrapMessagePartsFromTemplateLiteral,
|
|
16
16
|
unwrapSubstitutionsFromLocalizeCall
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-AEXKEUHQ.js";
|
|
18
18
|
|
|
19
|
-
// bazel-out/
|
|
19
|
+
// bazel-out/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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 XmbTranslationSerializer = class {
|
|
812
812
|
constructor(basePath, useLegacyIds, fs = getFileSystem3()) {
|
|
@@ -899,4 +899,4 @@ export {
|
|
|
899
899
|
* Use of this source code is governed by an MIT-style license that can be
|
|
900
900
|
* found in the LICENSE file at https://angular.io/license
|
|
901
901
|
*/
|
|
902
|
-
//# sourceMappingURL=chunk-
|
|
902
|
+
//# sourceMappingURL=chunk-QB7OQXUU.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-QB7OQXUU.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-HTD7ZW6Y.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-AEXKEUHQ.js";
|
|
35
35
|
|
|
36
|
-
// bazel-out/
|
|
36
|
+
// bazel-out/darwin_arm64-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-QB7OQXUU.js";
|
|
17
|
+
import "../../chunk-AEXKEUHQ.js";
|
|
18
18
|
|
|
19
|
-
// bazel-out/
|
|
19
|
+
// bazel-out/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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-HTD7ZW6Y.js";
|
|
16
16
|
import {
|
|
17
17
|
Diagnostics
|
|
18
|
-
} from "../../chunk-
|
|
18
|
+
} from "../../chunk-AEXKEUHQ.js";
|
|
19
19
|
|
|
20
|
-
// bazel-out/
|
|
20
|
+
// bazel-out/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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/darwin_arm64-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 {
|
|
@@ -127,7 +127,7 @@ var SourceFileTranslationHandler = class {
|
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
129
|
|
|
130
|
-
// bazel-out/
|
|
130
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_loader.mjs
|
|
131
131
|
var TranslationLoader = class {
|
|
132
132
|
constructor(fs2, translationParsers, duplicateTranslation2, diagnostics2) {
|
|
133
133
|
this.fs = fs2;
|
|
@@ -197,7 +197,7 @@ ${parser.constructor.name} cannot parse translation file.`));
|
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
199
|
|
|
200
|
-
// bazel-out/
|
|
200
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/localize/tools/src/translate/translator.mjs
|
|
201
201
|
var Translator = class {
|
|
202
202
|
constructor(fs2, resourceHandlers, diagnostics2) {
|
|
203
203
|
this.fs = fs2;
|
|
@@ -219,7 +219,7 @@ var Translator = class {
|
|
|
219
219
|
}
|
|
220
220
|
};
|
|
221
221
|
|
|
222
|
-
// bazel-out/
|
|
222
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/localize/tools/src/translate/index.mjs
|
|
223
223
|
function translateFiles({ sourceRootPath: sourceRootPath2, sourceFilePaths: sourceFilePaths2, translationFilePaths: translationFilePaths2, translationFileLocales: translationFileLocales2, outputPathFn: outputPathFn2, diagnostics: diagnostics2, missingTranslation: missingTranslation2, duplicateTranslation: duplicateTranslation2, sourceLocale: sourceLocale2 }) {
|
|
224
224
|
const fs2 = getFileSystem();
|
|
225
225
|
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/darwin_arm64-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", {
|