aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/i18n/pull-hook.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/i18n/pull-hook.sh')
-rwxr-xr-xscripts/i18n/pull-hook.sh9
1 files changed, 5 insertions, 4 deletions
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
3set -eu 3set -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
8for i in 1 2 3; do 5for 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|&lt;x id=(.+?)/&gt;([^"])|<x id=\1/>\2|g' client/src/locale/target/*.xml 11 perl -pi -e 's|&lt;x id=(.+?)/&gt;([^"])|<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
11done 12done
12 13
13npm run i18n:xliff2json 14npm run i18n:xliff2json