mquinson / po4a

Maintain the translations of your documentation with ease (PO for anything)
http://po4a.org/
GNU General Public License v2.0
123 stars 61 forks source link

if msgmerge exits with error, po4a does not #311

Closed eighthave closed 3 years ago

eighthave commented 3 years ago

If there an error processing files with msgmerge, po4a still exits as if there was no error. In the case of f-droid.org, this means that errors in the bo translation stopped other languages from being rendered.

 ~/.../fdroid/website $ ./tools/i18n.sh
/usr/bin/po4a
Updating po/_docs.pot:Updating po/_pages.pot: (138 entries)
Updating po/_posts.pot:Updating po/_pages.bo.po: 43 translated messages, 26 fuzzy translations, 69 untranslated messages.
Updating po/_pages.de.po: 133 translated messages, 2 fuzzy translations, 3 untranslated messages.
Discard _pages/bo/403.md (0 of 2 strings; only 0% translated; need 80%).
Discard _pages/bo/404.md (0 of 2 strings; only 0% translated; need 80%).
Discard _pages/bo/about.md (7 of 25 strings; only 28% translated; need 80%).
Discard _pages/bo/consulting.md (0 of 25 strings; only 0% translated; need 80%).
Discard _pages/bo/contribute.md (7 of 17 strings; only 41.17% translated; need 80%).
Discard _pages/bo/docs.md (27 of 42 strings; only 64.28% translated; need 80%).
Discard _pages/bo/donate.md (1 of 12 strings; only 8.33% translated; need 80%).
Discard _pages/bo/issues.md (1 of 7 strings; only 14.28% translated; need 80%).
Discard _pages/bo/repomaker.md (0 of 9 strings; only 0% translated; need 80%).
_pages/de/403.md is 100% translated (2 strings).
_pages/de/404.md is 100% translated (2 strings).
_pages/de/about.md is 100% translated (25 strings).
_pages/de/consulting.md is 80% translated (20 of 25 strings).
_pages/de/contribute.md is 100% translated (17 strings).
_pages/de/docs.md is 100% translated (42 strings).
_pages/de/donate.md is 100% translated (12 strings).
_pages/de/issues.md is 100% translated (7 strings).
_pages/de/repomaker.md is 100% translated (9 strings).
_pages/en/403.md is 100% translated (2 strings).
_pages/en/404.md is 100% translated (2 strings).
_pages/en/about.md is 100% translated (25 strings).
_pages/en/consulting.md is 100% translated (25 strings).
_pages/en/contribute.md is 100% translated (17 strings).
_pages/en/docs.md is 100% translated (42 strings).
_pages/en/donate.md is 100% translated (12 strings).
_pages/en/issues.md is 100% translated (7 strings).
_pages/en/repomaker.md is 100% translated (9 strings).
 (1682 entries)
Error: 'msgmerge /home/hans/code/fdroid/website/po/_docs.bo.po /home/hans/code/fdroid/website/po/_docs.pot --previous 
--add-location=file --no-wrap --backup=none --update' exited with value 1.
 (3119 entries)
Error: 'msgmerge /home/hans/code/fdroid/website/po/_posts.bo.po /home/hans/code/fdroid/website/po/_posts.pot 
--previous --add-location=file --no-wrap --backup=none --update' exited with value 1.
 ~/.../fdroid/website $ echo $?
0
 ~/.../fdroid/website $ msgmerge /home/hans/code/fdroid/website/po/_docs.bo.po /home/hans/code/fdroid/website/po/_docs.pot --previous --add-location=file --no-wrap --backup=none --update
/home/hans/code/fdroid/website/po/_docs.bo.po:1836:68: syntax error
msgmerge: found 1 fatal error
 ~/.../fdroid/website $ echo $?
1
 ~/.../fdroid/website $ 

Here's a full log where that happened: deploy-to-f-droid.org.log.gz

And the site build:

git clone https://gitlab.com/fdroid/fdroid-website.git
git checkout da65eb8463d37be8a327e7803be66b8c494fc65d

FYI @obfusk

eighthave commented 3 years ago

Oops, sorry for the noise, the issue is actually in our i18n.sh script!

mquinson commented 3 years ago

That's really a pitty that this bug was not for us at the end, because the bug report was really high quality, with the detailled description, full logs, and easy instructions to reproduce the problem :clap: