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/tails-about /usr/local/sbin/tails-additional-software"
11 SHELL_PROGS
="/etc/NetworkManager/dispatcher.d/60-tor-ready.sh \
12 /usr/local/bin/electrum \
13 /usr/local/bin/keepassx \
14 /usr/local/bin/tails-upgrade-frontend-wrapper \
15 /usr/local/lib/tails-spoof-mac \
16 /usr/local/bin/tor-browser \
17 /usr/local/sbin/unsafe-browser"
19 /usr/share/gnome-shell/extensions/shutdown-helper@tails.boum.org/extension.js \
20 /usr/share/gnome-shell/extensions/torstatus@tails.boum.org/extension.js \
23 LOCALE_BASEDIR
=config
/chroot_local-includes
/usr
/share
/locale
25 ### External libraries
27 . config
/chroot_local-includes
/usr
/local
/lib
/tails-shell-library
/common.sh
28 . config
/chroot_local-includes
/usr
/local
/lib
/tails-shell-library
/po.sh
33 sed --regexp-extended \
34 -i 's@^"Content-Type: text/plain; charset=CHARSET\\n"@"Content-Type: text/plain; charset=UTF-8\\n"@' \
41 progpath
="config/chroot_local-includes$prog"
43 /usr
/share
/gnome-shell
/extensions
/shutdown-helper@tails.boum.org
/extension.js
)
44 domain
=shutdown-helper-extension.js
47 domain
=$
(basename $prog)
50 echo "tmp/pot/${domain}.pot"
56 progpath
="config/chroot_local-includes${prog}"
57 if [ -e "${progpath}" ]; then
58 pot
="$(prog_potfile "${prog}")"
59 mkdir
-p "$(dirname ${pot})"
60 xgettext
--language="${proglang}" --from-code=UTF-8 \
61 -o "${pot}" "${progpath}"
62 normalize_pot
"${pot}"
64 echo "error: We are supposed to create a POT file for '${prog}'" \
65 "but '${progpath}' does not exist"
73 echo "po/${locale}.po"
79 echo "${LOCALE_BASEDIR}/${locale}/LC_MESSAGES/tails.mo"
83 for locale
in "$@" ; do
86 mkdir
-p $
(dirname "$mo")
87 msgfmt
-o "${mo}" "${po}"
91 no_left_out_files
() {
92 (cd po
&& intltool-update
--maintain)
93 [ ! -e po
/missing
] ||
return 1
97 intltool_update_pot
() {
100 cp -a tails.pot tails.pot.orig
101 intltool-update
--pot --gettext-package=tails
102 normalize_pot tails.pot tails.pot.orig
104 if [ "${FORCE:-}" = yes ]; then
105 echo "Force-updating 'tails.pot'."
107 elif diff_without_pot_creation_date_and_comments
-q tails.pot.orig tails.pot
; then
108 echo "Only header or comment changes in tails.pot: keeping the old one"
109 mv tails.pot.orig tails.pot
111 echo "Real changes in tails.pot: switching to the updated one"
117 intltool_merge_desktop
() {
118 extract_from_file_between_markers po
/POTFILES.
in \
119 '^# Files updated by intltool-update --desktop-style' '^$' \
120 |
while read infile
; do
121 intltool-merge
--quiet --desktop-style --utf8 \
122 po
"$infile" "${infile%.in}"
126 intltool_merge_xml
() {
127 extract_from_file_between_markers po
/POTFILES.
in \
128 '^# Files updated by intltool-update --xml-style' '^$' \
129 |
while read infile
; do
130 intltool-merge
--quiet --xml-style --utf8 \
131 po
"$infile" "${infile%.in}"
139 while [ -n "${@:-}" ]; do
148 echo "Unknown option: ${1}"
156 trap "rm -fr po/*.new po/*.orig ; [ "$KEEP_TMP_POT" = yes ] || rm -fr tmp/pot" EXIT
160 for prog
in $PERL_PROGS ; do create_pot
$prog Perl
; done
161 for prog
in $PYTHON_PROGS ; do create_pot
$prog Python
; done
162 for prog
in $SHELL_PROGS ; do create_pot
$prog Shell
; done
163 for prog
in $JAVASCRIPT_PROGS ; do create_pot
$prog JavaScript
; done
166 # If left out files are detected, intltool-update --maintain writes
167 # them to po/missing.
168 no_left_out_files ||
exit 3
171 intltool_update_po $
(po_languages
)
173 # Update files that are actually used at runtime
174 refresh_mo $
(po_languages
)
175 intltool_merge_desktop
177 chmod +x config
/chroot_local-includes
/etc
/skel
/Desktop
/*.desktop