summaryrefslogtreecommitdiffstats
path: root/i18n-gen.sh
blob: 4de116f242604abd836a91a89eb3cd8e87a8d020 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
#
# To create a new language pack XX
# > mkdir -p ./i18n/XX/LC_MESSAGES/
# > msginit --input=./i18n/glances.pot --output=./i18n/XX/LC_MESSAGES/glances.po
# Translate using the ./i18n/XX/LC_MESSAGES/glances.po file
# Then add XX to the LANG_LIST
# Run this script
#

LANG_LIST='es fr it pt_BR'

xgettext --language=Python --keyword=_ --output=./i18n/glances.pot ./glances/glances.py

for i in `echo $LANG_LIST`
do
   echo "Generate language pack for: $i"
   msgmerge --update --no-fuzzy-matching --backup=off ./i18n/$i/LC_MESSAGES/glances.po ./i18n/glances.pot   
   msgfmt ./i18n/$i/LC_MESSAGES/glances.po --output-file ./i18n/$i/LC_MESSAGES/glances.mo
done