wichert / lingua

Translation toolkit for Python
Other
46 stars 32 forks source link

helper script i18n.sh could notify about fuzzy translations #59

Closed saschagottfried closed 9 years ago

saschagottfried commented 9 years ago

I use docs/examples/i18n.sh a couple of days. I works like a charm. Everything is working fine and the script output is like:

Extract messages
Update translations
....... done.
....... done. 
Compile message catalogs

But sometimes a translation is not showing up. After a bit of investigation I almost always find that small word fuzzy in the translation files (*.po).

After running the script I would like to be informed about fuzzy translations. It was pretty easy to change that. Just add --statistics to the call to msgfmt:

msgfmt --statistics -o "${po%.*}.mo" "$po"

Now a very useful summary with quantitative information is appended:

Extract messages
Update translations
....... done.
....... done.
Compile message catalogs
39 translated messages.
34 translated message, 1 fuzzy translation, 4 untranslated messages.

Given that little bit of more information I know exactly that there are fuzzy translations and can fix them immediately if I want.

piotr-dobrogost commented 8 years ago

Why was it put in the example only and not in the script? Having no information on fuzzy translations gives bad user experience.

rnixx commented 8 years ago

What do you mean with "in the example only and not in the script"?

BTW - this one is a good change https://github.com/Kotti/Kotti/commit/b14133cfcd1106173a9eb44c21b79a5c452448a6#diff-8eee0084a940ff710b60a5704fb951b5R38 you might open a pull request.

piotr-dobrogost commented 8 years ago

Sorry, I had impression i18n.sh script is part of project's source which apparently is not the case (it lives only in examples). As to the change you showed I have plan to make PR with this and other changes restoring some features of Babel's python scripts.

rnixx commented 8 years ago

Actually it's just a - even if very well working - example how one can do things with lingua ;)

piotr-dobrogost commented 8 years ago

Btw, what was the reason to "lump" all steps into one shell script and not to have four python scripts as in Babel?

rnixx commented 8 years ago

The reason is that I only have to remember one script instead of four. It's the lowest barrier I can think of for new users (UPDATE and for me)