fsfe / reuse-docs

REUSE recommendations, tutorials, FAQ and specification
https://reuse.software
19 stars 20 forks source link

use po4a to make all docs translatable on Weblate and others #61

Closed eighthave closed 3 years ago

eighthave commented 4 years ago

This uses po4a to convert Markdown documents into gettext .po files, while adding key metadata and hiding bits that the translators don't need to see.

For the deep dive, see: https://guardianproject.info/2020/04/23/figuring-out-crowdsourced-translation-of-websites/

https://github.com/fsfe/reuse-website/issues/26

wetneb commented 4 years ago

How do you plan to keep the .pot files in sync with the source markdown? As far as I can tell:

eighthave commented 4 years ago

Those first two are options, it really depends on the maintainers of this how they want to do it. You can also do it manually when you deem things ready for translation to avoid automatically sending the churn to Weblate. I haven't used GitHub Actions before, but it sounds like it should work.

carmenbianca commented 4 years ago

Silly question maybe: Is the presence of en.po necessary? The way I see it, no actual translations happen inside of that file.

I occasionally translate for GNOME, which only has translations for en_GB. The en translations just default to the American English used in the source code.

(Of course, the awkward thing about REUSE is that it uses chiefly British English, but uses the American 'license'. But that's an unrelated detail.)

eighthave commented 4 years ago

Good point: I switched the initial translation language to Spanish (es).

eighthave commented 4 years ago

What do you need me to do to get this merged? should I implement the GitHub Actions idea?

mxmehl commented 4 years ago

Thanks for the clarifications!

I just ran po4a po/po4a.conf and it creates different .pot files.

For instance, -#, markdown-text is removed many times, and in your version there are still mentions of the Changelog and README file. I could generate this after merging your PR, just want to be on the safe side since my knowledge about PO/PO4A is very limited (yet).

eighthave commented 4 years ago

you need to use the latest release of po4a. Its available in Debian/buster-backports and Debian/testing. Or you can directly install it using Perl methods.

mxmehl commented 4 years ago

Oh thanks, I thought that with Arch I was quite on the edge – this isn't the case here.

May I still ask you to re-run po4a on your side to throw our README and CHANGELOG? But perhaps it would make more sense to do the github-actions thing in the long run.

eighthave commented 4 years ago

done!

eighthave commented 3 years ago

This was approved and I fixed the issue @mxmehl pointed out. How about merging? Then this can be added to https://hosted.weblate.org/projects/fsfe/

mxmehl commented 3 years ago

Sure, looks good. Will merge and take care that the REUSE check looks a bit better :)