]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - scripts/i18n/pull-hook.sh
Fix i18n generation
[github/Chocobozzz/PeerTube.git] / scripts / i18n / pull-hook.sh
CommitLineData
989e526a
C
1#!/bin/sh
2
3set -eu
4
28cfbf8b 5for i in $(seq 1 20); do
02ba6130
C
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
b59f12b0
C
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
e945b184
C
11 perl -pi -e 's|&lt;x id=(.+?)/&gt;([^"])|<x id=\1/>\2|g' client/src/locale/target/*.xml
12done
13
9c2e0dbf
C
14npm run i18n:xliff2json
15