source: trip-planner-front/node_modules/@angular/compiler/src/i18n/serializers/xliff2.js@ 59329aa

Last change on this file since 59329aa was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 50.9 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8(function (factory) {
9 if (typeof module === "object" && typeof module.exports === "object") {
10 var v = factory(require, exports);
11 if (v !== undefined) module.exports = v;
12 }
13 else if (typeof define === "function" && define.amd) {
14 define("@angular/compiler/src/i18n/serializers/xliff2", ["require", "exports", "tslib", "@angular/compiler/src/ml_parser/ast", "@angular/compiler/src/ml_parser/xml_parser", "@angular/compiler/src/i18n/digest", "@angular/compiler/src/i18n/i18n_ast", "@angular/compiler/src/i18n/parse_util", "@angular/compiler/src/i18n/serializers/serializer", "@angular/compiler/src/i18n/serializers/xml_helper"], factory);
15 }
16})(function (require, exports) {
17 "use strict";
18 Object.defineProperty(exports, "__esModule", { value: true });
19 exports.Xliff2 = void 0;
20 var tslib_1 = require("tslib");
21 var ml = require("@angular/compiler/src/ml_parser/ast");
22 var xml_parser_1 = require("@angular/compiler/src/ml_parser/xml_parser");
23 var digest_1 = require("@angular/compiler/src/i18n/digest");
24 var i18n = require("@angular/compiler/src/i18n/i18n_ast");
25 var parse_util_1 = require("@angular/compiler/src/i18n/parse_util");
26 var serializer_1 = require("@angular/compiler/src/i18n/serializers/serializer");
27 var xml = require("@angular/compiler/src/i18n/serializers/xml_helper");
28 var _VERSION = '2.0';
29 var _XMLNS = 'urn:oasis:names:tc:xliff:document:2.0';
30 // TODO(vicb): make this a param (s/_/-/)
31 var _DEFAULT_SOURCE_LANG = 'en';
32 var _PLACEHOLDER_TAG = 'ph';
33 var _PLACEHOLDER_SPANNING_TAG = 'pc';
34 var _MARKER_TAG = 'mrk';
35 var _XLIFF_TAG = 'xliff';
36 var _SOURCE_TAG = 'source';
37 var _TARGET_TAG = 'target';
38 var _UNIT_TAG = 'unit';
39 // https://docs.oasis-open.org/xliff/xliff-core/v2.0/os/xliff-core-v2.0-os.html
40 var Xliff2 = /** @class */ (function (_super) {
41 tslib_1.__extends(Xliff2, _super);
42 function Xliff2() {
43 return _super !== null && _super.apply(this, arguments) || this;
44 }
45 Xliff2.prototype.write = function (messages, locale) {
46 var visitor = new _WriteVisitor();
47 var units = [];
48 messages.forEach(function (message) {
49 var unit = new xml.Tag(_UNIT_TAG, { id: message.id });
50 var notes = new xml.Tag('notes');
51 if (message.description || message.meaning) {
52 if (message.description) {
53 notes.children.push(new xml.CR(8), new xml.Tag('note', { category: 'description' }, [new xml.Text(message.description)]));
54 }
55 if (message.meaning) {
56 notes.children.push(new xml.CR(8), new xml.Tag('note', { category: 'meaning' }, [new xml.Text(message.meaning)]));
57 }
58 }
59 message.sources.forEach(function (source) {
60 notes.children.push(new xml.CR(8), new xml.Tag('note', { category: 'location' }, [
61 new xml.Text(source.filePath + ":" + source.startLine + (source.endLine !== source.startLine ? ',' + source.endLine : ''))
62 ]));
63 });
64 notes.children.push(new xml.CR(6));
65 unit.children.push(new xml.CR(6), notes);
66 var segment = new xml.Tag('segment');
67 segment.children.push(new xml.CR(8), new xml.Tag(_SOURCE_TAG, {}, visitor.serialize(message.nodes)), new xml.CR(6));
68 unit.children.push(new xml.CR(6), segment, new xml.CR(4));
69 units.push(new xml.CR(4), unit);
70 });
71 var file = new xml.Tag('file', { 'original': 'ng.template', id: 'ngi18n' }, tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(units)), [new xml.CR(2)]));
72 var xliff = new xml.Tag(_XLIFF_TAG, { version: _VERSION, xmlns: _XMLNS, srcLang: locale || _DEFAULT_SOURCE_LANG }, [new xml.CR(2), file, new xml.CR()]);
73 return xml.serialize([
74 new xml.Declaration({ version: '1.0', encoding: 'UTF-8' }), new xml.CR(), xliff, new xml.CR()
75 ]);
76 };
77 Xliff2.prototype.load = function (content, url) {
78 // xliff to xml nodes
79 var xliff2Parser = new Xliff2Parser();
80 var _a = xliff2Parser.parse(content, url), locale = _a.locale, msgIdToHtml = _a.msgIdToHtml, errors = _a.errors;
81 // xml nodes to i18n nodes
82 var i18nNodesByMsgId = {};
83 var converter = new XmlToI18n();
84 Object.keys(msgIdToHtml).forEach(function (msgId) {
85 var _a = converter.convert(msgIdToHtml[msgId], url), i18nNodes = _a.i18nNodes, e = _a.errors;
86 errors.push.apply(errors, tslib_1.__spreadArray([], tslib_1.__read(e)));
87 i18nNodesByMsgId[msgId] = i18nNodes;
88 });
89 if (errors.length) {
90 throw new Error("xliff2 parse errors:\n" + errors.join('\n'));
91 }
92 return { locale: locale, i18nNodesByMsgId: i18nNodesByMsgId };
93 };
94 Xliff2.prototype.digest = function (message) {
95 return digest_1.decimalDigest(message);
96 };
97 return Xliff2;
98 }(serializer_1.Serializer));
99 exports.Xliff2 = Xliff2;
100 var _WriteVisitor = /** @class */ (function () {
101 function _WriteVisitor() {
102 }
103 _WriteVisitor.prototype.visitText = function (text, context) {
104 return [new xml.Text(text.value)];
105 };
106 _WriteVisitor.prototype.visitContainer = function (container, context) {
107 var _this = this;
108 var nodes = [];
109 container.children.forEach(function (node) { return nodes.push.apply(nodes, tslib_1.__spreadArray([], tslib_1.__read(node.visit(_this)))); });
110 return nodes;
111 };
112 _WriteVisitor.prototype.visitIcu = function (icu, context) {
113 var _this = this;
114 var nodes = [new xml.Text("{" + icu.expressionPlaceholder + ", " + icu.type + ", ")];
115 Object.keys(icu.cases).forEach(function (c) {
116 nodes.push.apply(nodes, tslib_1.__spreadArray(tslib_1.__spreadArray([new xml.Text(c + " {")], tslib_1.__read(icu.cases[c].visit(_this))), [new xml.Text("} ")]));
117 });
118 nodes.push(new xml.Text("}"));
119 return nodes;
120 };
121 _WriteVisitor.prototype.visitTagPlaceholder = function (ph, context) {
122 var _this = this;
123 var type = getTypeForTag(ph.tag);
124 if (ph.isVoid) {
125 var tagPh = new xml.Tag(_PLACEHOLDER_TAG, {
126 id: (this._nextPlaceholderId++).toString(),
127 equiv: ph.startName,
128 type: type,
129 disp: "<" + ph.tag + "/>",
130 });
131 return [tagPh];
132 }
133 var tagPc = new xml.Tag(_PLACEHOLDER_SPANNING_TAG, {
134 id: (this._nextPlaceholderId++).toString(),
135 equivStart: ph.startName,
136 equivEnd: ph.closeName,
137 type: type,
138 dispStart: "<" + ph.tag + ">",
139 dispEnd: "</" + ph.tag + ">",
140 });
141 var nodes = [].concat.apply([], tslib_1.__spreadArray([], tslib_1.__read(ph.children.map(function (node) { return node.visit(_this); }))));
142 if (nodes.length) {
143 nodes.forEach(function (node) { return tagPc.children.push(node); });
144 }
145 else {
146 tagPc.children.push(new xml.Text(''));
147 }
148 return [tagPc];
149 };
150 _WriteVisitor.prototype.visitPlaceholder = function (ph, context) {
151 var idStr = (this._nextPlaceholderId++).toString();
152 return [new xml.Tag(_PLACEHOLDER_TAG, {
153 id: idStr,
154 equiv: ph.name,
155 disp: "{{" + ph.value + "}}",
156 })];
157 };
158 _WriteVisitor.prototype.visitIcuPlaceholder = function (ph, context) {
159 var cases = Object.keys(ph.value.cases).map(function (value) { return value + ' {...}'; }).join(' ');
160 var idStr = (this._nextPlaceholderId++).toString();
161 return [new xml.Tag(_PLACEHOLDER_TAG, { id: idStr, equiv: ph.name, disp: "{" + ph.value.expression + ", " + ph.value.type + ", " + cases + "}" })];
162 };
163 _WriteVisitor.prototype.serialize = function (nodes) {
164 var _this = this;
165 this._nextPlaceholderId = 0;
166 return [].concat.apply([], tslib_1.__spreadArray([], tslib_1.__read(nodes.map(function (node) { return node.visit(_this); }))));
167 };
168 return _WriteVisitor;
169 }());
170 // Extract messages as xml nodes from the xliff file
171 var Xliff2Parser = /** @class */ (function () {
172 function Xliff2Parser() {
173 this._locale = null;
174 }
175 Xliff2Parser.prototype.parse = function (xliff, url) {
176 this._unitMlString = null;
177 this._msgIdToHtml = {};
178 var xml = new xml_parser_1.XmlParser().parse(xliff, url);
179 this._errors = xml.errors;
180 ml.visitAll(this, xml.rootNodes, null);
181 return {
182 msgIdToHtml: this._msgIdToHtml,
183 errors: this._errors,
184 locale: this._locale,
185 };
186 };
187 Xliff2Parser.prototype.visitElement = function (element, context) {
188 switch (element.name) {
189 case _UNIT_TAG:
190 this._unitMlString = null;
191 var idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });
192 if (!idAttr) {
193 this._addError(element, "<" + _UNIT_TAG + "> misses the \"id\" attribute");
194 }
195 else {
196 var id = idAttr.value;
197 if (this._msgIdToHtml.hasOwnProperty(id)) {
198 this._addError(element, "Duplicated translations for msg " + id);
199 }
200 else {
201 ml.visitAll(this, element.children, null);
202 if (typeof this._unitMlString === 'string') {
203 this._msgIdToHtml[id] = this._unitMlString;
204 }
205 else {
206 this._addError(element, "Message " + id + " misses a translation");
207 }
208 }
209 }
210 break;
211 case _SOURCE_TAG:
212 // ignore source message
213 break;
214 case _TARGET_TAG:
215 var innerTextStart = element.startSourceSpan.end.offset;
216 var innerTextEnd = element.endSourceSpan.start.offset;
217 var content = element.startSourceSpan.start.file.content;
218 var innerText = content.slice(innerTextStart, innerTextEnd);
219 this._unitMlString = innerText;
220 break;
221 case _XLIFF_TAG:
222 var localeAttr = element.attrs.find(function (attr) { return attr.name === 'trgLang'; });
223 if (localeAttr) {
224 this._locale = localeAttr.value;
225 }
226 var versionAttr = element.attrs.find(function (attr) { return attr.name === 'version'; });
227 if (versionAttr) {
228 var version = versionAttr.value;
229 if (version !== '2.0') {
230 this._addError(element, "The XLIFF file version " + version + " is not compatible with XLIFF 2.0 serializer");
231 }
232 else {
233 ml.visitAll(this, element.children, null);
234 }
235 }
236 break;
237 default:
238 ml.visitAll(this, element.children, null);
239 }
240 };
241 Xliff2Parser.prototype.visitAttribute = function (attribute, context) { };
242 Xliff2Parser.prototype.visitText = function (text, context) { };
243 Xliff2Parser.prototype.visitComment = function (comment, context) { };
244 Xliff2Parser.prototype.visitExpansion = function (expansion, context) { };
245 Xliff2Parser.prototype.visitExpansionCase = function (expansionCase, context) { };
246 Xliff2Parser.prototype._addError = function (node, message) {
247 this._errors.push(new parse_util_1.I18nError(node.sourceSpan, message));
248 };
249 return Xliff2Parser;
250 }());
251 // Convert ml nodes (xliff syntax) to i18n nodes
252 var XmlToI18n = /** @class */ (function () {
253 function XmlToI18n() {
254 }
255 XmlToI18n.prototype.convert = function (message, url) {
256 var xmlIcu = new xml_parser_1.XmlParser().parse(message, url, { tokenizeExpansionForms: true });
257 this._errors = xmlIcu.errors;
258 var i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?
259 [] : [].concat.apply([], tslib_1.__spreadArray([], tslib_1.__read(ml.visitAll(this, xmlIcu.rootNodes))));
260 return {
261 i18nNodes: i18nNodes,
262 errors: this._errors,
263 };
264 };
265 XmlToI18n.prototype.visitText = function (text, context) {
266 return new i18n.Text(text.value, text.sourceSpan);
267 };
268 XmlToI18n.prototype.visitElement = function (el, context) {
269 var _this = this;
270 switch (el.name) {
271 case _PLACEHOLDER_TAG:
272 var nameAttr = el.attrs.find(function (attr) { return attr.name === 'equiv'; });
273 if (nameAttr) {
274 return [new i18n.Placeholder('', nameAttr.value, el.sourceSpan)];
275 }
276 this._addError(el, "<" + _PLACEHOLDER_TAG + "> misses the \"equiv\" attribute");
277 break;
278 case _PLACEHOLDER_SPANNING_TAG:
279 var startAttr = el.attrs.find(function (attr) { return attr.name === 'equivStart'; });
280 var endAttr = el.attrs.find(function (attr) { return attr.name === 'equivEnd'; });
281 if (!startAttr) {
282 this._addError(el, "<" + _PLACEHOLDER_TAG + "> misses the \"equivStart\" attribute");
283 }
284 else if (!endAttr) {
285 this._addError(el, "<" + _PLACEHOLDER_TAG + "> misses the \"equivEnd\" attribute");
286 }
287 else {
288 var startId = startAttr.value;
289 var endId = endAttr.value;
290 var nodes = [];
291 return nodes.concat.apply(nodes, tslib_1.__spreadArray(tslib_1.__spreadArray([new i18n.Placeholder('', startId, el.sourceSpan)], tslib_1.__read(el.children.map(function (node) { return node.visit(_this, null); }))), [new i18n.Placeholder('', endId, el.sourceSpan)]));
292 }
293 break;
294 case _MARKER_TAG:
295 return [].concat.apply([], tslib_1.__spreadArray([], tslib_1.__read(ml.visitAll(this, el.children))));
296 default:
297 this._addError(el, "Unexpected tag");
298 }
299 return null;
300 };
301 XmlToI18n.prototype.visitExpansion = function (icu, context) {
302 var caseMap = {};
303 ml.visitAll(this, icu.cases).forEach(function (c) {
304 caseMap[c.value] = new i18n.Container(c.nodes, icu.sourceSpan);
305 });
306 return new i18n.Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan);
307 };
308 XmlToI18n.prototype.visitExpansionCase = function (icuCase, context) {
309 return {
310 value: icuCase.value,
311 nodes: [].concat.apply([], tslib_1.__spreadArray([], tslib_1.__read(ml.visitAll(this, icuCase.expression)))),
312 };
313 };
314 XmlToI18n.prototype.visitComment = function (comment, context) { };
315 XmlToI18n.prototype.visitAttribute = function (attribute, context) { };
316 XmlToI18n.prototype._addError = function (node, message) {
317 this._errors.push(new parse_util_1.I18nError(node.sourceSpan, message));
318 };
319 return XmlToI18n;
320 }());
321 function getTypeForTag(tag) {
322 switch (tag.toLowerCase()) {
323 case 'br':
324 case 'b':
325 case 'i':
326 case 'u':
327 return 'fmt';
328 case 'img':
329 return 'image';
330 case 'a':
331 return 'link';
332 default:
333 return 'other';
334 }
335 }
336});
337//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoieGxpZmYyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29tcGlsZXIvc3JjL2kxOG4vc2VyaWFsaXplcnMveGxpZmYyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRzs7Ozs7Ozs7Ozs7Ozs7SUFFSCx3REFBMEM7SUFDMUMseUVBQXFEO0lBQ3JELDREQUF3QztJQUN4QywwREFBb0M7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2UoaW5uZXJUZXh0U3RhcnQsIGlubmVyVGV4dEVuZCk7XG4gICAgICAgIHRoaXMuX3VuaXRNbFN0cmluZyA9IGlubmVyVGV4dDtcbiAgICAgICAgYnJlYWs7XG5cbiAgICAgIGNhc2UgX1hMSUZGX1RBRzpcbiAgICAgICAgY29uc3QgbG9jYWxlQXR0ciA9IGVsZW1lbnQuYXR0cnMuZmluZCgoYXR0cikgPT4gYXR0ci5uYW1lID09PSAndHJnTGFuZycpO1xuICAgICAgICBpZiAobG9jYWxlQXR0cikge1xuICAgICAgICAgIHRoaXMuX2xvY2FsZSA9IGxvY2FsZUF0dHIudmFsdWU7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCB2ZXJzaW9uQXR0ciA9IGVsZW1lbnQuYXR0cnMuZmluZCgoYXR0cikgPT4gYXR0ci5uYW1lID09PSAndmVyc2lvbicpO1xuICAgICAgICBpZiAodmVyc2lvbkF0dHIpIHtcbiAgICAgICAgICBjb25zdCB2ZXJzaW9uID0gdmVyc2lvbkF0dHIudmFsdWU7XG4gICAgICAgICAgaWYgKHZlcnNpb24gIT09ICcyLjAnKSB7XG4gICAgICAgICAgICB0aGlzLl9hZGRFcnJvcihcbiAgICAgICAgICAgICAgICBlbGVtZW50LFxuICAgICAgICAgICAgICAgIGBUaGUgWExJRkYgZmlsZSB2ZXJzaW9uICR7dmVyc2lvbn0gaXMgbm90IGNvbXBhdGlibGUgd2l0aCBYTElGRiAyLjAgc2VyaWFsaXplcmApO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBtbC52aXNpdEFsbCh0aGlzLCBlbGVtZW50LmNoaWxkcmVuLCBudWxsKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgYnJlYWs7XG4gICAgICBkZWZhdWx0OlxuICAgICAgICBtbC52aXNpdEFsbCh0aGlzLCBlbGVtZW50LmNoaWxkcmVuLCBudWxsKTtcbiAgICB9XG4gIH1cblxuICB2aXNpdEF0dHJpYnV0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uZXcgSTE4bkVycm9yKG5vZGUuc291cmNlU3BhbiwgbWVzc2FnZSkpO1xuICB9XG59XG5cbmZ1bmN0aW9uIGdldFR5cGVGb3JUYWcodGFnOiBzdHJpbmcpOiBzdHJpbmcge1xuICBzd2l0Y2ggKHRhZy50b0xvd2VyQ2FzZSgpKSB7XG4gICAgY2FzZSAnYnInOlxuICAgIGNhc2UgJ2InOlxuICAgIGNhc2UgJ2knOlxuICAgIGNhc2UgJ3UnOlxuICAgICAgcmV0dXJuICdmbXQnO1xuICAgIGNhc2UgJ2ltZyc6XG4gICAgICByZXR1cm4gJ2ltYWdlJztcbiAgICBjYXNlICdhJzpcbiAgICAgIHJldHVybiAnbGluayc7XG4gICAgZGVmYXVsdDpcbiAgICAgIHJldHVybiAnb3RoZXInO1xuICB9XG59XG4iXX0=
Note: See TracBrowser for help on using the repository browser.