-
Notifications
You must be signed in to change notification settings - Fork 41
Localization guide
dgranda edited this page Jul 18, 2012
·
1 revision
pytrainer currently uses GNU gettext to support different languages.
You need to complete 3 steps:
-
Infrastructure
- Add locale in
utils/translator.sh
script - Create appropiate path:
locale/<new_locale>/LC_MESSAGES/
- Create appropiate Makefile for
<new_locale>
- Change
setup.py
script to let it install new localization file
- Add locale in
-
Creation of
pytrainer.mo
file through po fileGood idea is to create an empty file:
touch locale/<new_locale>/LC_MESSAGES/pytrainer_<new_locale>.po
and then execute
utils/translatior.sh
script. It will:- Parse pytrainer and retrieve everything elegible to be translated
- Launch gettext catalogs (.po files) editor (poedit, gtranslator) to make translations (user input needed!)
- Merge old localization file and new one created through the editor ->
pytrainer_<new_locale>.po
- Compile po file to obtain
locale/<new_locale>/LC_MESSAGES/pytrainer.mo
-
Make pytrainer aware of new localization.
Executing
setup.py
script gets locale from working copy and copiespytrainer.mo
to final destination.
At next start of pytrainer <new_locale>
will be available