aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/i18n/create-custom-files.ts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/i18n/create-custom-files.ts')
-rwxr-xr-xscripts/i18n/create-custom-files.ts23
1 files changed, 14 insertions, 9 deletions
diff --git a/scripts/i18n/create-custom-files.ts b/scripts/i18n/create-custom-files.ts
index 3895b3b9d..d8a87f291 100755
--- a/scripts/i18n/create-custom-files.ts
+++ b/scripts/i18n/create-custom-files.ts
@@ -30,20 +30,25 @@ for (const sourceObject of [ videojs, playerKeys ]) {
30 Object.keys(sourceObject).forEach(k => obj.resources.namespace1[ k ] = { source: sourceObject[ k ] }) 30 Object.keys(sourceObject).forEach(k => obj.resources.namespace1[ k ] = { source: sourceObject[ k ] })
31} 31}
32 32
33jsToXliff12(obj, (err, res) => { 33saveToXliffFile(playerTarget, obj, err => {
34 if (err) { 34 if (err) {
35 console.error(err) 35 console.error(err)
36 process.exit(-1) 36 process.exit(-1)
37 } 37 }
38 38
39 writeFile(playerTarget, res, err => { 39 process.exit(0)
40 if (err) {
41 console.error(err)
42 process.exit(-1)
43 }
44
45 process.exit(0)
46 })
47}) 40})
48 41
49// Then, the server strings 42// Then, the server strings
43
44function saveToXliffFile (targetPath: string, obj: any, cb: Function) {
45 jsToXliff12(obj, (err, res) => {
46 if (err) return cb(err)
47
48 writeFile(playerTarget, res, err => {
49 if (err) return cb(err)
50
51 return cb(null)
52 })
53 })
54}