Resurrect another blueprint.
[besstails.git] / refresh-translations
blobd41862849a828cea7a64022990e1eba3361aaa12
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}"
23 sed -i "s@^\"Content-Type: text/plain\; charset=CHARSET\\\n\"@\"Content-Type: text/plain\; charset=UTF-8\\\n\"@" "${pot}"
27 for locale in $AMNESIA_SUPPORTED_LANGUAGES ; do
28 po="${locale_basedir}/${locale}/LC_MESSAGES/${domain}.po"
29 mo="${locale_basedir}/${locale}/LC_MESSAGES/${domain}.mo"
30 mkdir -p "${locale_basedir}/${locale}/LC_MESSAGES"
31 [ -e "${po}" ] || cp "${pot}" "${po}"
32 msgmerge --update "${po}" "${pot}"
33 msgfmt -o "${mo}" "${po}"
34 done
37 #################### file domain lang
38 refresh_translations /usr/local/bin/gpgApplet gpgApplet Perl
39 refresh_translations /usr/local/bin/tails-security-check tails-security-check Perl
40 refresh_translations /usr/local/bin/tails-htp-notify-user tails-htp-notify-user Perl
41 refresh_translations /usr/local/bin/tails-virt-notify-user tails-virt-notify-user Perl
42 refresh_translations /usr/local/sbin/unsafe-browser unsafe-browser Shell
43 refresh_translations /etc/whisperback/config.py amnesia Python
44 refresh_translations /usr/local/bin/shutdown_helper_applet shutdown_helper_applet Python
45 refresh_translations /usr/local/bin/tails-about tails-about Python
46 refresh_translations /usr/local/sbin/tails-additional-software tails-additional-software Python