diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-13 15:55:13 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-13 15:55:13 +0200 |
commit | 850c1bf7cc438b935f6e283c801b34b91bf629c6 (patch) | |
tree | 0789b822fb01ebf061d957cbbeaf9e7ae5cd76ba /scripts/i18n/create-custom-files.ts | |
parent | 749c7247ae9042a74d132afda0c7eefab66a0428 (diff) | |
download | PeerTube-850c1bf7cc438b935f6e283c801b34b91bf629c6.tar.gz PeerTube-850c1bf7cc438b935f6e283c801b34b91bf629c6.tar.zst PeerTube-850c1bf7cc438b935f6e283c801b34b91bf629c6.zip |
Move iso639 strings in its own translation file
Diffstat (limited to 'scripts/i18n/create-custom-files.ts')
-rwxr-xr-x | scripts/i18n/create-custom-files.ts | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/scripts/i18n/create-custom-files.ts b/scripts/i18n/create-custom-files.ts index 3519afd47..7d994a710 100755 --- a/scripts/i18n/create-custom-files.ts +++ b/scripts/i18n/create-custom-files.ts | |||
@@ -34,10 +34,6 @@ values(VIDEO_CATEGORIES) | |||
34 | .concat(values(VIDEO_PRIVACIES)) | 34 | .concat(values(VIDEO_PRIVACIES)) |
35 | .forEach(v => serverKeys[v] = v) | 35 | .forEach(v => serverKeys[v] = v) |
36 | 36 | ||
37 | // ISO 639 keys | ||
38 | const languages = buildLanguages() | ||
39 | Object.keys(languages).forEach(k => serverKeys[languages[k]] = languages[k]) | ||
40 | |||
41 | // More keys | 37 | // More keys |
42 | Object.assign(serverKeys, { | 38 | Object.assign(serverKeys, { |
43 | 'Misc': 'Misc', | 39 | 'Misc': 'Misc', |
@@ -49,13 +45,27 @@ const serverTranslations = { | |||
49 | data: serverKeys | 45 | data: serverKeys |
50 | } | 46 | } |
51 | 47 | ||
48 | // ISO 639 keys | ||
49 | const languageKeys: any = {} | ||
50 | const languages = buildLanguages() | ||
51 | Object.keys(languages).forEach(k => languageKeys[languages[k]] = languages[k]) | ||
52 | |||
53 | const iso639Translations = { | ||
54 | target: join(__dirname, '../../../client/src/locale/source/iso639_en_US.xml'), | ||
55 | data: languageKeys | ||
56 | } | ||
57 | |||
52 | saveToXliffFile(playerTranslations, err => { | 58 | saveToXliffFile(playerTranslations, err => { |
53 | if (err) return handleError(err) | 59 | if (err) return handleError(err) |
54 | 60 | ||
55 | saveToXliffFile(serverTranslations, err => { | 61 | saveToXliffFile(serverTranslations, err => { |
56 | if (err) return handleError(err) | 62 | if (err) return handleError(err) |
57 | 63 | ||
58 | process.exit(0) | 64 | saveToXliffFile(iso639Translations, err => { |
65 | if (err) return handleError(err) | ||
66 | |||
67 | process.exit(0) | ||
68 | }) | ||
59 | }) | 69 | }) |
60 | }) | 70 | }) |
61 | 71 | ||