Skip to content

Commit 5cc9c77

Browse files
committed
Remove useless old function, result of bad merge earlier.
1 parent 98ff1eb commit 5cc9c77

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

src/formatters/xlb.ts

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -182,48 +182,3 @@ class XlbFormatter implements Formatter {
182182
);
183183
}
184184
}
185-
186-
/**
187-
* Generate an XLB XML file for the given messages. This file contains the
188-
* canonical set of messages that will be translatd.
189-
*/
190-
export function generateXlb(
191-
messages: ProgramMessage[],
192-
locale: Locale
193-
): string {
194-
const doc = new xmldom.DOMImplementation().createDocument('', '', null);
195-
doc.appendChild(
196-
doc.createProcessingInstruction('xml', 'version="1.0" encoding="UTF-8"')
197-
);
198-
doc.appendChild(doc.createTextNode('\n'));
199-
const bundle = doc.createElement('localizationbundle');
200-
bundle.setAttribute('locale', locale);
201-
doc.appendChild(bundle);
202-
bundle.appendChild(doc.createTextNode('\n '));
203-
const messagesNode = doc.createElement('messages');
204-
bundle.appendChild(messagesNode);
205-
for (const {name, contents, descStack} of messages) {
206-
messagesNode.appendChild(doc.createTextNode('\n '));
207-
const messageNode = doc.createElement('msg');
208-
messageNode.setAttribute('name', name);
209-
if (descStack.length > 0) {
210-
messageNode.setAttribute('desc', descStack.join(' / '));
211-
}
212-
messagesNode.appendChild(messageNode);
213-
for (const content of contents) {
214-
if (typeof content === 'string') {
215-
messageNode.appendChild(doc.createTextNode(content));
216-
} else {
217-
const {untranslatable} = content;
218-
const ph = doc.createElement('ph');
219-
ph.appendChild(doc.createTextNode(untranslatable));
220-
messageNode.appendChild(ph);
221-
}
222-
}
223-
}
224-
messagesNode.appendChild(doc.createTextNode('\n '));
225-
bundle.appendChild(doc.createTextNode('\n'));
226-
doc.appendChild(doc.createTextNode('\n'));
227-
const serialized = new xmldom.XMLSerializer().serializeToString(doc);
228-
return serialized;
229-
}

0 commit comments

Comments
 (0)