summaryrefslogtreecommitdiffstats
path: root/i18n/update_translations.sh
blob: 7a75a0b271b611dedc176350befe478f194e060d (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
26
27
28
29
#!/bin/bash
POFILE=$1

xgettext usr/share/applications/template_mageiawelcome.desktop -o desktop.pot

pylupdate5 qml/mageiawelcome.py -ts py.ts
lupdate mageiawelcome.pro -ts qml.ts

lconvert -i py.ts qml.ts -o main.pot
msgcat *.pot > po/mageiawelcome.pot

rm -rf py.ts qml.ts desktop.pot main.pot

if [[ $POFILE == "" ]]; then
  for i in po/*.po
  do
    echo -n $i": "
    msgmerge --backup=none --update $i po/mageiawelcome.pot && \
    msgfmt -o /dev/null --statistics --check $i
    pofile=${i#*/}
    locale=${pofile%.*}
    lconvert $i -o i18n/mageiawelcome_$locale.ts
  done
else
  echo -n $1".po: "
  msgmerge --backup=none --update po/$1.po po/mageiawelcome.pot && \
  msgfmt -o /dev/null --statistics --check po/$1.po
  lconvert po/$1.po -o i18n/mageiawelcome_$1.ts
fi