summaryrefslogtreecommitdiffstats
path: root/refresh-translations
blob: 57a12852b9a90a017abf92a8d86021cafd1aee1b (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
30
31
32
33
34
35
36
37
38
39
#! /bin/sh

# get AMNESIA_SUPPORTED_LANGUAGES
. config/amnesia
if [ -e config/amnesia.local ] ; then
   . config/amnesia.local
fi

refresh_translations () {
   prog=$1
   proglang=$2

   sharedir="config/chroot_local-includes/usr/share/${prog}"
   locale_basedir="config/chroot_local-includes/usr/share/locale"
   pot="${sharedir}/messages.pot"

   mkdir -p "${sharedir}"

   xgettext --language="${proglang}" --from-code=UTF-8 \
      -o "${pot}" \
      "config/chroot_local-includes/usr/local/bin/${prog}"

   for locale in $AMNESIA_SUPPORTED_LANGUAGES ; do
      po="${locale_basedir}/${locale}/LC_MESSAGES/${prog}.po"
      mo="${locale_basedir}/${locale}/LC_MESSAGES/${prog}.mo"
      mkdir -p "${locale_basedir}/${locale}/LC_MESSAGES"
      [ -e "${po}" ] || cp "${pot}" "${po}"
      msgmerge --update "${po}" "${pot}"
      msgfmt -o "${mo}" "${po}"
   done
}

for prog in tails-security-check tails-htp-notify-user tails-virt-notify-user ; do
   refresh_translations $prog Perl
done

for prog in nautilus-sfill nautilus-wipe ; do
   refresh_translations $prog Shell
done