]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - scripts/i18n/generate.sh
(doc) note about PeerTube for YunoHost (#624)
[github/Chocobozzz/PeerTube.git] / scripts / i18n / generate.sh
CommitLineData
989e526a
C
1#!/bin/sh
2
3set -eu
4
5cd client
6npm run ng -- xi18n --i18n-locale "en-US" --output-path locale/source --out-file messages_en_US.xml
7npm run ngx-extractor -- --locale "en-US" -i 'src/**/*.ts' -f xlf -o src/locale/source/messages_en_US.xml
8
9# Zanata does not support inner elements in <source>, so we hack these special elements
10# This regex translate the Angular elements to special entities (that we will reconvert on pull)
510fefb1
C
11#sed -i 's/<x id=\(.\+\?\)\/>/\&lt;x id=\1\/\&gt;/g' src/locale/source/messages_en_US.xml
12perl -pi -e 's|<x id=(.+?)/>|&lt;x id=\1/&gt;|g' src/locale/source/messages_en_US.xml