diff options
Diffstat (limited to 'scripts/i18n')
-rwxr-xr-x | scripts/i18n/create-custom-files.ts | 10 | ||||
-rwxr-xr-x | scripts/i18n/pull-hook.sh | 9 |
2 files changed, 13 insertions, 6 deletions
diff --git a/scripts/i18n/create-custom-files.ts b/scripts/i18n/create-custom-files.ts index ab28f94c8..95897afa3 100755 --- a/scripts/i18n/create-custom-files.ts +++ b/scripts/i18n/create-custom-files.ts | |||
@@ -5,7 +5,7 @@ import { | |||
5 | buildLanguages, | 5 | buildLanguages, |
6 | VIDEO_CATEGORIES, | 6 | VIDEO_CATEGORIES, |
7 | VIDEO_IMPORT_STATES, | 7 | VIDEO_IMPORT_STATES, |
8 | VIDEO_LICENCES, | 8 | VIDEO_LICENCES, VIDEO_PLAYLIST_PRIVACIES, VIDEO_PLAYLIST_TYPES, |
9 | VIDEO_PRIVACIES, | 9 | VIDEO_PRIVACIES, |
10 | VIDEO_STATES | 10 | VIDEO_STATES |
11 | } from '../../server/initializers/constants' | 11 | } from '../../server/initializers/constants' |
@@ -23,12 +23,16 @@ const playerKeys = { | |||
23 | 'Speed': 'Speed', | 23 | 'Speed': 'Speed', |
24 | 'Subtitles/CC': 'Subtitles/CC', | 24 | 'Subtitles/CC': 'Subtitles/CC', |
25 | 'peers': 'peers', | 25 | 'peers': 'peers', |
26 | 'peer': 'peer', | ||
26 | 'Go to the video page': 'Go to the video page', | 27 | 'Go to the video page': 'Go to the video page', |
27 | 'Settings': 'Settings', | 28 | 'Settings': 'Settings', |
28 | 'Uses P2P, others may know you are watching this video.': 'Uses P2P, others may know you are watching this video.', | 29 | 'Uses P2P, others may know you are watching this video.': 'Uses P2P, others may know you are watching this video.', |
29 | 'Copy the video URL': 'Copy the video URL', | 30 | 'Copy the video URL': 'Copy the video URL', |
30 | 'Copy the video URL at the current time': 'Copy the video URL at the current time', | 31 | 'Copy the video URL at the current time': 'Copy the video URL at the current time', |
31 | 'Copy embed code': 'Copy embed code' | 32 | 'Copy embed code': 'Copy embed code', |
33 | 'Copy magnet URI': 'Copy magnet URI', | ||
34 | 'Total downloaded: ': 'Total downloaded: ', | ||
35 | 'Total uploaded: ': 'Total uploaded: ' | ||
32 | } | 36 | } |
33 | const playerTranslations = { | 37 | const playerTranslations = { |
34 | target: join(__dirname, '../../../client/src/locale/source/player_en_US.xml'), | 38 | target: join(__dirname, '../../../client/src/locale/source/player_en_US.xml'), |
@@ -42,6 +46,8 @@ values(VIDEO_CATEGORIES) | |||
42 | .concat(values(VIDEO_PRIVACIES)) | 46 | .concat(values(VIDEO_PRIVACIES)) |
43 | .concat(values(VIDEO_STATES)) | 47 | .concat(values(VIDEO_STATES)) |
44 | .concat(values(VIDEO_IMPORT_STATES)) | 48 | .concat(values(VIDEO_IMPORT_STATES)) |
49 | .concat(values(VIDEO_PLAYLIST_PRIVACIES)) | ||
50 | .concat(values(VIDEO_PLAYLIST_TYPES)) | ||
45 | .concat([ | 51 | .concat([ |
46 | 'This video does not exist.', | 52 | 'This video does not exist.', |
47 | 'We cannot fetch the video. Please try again later.', | 53 | 'We cannot fetch the video. Please try again later.', |
diff --git a/scripts/i18n/pull-hook.sh b/scripts/i18n/pull-hook.sh index b0668436d..2d728fef5 100755 --- a/scripts/i18n/pull-hook.sh +++ b/scripts/i18n/pull-hook.sh | |||
@@ -2,12 +2,13 @@ | |||
2 | 2 | ||
3 | set -eu | 3 | set -eu |
4 | 4 | ||
5 | # Zanata does not support inner elements in <source>, so we hack these special elements | ||
6 | # This regex translate the converted elements to initial Angular elements | ||
7 | |||
8 | for i in 1 2 3; do | 5 | for i in 1 2 3; do |
6 | # Angular does not like when there is not target element, so we create it with the same content than the source element | ||
7 | perl -0pi -e 's#<source>([^<]+)</source>\s*<context-group #<source>\1</source><target>\1</target><context-group #g' client/src/locale/target/angular_*.xml | ||
8 | |||
9 | # Zanata does not support inner elements in <source>, so we hack these special elements | ||
10 | # This regex translate the converted elements to initial Angular elements | ||
9 | perl -pi -e 's|<x id=(.+?)/>([^"])|<x id=\1/>\2|g' client/src/locale/target/*.xml | 11 | perl -pi -e 's|<x id=(.+?)/>([^"])|<x id=\1/>\2|g' client/src/locale/target/*.xml |
10 | perl -0pi -e 's|<source>(.+?)</source>\s*<context-group |<source>\1</source><target>\1</target><context-group |g' client/src/locale/target/angular_*.xml | ||
11 | done | 12 | done |
12 | 13 | ||
13 | npm run i18n:xliff2json | 14 | npm run i18n:xliff2json |