source: trip-planner-front/node_modules/@angular/compiler/esm2015/src/i18n/serializers/xliff.js

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

initial commit

  • Property mode set to 100644
File size: 40.7 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 */
8import * as ml from '../../ml_parser/ast';
9import { XmlParser } from '../../ml_parser/xml_parser';
10import { digest } from '../digest';
11import * as i18n from '../i18n_ast';
12import { I18nError } from '../parse_util';
13import { Serializer } from './serializer';
14import * as xml from './xml_helper';
15const _VERSION = '1.2';
16const _XMLNS = 'urn:oasis:names:tc:xliff:document:1.2';
17// TODO(vicb): make this a param (s/_/-/)
18const _DEFAULT_SOURCE_LANG = 'en';
19const _PLACEHOLDER_TAG = 'x';
20const _MARKER_TAG = 'mrk';
21const _FILE_TAG = 'file';
22const _SOURCE_TAG = 'source';
23const _SEGMENT_SOURCE_TAG = 'seg-source';
24const _ALT_TRANS_TAG = 'alt-trans';
25const _TARGET_TAG = 'target';
26const _UNIT_TAG = 'trans-unit';
27const _CONTEXT_GROUP_TAG = 'context-group';
28const _CONTEXT_TAG = 'context';
29// https://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html
30// https://docs.oasis-open.org/xliff/v1.2/xliff-profile-html/xliff-profile-html-1.2.html
31export class Xliff extends Serializer {
32 write(messages, locale) {
33 const visitor = new _WriteVisitor();
34 const transUnits = [];
35 messages.forEach(message => {
36 let contextTags = [];
37 message.sources.forEach((source) => {
38 let contextGroupTag = new xml.Tag(_CONTEXT_GROUP_TAG, { purpose: 'location' });
39 contextGroupTag.children.push(new xml.CR(10), new xml.Tag(_CONTEXT_TAG, { 'context-type': 'sourcefile' }, [new xml.Text(source.filePath)]), new xml.CR(10), new xml.Tag(_CONTEXT_TAG, { 'context-type': 'linenumber' }, [new xml.Text(`${source.startLine}`)]), new xml.CR(8));
40 contextTags.push(new xml.CR(8), contextGroupTag);
41 });
42 const transUnit = new xml.Tag(_UNIT_TAG, { id: message.id, datatype: 'html' });
43 transUnit.children.push(new xml.CR(8), new xml.Tag(_SOURCE_TAG, {}, visitor.serialize(message.nodes)), ...contextTags);
44 if (message.description) {
45 transUnit.children.push(new xml.CR(8), new xml.Tag('note', { priority: '1', from: 'description' }, [new xml.Text(message.description)]));
46 }
47 if (message.meaning) {
48 transUnit.children.push(new xml.CR(8), new xml.Tag('note', { priority: '1', from: 'meaning' }, [new xml.Text(message.meaning)]));
49 }
50 transUnit.children.push(new xml.CR(6));
51 transUnits.push(new xml.CR(6), transUnit);
52 });
53 const body = new xml.Tag('body', {}, [...transUnits, new xml.CR(4)]);
54 const file = new xml.Tag('file', {
55 'source-language': locale || _DEFAULT_SOURCE_LANG,
56 datatype: 'plaintext',
57 original: 'ng2.template',
58 }, [new xml.CR(4), body, new xml.CR(2)]);
59 const xliff = new xml.Tag('xliff', { version: _VERSION, xmlns: _XMLNS }, [new xml.CR(2), file, new xml.CR()]);
60 return xml.serialize([
61 new xml.Declaration({ version: '1.0', encoding: 'UTF-8' }), new xml.CR(), xliff, new xml.CR()
62 ]);
63 }
64 load(content, url) {
65 // xliff to xml nodes
66 const xliffParser = new XliffParser();
67 const { locale, msgIdToHtml, errors } = xliffParser.parse(content, url);
68 // xml nodes to i18n nodes
69 const i18nNodesByMsgId = {};
70 const converter = new XmlToI18n();
71 Object.keys(msgIdToHtml).forEach(msgId => {
72 const { i18nNodes, errors: e } = converter.convert(msgIdToHtml[msgId], url);
73 errors.push(...e);
74 i18nNodesByMsgId[msgId] = i18nNodes;
75 });
76 if (errors.length) {
77 throw new Error(`xliff parse errors:\n${errors.join('\n')}`);
78 }
79 return { locale: locale, i18nNodesByMsgId };
80 }
81 digest(message) {
82 return digest(message);
83 }
84}
85class _WriteVisitor {
86 visitText(text, context) {
87 return [new xml.Text(text.value)];
88 }
89 visitContainer(container, context) {
90 const nodes = [];
91 container.children.forEach((node) => nodes.push(...node.visit(this)));
92 return nodes;
93 }
94 visitIcu(icu, context) {
95 const nodes = [new xml.Text(`{${icu.expressionPlaceholder}, ${icu.type}, `)];
96 Object.keys(icu.cases).forEach((c) => {
97 nodes.push(new xml.Text(`${c} {`), ...icu.cases[c].visit(this), new xml.Text(`} `));
98 });
99 nodes.push(new xml.Text(`}`));
100 return nodes;
101 }
102 visitTagPlaceholder(ph, context) {
103 const ctype = getCtypeForTag(ph.tag);
104 if (ph.isVoid) {
105 // void tags have no children nor closing tags
106 return [new xml.Tag(_PLACEHOLDER_TAG, { id: ph.startName, ctype, 'equiv-text': `<${ph.tag}/>` })];
107 }
108 const startTagPh = new xml.Tag(_PLACEHOLDER_TAG, { id: ph.startName, ctype, 'equiv-text': `<${ph.tag}>` });
109 const closeTagPh = new xml.Tag(_PLACEHOLDER_TAG, { id: ph.closeName, ctype, 'equiv-text': `</${ph.tag}>` });
110 return [startTagPh, ...this.serialize(ph.children), closeTagPh];
111 }
112 visitPlaceholder(ph, context) {
113 return [new xml.Tag(_PLACEHOLDER_TAG, { id: ph.name, 'equiv-text': `{{${ph.value}}}` })];
114 }
115 visitIcuPlaceholder(ph, context) {
116 const equivText = `{${ph.value.expression}, ${ph.value.type}, ${Object.keys(ph.value.cases).map((value) => value + ' {...}').join(' ')}}`;
117 return [new xml.Tag(_PLACEHOLDER_TAG, { id: ph.name, 'equiv-text': equivText })];
118 }
119 serialize(nodes) {
120 return [].concat(...nodes.map(node => node.visit(this)));
121 }
122}
123// TODO(vicb): add error management (structure)
124// Extract messages as xml nodes from the xliff file
125class XliffParser {
126 constructor() {
127 this._locale = null;
128 }
129 parse(xliff, url) {
130 this._unitMlString = null;
131 this._msgIdToHtml = {};
132 const xml = new XmlParser().parse(xliff, url);
133 this._errors = xml.errors;
134 ml.visitAll(this, xml.rootNodes, null);
135 return {
136 msgIdToHtml: this._msgIdToHtml,
137 errors: this._errors,
138 locale: this._locale,
139 };
140 }
141 visitElement(element, context) {
142 switch (element.name) {
143 case _UNIT_TAG:
144 this._unitMlString = null;
145 const idAttr = element.attrs.find((attr) => attr.name === 'id');
146 if (!idAttr) {
147 this._addError(element, `<${_UNIT_TAG}> misses the "id" attribute`);
148 }
149 else {
150 const id = idAttr.value;
151 if (this._msgIdToHtml.hasOwnProperty(id)) {
152 this._addError(element, `Duplicated translations for msg ${id}`);
153 }
154 else {
155 ml.visitAll(this, element.children, null);
156 if (typeof this._unitMlString === 'string') {
157 this._msgIdToHtml[id] = this._unitMlString;
158 }
159 else {
160 this._addError(element, `Message ${id} misses a translation`);
161 }
162 }
163 }
164 break;
165 // ignore those tags
166 case _SOURCE_TAG:
167 case _SEGMENT_SOURCE_TAG:
168 case _ALT_TRANS_TAG:
169 break;
170 case _TARGET_TAG:
171 const innerTextStart = element.startSourceSpan.end.offset;
172 const innerTextEnd = element.endSourceSpan.start.offset;
173 const content = element.startSourceSpan.start.file.content;
174 const innerText = content.slice(innerTextStart, innerTextEnd);
175 this._unitMlString = innerText;
176 break;
177 case _FILE_TAG:
178 const localeAttr = element.attrs.find((attr) => attr.name === 'target-language');
179 if (localeAttr) {
180 this._locale = localeAttr.value;
181 }
182 ml.visitAll(this, element.children, null);
183 break;
184 default:
185 // TODO(vicb): assert file structure, xliff version
186 // For now only recurse on unhandled nodes
187 ml.visitAll(this, element.children, null);
188 }
189 }
190 visitAttribute(attribute, context) { }
191 visitText(text, context) { }
192 visitComment(comment, context) { }
193 visitExpansion(expansion, context) { }
194 visitExpansionCase(expansionCase, context) { }
195 _addError(node, message) {
196 this._errors.push(new I18nError(node.sourceSpan, message));
197 }
198}
199// Convert ml nodes (xliff syntax) to i18n nodes
200class XmlToI18n {
201 convert(message, url) {
202 const xmlIcu = new XmlParser().parse(message, url, { tokenizeExpansionForms: true });
203 this._errors = xmlIcu.errors;
204 const i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?
205 [] :
206 [].concat(...ml.visitAll(this, xmlIcu.rootNodes));
207 return {
208 i18nNodes: i18nNodes,
209 errors: this._errors,
210 };
211 }
212 visitText(text, context) {
213 return new i18n.Text(text.value, text.sourceSpan);
214 }
215 visitElement(el, context) {
216 if (el.name === _PLACEHOLDER_TAG) {
217 const nameAttr = el.attrs.find((attr) => attr.name === 'id');
218 if (nameAttr) {
219 return new i18n.Placeholder('', nameAttr.value, el.sourceSpan);
220 }
221 this._addError(el, `<${_PLACEHOLDER_TAG}> misses the "id" attribute`);
222 return null;
223 }
224 if (el.name === _MARKER_TAG) {
225 return [].concat(...ml.visitAll(this, el.children));
226 }
227 this._addError(el, `Unexpected tag`);
228 return null;
229 }
230 visitExpansion(icu, context) {
231 const caseMap = {};
232 ml.visitAll(this, icu.cases).forEach((c) => {
233 caseMap[c.value] = new i18n.Container(c.nodes, icu.sourceSpan);
234 });
235 return new i18n.Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan);
236 }
237 visitExpansionCase(icuCase, context) {
238 return {
239 value: icuCase.value,
240 nodes: ml.visitAll(this, icuCase.expression),
241 };
242 }
243 visitComment(comment, context) { }
244 visitAttribute(attribute, context) { }
245 _addError(node, message) {
246 this._errors.push(new I18nError(node.sourceSpan, message));
247 }
248}
249function getCtypeForTag(tag) {
250 switch (tag.toLowerCase()) {
251 case 'br':
252 return 'lb';
253 case 'img':
254 return 'image';
255 default:
256 return `x-${tag}`;
257 }
258}
259//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoieGxpZmYuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb21waWxlci9zcmMvaTE4bi9zZXJpYWxpemVycy94bGlmZi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFFSCxPQUFPLEtBQUssRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQzFDLE9BQU8sRUFBQyxTQUFTLEVBQUMsTUFBTSw0QkFBNEIsQ0FBQztBQ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XG4gIH1cblxuICB2aXNpdENvbW1lbnQoY29tbWVudDogbWwuQ29tbWVudCwgY29udGV4dDogYW55KSB7fVxuXG4gIHZpc2l0QXR0cmlidXRlKGF0dHJpYnV0ZTogbWwuQXR0cmlidXRlLCBjb250ZXh0OiBhbnkpIHt9XG5cbiAgcHJpdmF0ZSBfYWRkRXJyb3Iobm9kZTogbWwuTm9kZSwgbWVzc2FnZTogc3RyaW5nKTogdm9pZCB7XG4gICAgdGhpcy5fZXJyb3JzLnB1c2gobmV3IEkxOG5FcnJvcihub2RlLnNvdXJjZVNwYW4sIG1lc3NhZ2UpKTtcbiAgfVxufVxuXG5mdW5jdGlvbiBnZXRDdHlwZUZvclRhZyh0YWc6IHN0cmluZyk6IHN0cmluZyB7XG4gIHN3aXRjaCAodGFnLnRvTG93ZXJDYXNlKCkpIHtcbiAgICBjYXNlICdicic6XG4gICAgICByZXR1cm4gJ2xiJztcbiAgICBjYXNlICdpbWcnOlxuICAgICAgcmV0dXJuICdpbWFnZSc7XG4gICAgZGVmYXVsdDpcbiAgICAgIHJldHVybiBgeC0ke3RhZ31gO1xuICB9XG59XG4iXX0=
Note: See TracBrowser for help on using the repository browser.