Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
use po4a to make all docs translatable on Weblate and others
Browse files Browse the repository at this point in the history
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/

fsfe/reuse-website#26
  • Loading branch information
eighthave committed Jun 29, 2020
1 parent d80e017 commit 557a051
Show file tree
Hide file tree
Showing 5 changed files with 3,743 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

# no need to translate the source language, but po4a gens this file
po/reuse-docs.en.po

# po4a auto-generated markdown files from translations
[a-z][a-z]/*.md
[a-z][a-z][a-z]/*.md
[a-z][a-z][a-z]_[A-Z]*/*.md
[a-z][a-z]_[A-Z]*/*.md
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ We also accept and appreciate feedback by creating issues in the
project or by sending an e-mail to the [public REUSE mailing
list](https://lists.fsfe.org/mailman/listinfo/reuse).

### Translation

Translation happens by conversion Markdown into _gettext_ using
[po4a](https://po4a.org). To generate the _.md_ files from the
_gettext .po_ files, run: `po4a po/po4a.conf`.

## License

The relevant documents in this repository are licensed under [Creative Commons Attribution-ShareAlike 4.0](https://creativecommons.org/licenses/by-sa/4.0).
12 changes: 12 additions & 0 deletions po/po4a.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[po4a_langs] es
[po4a_paths] po/reuse-docs.pot $lang:po/reuse-docs.$lang.po

[options] opt:"--addendum-charset=UTF-8" opt:"--localized-charset=UTF-8" opt:"--master-charset=UTF-8" opt:"--master-language=en_US" opt:"--msgmerge-opt='--no-wrap'" opt:"--porefs=file" opt:"--wrap-po=newlines"

[po4a_alias:markdown] text opt:"--option markdown" opt:"--option yfm_keys=title" opt:"--addendum-charset=UTF-8" opt:"--localized-charset=UTF-8" opt:"--master-charset=UTF-8" opt:"--keep=100"

[type: markdown] CHANGELOG.md $lang:$lang/CHANGELOG.md
[type: markdown] README.md $lang:$lang/README.md
[type: markdown] faq.md $lang:$lang/faq.md
[type: markdown] spec.md $lang:$lang/spec.md
[type: markdown] tutorial.md $lang:$lang/tutorial.md

0 comments on commit 557a051

Please sign in to comment.