path: root/refresh-translations
diff options
authorintrigeri <>2017-09-13 18:35:37 +0000
committerintrigeri <>2017-09-13 18:35:37 +0000
commit2b770d45391588e13dc28b005c803e2a27be7c99 (patch)
tree515d0aff2062acf669d550ecd2189414988ec6c4 /refresh-translations
parentb826fc3fd1fb1e7d96caaac656db1008c511df99 (diff)
Fix custom polkit prompt and its translations (refs: #12738).
Without this, even after I've refreshed the POT and PO files, translated the new string into French and run ./refresh-translations again, the custom polkit prompt is not displayed even in English, which is no big surprise because the resulting config/chroot_local-includes/usr/share/polkit-1/actions/org.boum.tails.root-terminal.policy{,.in} are identical i.e. no translation is integrated, and even the original string in English is still in a <_message> block that won't be used at runtime. This is explained by the fact that `intltool-update --desktop-style' can't possibly work for XML files, so let's use --xml-style instead for org.boum.tails.root-terminal.policy. Note that I don't master awk so I don't know if the awk magics in intltool_merge_desktop will actually *stop* after having dealt with the block it's supposed to act on, or if that hack was assuming that we would never need any other similar trick (which was wrong as soon as it was written, oh well) and as a result it's going to try to handle org.boum.tails.root-terminal.policy with --desktop-style anyway. But as we've seen already this is a no-op so I won't bother learning awk today, and hopefully some day this code will be rewritten in a language I understand.
Diffstat (limited to 'refresh-translations')
1 files changed, 12 insertions, 3 deletions
diff --git a/refresh-translations b/refresh-translations
index af18011..636abab 100755
--- a/refresh-translations
+++ b/refresh-translations
@@ -113,14 +113,22 @@ intltool_update_pot () {
-intltool_merge () {
- awk '/^# Files updated by intltool-update/{flag=1;next}/^$/{flag=0}flag' po/ \
+intltool_merge_desktop () {
+ awk '/^# Files updated by intltool-update --desktop-style/{flag=1;next}/^$/{flag=0}flag' po/ \
| while read infile ; do
intltool-merge --quiet --desktop-style --utf8 \
po "$infile" "${}"
+intltool_merge_xml () {
+ awk '/^# Files updated by intltool-update --xml-style/{flag=1;next}/^$/{flag=0}flag' po/ \
+ | while read infile ; do
+ intltool-merge --quiet --xml-style --utf8 \
+ po "$infile" "${}"
+ done
### Main
# Schedule clean up
@@ -157,5 +165,6 @@ intltool_update_po $(po_languages)
# Update files that are actually used at runtime
refresh_mo $(po_languages)
chmod +x config/chroot_local-includes/etc/skel/Desktop/*.desktop