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 \
11 /usr/local/bin/tails-screen-locker \
12 /usr/local/sbin/tails-additional-software"
13 SHELL_PROGS
="/etc/NetworkManager/dispatcher.d/60-tor-ready.sh \
14 /usr/local/bin/electrum \
15 /usr/local/bin/keepassx \
16 /usr/local/bin/tails-upgrade-frontend-wrapper \
17 /usr/local/lib/tails-spoof-mac \
18 /usr/local/bin/tor-browser \
19 /usr/local/sbin/unsafe-browser"
21 /usr/share/gnome-shell/extensions/status-menu-helper@tails.boum.org/extension.js \
22 /usr/share/gnome-shell/extensions/torstatus@tails.boum.org/extension.js \
25 LOCALE_BASEDIR
=config
/chroot_local-includes
/usr
/share
/locale
27 ### External libraries
29 . config
/chroot_local-includes
/usr
/local
/lib
/tails-shell-library
/common.sh
30 . config
/chroot_local-includes
/usr
/local
/lib
/tails-shell-library
/po.sh
35 sed --regexp-extended \
36 -i 's@^"Content-Type: text/plain; charset=CHARSET\\n"@"Content-Type: text/plain; charset=UTF-8\\n"@' \
43 progpath
="config/chroot_local-includes$prog"
45 /usr
/share
/gnome-shell
/extensions
/status-menu-helper@tails.boum.org
/extension.js
)
46 domain
=status-menu-helper-extension.js
49 domain
=$
(basename $prog)
52 echo "tmp/pot/${domain}.pot"
58 progpath
="config/chroot_local-includes${prog}"
59 if [ -e "${progpath}" ]; then
60 pot
="$(prog_potfile "${prog}")"
61 mkdir
-p "$(dirname ${pot})"
62 xgettext
--language="${proglang}" --from-code=UTF-8 \
63 -o "${pot}" "${progpath}"
64 normalize_pot
"${pot}"
66 echo "error: We are supposed to create a POT file for '${prog}'" \
67 "but '${progpath}' does not exist"
75 echo "po/${locale}.po"
81 echo "${LOCALE_BASEDIR}/${locale}/LC_MESSAGES/tails.mo"
85 for locale
in "$@" ; do
88 mkdir
-p $
(dirname "$mo")
89 msgfmt
-o "${mo}" "${po}"
93 no_left_out_files
() {
94 (cd po
&& intltool-update
--maintain)
95 [ ! -e po
/missing
] ||
return 1
99 intltool_update_pot
() {
102 cp -a tails.pot tails.pot.orig
103 intltool-update
--pot --gettext-package=tails
104 normalize_pot tails.pot tails.pot.orig
106 if [ "${FORCE:-}" = yes ]; then
107 echo "Force-updating 'tails.pot'."
109 elif diff_without_pot_creation_date_and_comments
-q tails.pot.orig tails.pot
; then
110 echo "Only header or comment changes in tails.pot: keeping the old one"
111 mv tails.pot.orig tails.pot
113 echo "Real changes in tails.pot: switching to the updated one"
119 intltool_merge_desktop
() {
120 extract_from_file_between_markers po
/POTFILES.
in \
121 '^# Files updated by intltool-update --desktop-style' '^$' \
122 |
while read infile
; do
123 intltool-merge
--quiet --desktop-style --utf8 \
124 po
"$infile" "${infile%.in}"
128 intltool_merge_xml
() {
129 extract_from_file_between_markers po
/POTFILES.
in \
130 '^# Files updated by intltool-update --xml-style' '^$' \
131 |
while read infile
; do
132 intltool-merge
--quiet --xml-style --utf8 \
133 po
"$infile" "${infile%.in}"
141 while [ -n "${@:-}" ]; do
150 echo "Unknown option: ${1}"
158 trap "rm -fr po/*.new po/*.orig ; [ "$KEEP_TMP_POT" = yes ] || rm -fr tmp/pot" EXIT
162 for prog
in $PERL_PROGS ; do create_pot
$prog Perl
; done
163 for prog
in $PYTHON_PROGS ; do create_pot
$prog Python
; done
164 for prog
in $SHELL_PROGS ; do create_pot
$prog Shell
; done
165 for prog
in $JAVASCRIPT_PROGS ; do create_pot
$prog JavaScript
; done
168 # If left out files are detected, intltool-update --maintain writes
169 # them to po/missing.
170 no_left_out_files ||
exit 3
173 intltool_update_po $
(po_languages
)
175 # Update files that are actually used at runtime
176 refresh_mo $
(po_languages
)
177 intltool_merge_desktop
179 chmod +x config
/chroot_local-includes
/etc
/skel
/Desktop
/*.desktop