forked from pytrainer/pytrainer
-
Notifications
You must be signed in to change notification settings - Fork 0
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.shscript - Create appropiate path:
locale/<new_locale>/LC_MESSAGES/ - Create appropiate Makefile for
<new_locale> - Change
setup.pyscript to let it install new localization file
- Add locale in
-
Creation of
pytrainer.mofile through po fileGood idea is to create an empty file:
touch locale/<new_locale>/LC_MESSAGES/pytrainer_<new_locale>.poand then execute
utils/translatior.shscript. 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.pyscript gets locale from working copy and copiespytrainer.moto final destination.
At next start of pytrainer <new_locale> will be available