Translations¶
Structure¶
Here is the structure of translation directories:
data
│
├── po
│ ├── messages.pot
│ ├── <lang>.po
│ ├── <lang>.po
│ └── …
│
└── translations
├── <lang>.mo
├── <lang>.mo
└── …
data/po/messages.pot
: template for PO filesdata/po/<lang>.po
: PO file which contains strings with their translationsdata/translations/<lang>.mo
: generated MO file from its associated PO file
Manage the POT file¶
To create a new POT file:
find . -type f -name "*.py" | xgettext --sort-output -o data/po/messages.pot -kN_ -k_ -f -
To update an existing POT file:
find . -type f -name "*.py" | xgettext -j --sort-output -o data/po/messages.pot -kN_ -k_ -f -
Add a language¶
To add a language you would like, you have several options.
Open an issue to request it: https://github.com/fofix/fofix/issues/new.
Ask for a new language on Transifex.
Make a pull request with the new PO file:
msginit --input=data/po/messages.pot --locale=<code> --output=data/po/<lang>.po
Translate¶
To translate some strings, you should use our Transifex project. Please, feel free to join us :).
Note
Since there are a lot of strings to translate, it is easier using a web editor than using a local one like Poedit.
Note
Transifex is not the best choice for translations because it’s not open source anymore, but:
- the community is still big
- the interface looks nice.
Other open source web editors could be used later, if Transifex is not great enough for us: