UNPKG

1.32 kBMarkdownView Raw
1# XLF Package
2
3Loads an XLF package for manipulation.
4
5## Methods
6
7### getPackage
8
9Returns the entire package. Format is:
10
11 [
12 {
13 langLoc: 'de/common',
14 path: 'de/common/blahblah.xlf'
15 strings: [
16 {
17 id: '',
18 source: '',
19 target: '',
20 state: '',
21 note: ''
22 }
23 ]
24 },
25 {
26 langLoc: 'pt/br',
27 path: 'pt/br/blahblah.xlf'
28 strings: [
29 {
30 id: '',
31 source: '',
32 target: '',
33 state: '',
34 note: ''
35 }
36 ]
37 }
38 ]
39
40### getStrings [onlyTranslated]
41
42Returns all the strings in the following format:
43
44 [
45 {
46 id: '55555555555',
47 source: 'blah',
48 allTranslated: false,
49 langs: {
50 'es/common': '',
51 'de/common': ''
52 }
53 }
54 ]
55
56### updateString <id> <langsObject>
57
58Updates the string with the given ID with an object matching the format of langs from a getString() object.
59
60### write [path]
61
62Writes the xlf. Defaults to writing to the original package location.