summaryrefslogtreecommitdiff
path: root/build-translations.sh
blob: 0ce7d5724066785d580f9cf98b7346ad5e7b80dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
cd packages/frontend;

PONAME=taler-merchant-backoffice
POGEN=node_modules/@gnu-taler/pogen/bin/pogen.js

find src \( -name '*.ts' -or -name '*.tsx' \) ! -name '*.d.ts' \
    | xargs node $POGEN \
    | msguniq \
    | msgmerge src/i18n/poheader - \
    > src/i18n/$PONAME.pot

# merge existing translations
for pofile in src/i18n/*.po; do 
  echo merging $pofile; 
  msgmerge -o $pofile $pofile src/i18n/$PONAME.pot; 
done;

# generate .ts file containing all translations
cat src/i18n/strings-prelude > src/i18n/strings.ts
for pofile in src/i18n/*.po; do \
  echo appending $pofile; \
  ./contrib/po2ts $pofile >> src/i18n/strings.ts; \
done;