diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-06 14:33:21 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-06 16:48:41 +0200 |
commit | f07d6385b4b46c3254898292a8a53ed415b8d49b (patch) | |
tree | dba932058694ede3166ba812d1cbea170344e330 /scripts/i18n/create-custom-files.ts | |
parent | e945b184a0f29b47c33bbd05578f3493ca9c8e6c (diff) | |
download | PeerTube-f07d6385b4b46c3254898292a8a53ed415b8d49b.tar.gz PeerTube-f07d6385b4b46c3254898292a8a53ed415b8d49b.tar.zst PeerTube-f07d6385b4b46c3254898292a8a53ed415b8d49b.zip |
Rename messages locale to angular
Diffstat (limited to 'scripts/i18n/create-custom-files.ts')
-rwxr-xr-x | scripts/i18n/create-custom-files.ts | 23 |
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 | ||
33 | jsToXliff12(obj, (err, res) => { | 33 | saveToXliffFile(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 | |||
44 | function 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 | } | ||