Update PO files.
[tails-test.git] / refresh-translations
blob3f6556f7da07d8b3c57afd0008cc5e07c013ef41
1 #! /bin/sh
3 # get AMNESIA_SUPPORTED_LANGUAGES
4 . config/amnesia
5 if [ -e config/amnesia.local ] ; then
6 . config/amnesia.local
7 fi
9 refresh_translations () {
10 progpath="config/chroot_local-includes$1" ; shift
11 domain=$1 ; shift
12 proglang=$1 ; shift
14 sharedir="config/chroot_local-includes/usr/share/${domain}"
15 locale_basedir="config/chroot_local-includes/usr/share/locale"
16 pot="${sharedir}/messages.pot"
18 mkdir -p "${sharedir}"
20 if [ -e "${progpath}" ]; then
21 xgettext --language="${proglang}" --from-code=UTF-8 \
22 -o "${pot}" "${progpath}"
25 for locale in $AMNESIA_SUPPORTED_LANGUAGES ; do
26 po="${locale_basedir}/${locale}/LC_MESSAGES/${domain}.po"
27 mo="${locale_basedir}/${locale}/LC_MESSAGES/${domain}.mo"
28 mkdir -p "${locale_basedir}/${locale}/LC_MESSAGES"
29 [ -e "${po}" ] || cp "${pot}" "${po}"
30 msgmerge --update "${po}" "${pot}"
31 msgfmt -o "${mo}" "${po}"
32 done
35 #################### file domain lang
36 refresh_translations /usr/local/bin/gpgApplet gpgApplet Perl
37 refresh_translations /usr/local/bin/tails-security-check tails-security-check Perl
38 refresh_translations /usr/local/bin/tails-htp-notify-user tails-htp-notify-user Perl
39 refresh_translations /usr/local/bin/tails-virt-notify-user tails-virt-notify-user Perl
40 refresh_translations /usr/local/sbin/unsafe-browser unsafe-browser Shell
41 refresh_translations /etc/whisperback/config.py amnesia Python
42 refresh_translations /usr/local/bin/shutdown_helper_applet shutdown_helper_applet Python