6 PERL_PROGS
="/usr/local/bin/tails-security-check \
7 /usr/local/lib/tails-htp-notify-user \
8 /usr/local/lib/tails-virt-notify-user"
9 PYTHON_PROGS
="/etc/whisperback/config.py \
10 /usr/local/bin/electrum \
11 /usr/local/bin/liferea \
12 /usr/local/bin/tails-about \
13 /usr/local/bin/tails-screen-locker \
14 /usr/local/bin/tails-upgrade-frontend-wrapper \
15 /usr/local/sbin/tails-additional-software"
16 SHELL_PROGS
="/etc/NetworkManager/dispatcher.d/60-tor-ready.sh \
17 /usr/local/bin/keepassx \
18 /usr/local/lib/tails-spoof-mac \
19 /usr/local/bin/tor-browser \
20 /usr/local/sbin/unsafe-browser"
22 /usr/share/gnome-shell/extensions/status-menu-helper@tails.boum.org/extension.js \
23 /usr/share/gnome-shell/extensions/torstatus@tails.boum.org/extension.js \
26 LOCALE_BASEDIR
=config
/chroot_local-includes
/usr
/share
/locale
28 ### External libraries
30 . config
/chroot_local-includes
/usr
/local
/lib
/tails-shell-library
/common.sh
31 . config
/chroot_local-includes
/usr
/local
/lib
/tails-shell-library
/po.sh
36 sed --regexp-extended \
37 -i 's@^"Content-Type: text/plain; charset=CHARSET\\n"@"Content-Type: text/plain; charset=UTF-8\\n"@' \
44 progpath
="config/chroot_local-includes$prog"
46 /usr
/share
/gnome-shell
/extensions
/status-menu-helper@tails.boum.org
/extension.js
)
47 domain
=status-menu-helper-extension.js
50 domain
=$
(basename $prog)
53 echo "tmp/pot/${domain}.pot"
59 progpath
="config/chroot_local-includes${prog}"
60 if [ -e "${progpath}" ]; then
61 pot
="$(prog_potfile "${prog}")"
62 mkdir
-p "$(dirname ${pot})"
63 xgettext
--language="${proglang}" --from-code=UTF-8 \
64 -o "${pot}" "${progpath}"
65 normalize_pot
"${pot}"
67 echo "error: We are supposed to create a POT file for '${prog}'" \
68 "but '${progpath}' does not exist"
76 echo "po/${locale}.po"
82 echo "${LOCALE_BASEDIR}/${locale}/LC_MESSAGES/tails.mo"
86 for locale
in "$@" ; do
89 mkdir
-p $
(dirname "$mo")
90 msgfmt
-o "${mo}" "${po}"
94 no_left_out_files
() {
95 (cd po
&& intltool-update
--maintain)
96 [ ! -e po
/missing
] ||
return 1
100 intltool_update_pot
() {
103 cp -a tails.pot tails.pot.orig
104 intltool-update
--pot --gettext-package=tails
105 normalize_pot tails.pot tails.pot.orig
107 if [ "${FORCE:-}" = yes ]; then
108 echo "Force-updating 'tails.pot'."
110 elif diff_without_pot_creation_date_and_comments
-q tails.pot.orig tails.pot
; then
111 echo "Only header or comment changes in tails.pot: keeping the old one"
112 mv tails.pot.orig tails.pot
114 echo "Real changes in tails.pot: switching to the updated one"
120 intltool_merge_desktop
() {
121 extract_from_file_between_markers po
/POTFILES.
in \
122 '^# Files updated by intltool-update --desktop-style' '^$' \
123 |
while read infile
; do
124 intltool-merge
--quiet --desktop-style --utf8 \
125 po
"$infile" "${infile%.in}"
129 intltool_merge_xml
() {
130 extract_from_file_between_markers po
/POTFILES.
in \
131 '^# Files updated by intltool-update --xml-style' '^$' \
132 |
while read infile
; do
133 intltool-merge
--quiet --xml-style --utf8 \
134 po
"$infile" "${infile%.in}"
142 while [ -n "${@:-}" ]; do
151 echo "Unknown option: ${1}"
159 trap "rm -fr po/*.new po/*.orig ; [ "$KEEP_TMP_POT" = yes ] || rm -fr tmp/pot" EXIT
163 for prog
in $PERL_PROGS ; do create_pot
$prog Perl
; done
164 for prog
in $PYTHON_PROGS ; do create_pot
$prog Python
; done
165 for prog
in $SHELL_PROGS ; do create_pot
$prog Shell
; done
166 for prog
in $JAVASCRIPT_PROGS ; do create_pot
$prog JavaScript
; done
169 # If left out files are detected, intltool-update --maintain writes
170 # them to po/missing.
171 no_left_out_files ||
exit 3
174 intltool_update_po $
(po_languages
)
176 # Update files that are actually used at runtime
177 refresh_mo $
(po_languages
)
178 intltool_merge_desktop
180 chmod +x config
/chroot_local-includes
/etc
/skel
/Desktop
/*.desktop