Files
wger/docs/i18n.rst
2015-02-03 10:10:01 +01:00

43 lines
1.5 KiB
ReStructuredText

Internationalization (i18n)
===========================
Updating the translation files
------------------------------
wger uses django's translation infrastructure, but there are a couple of things
that need to be considered. First, update your po files with the default django command (run this in the wger folder)::
django-admin makemessages --locale en
Extract some translatable strings from the database such as exercise categories
and muscle names::
python manage.py extract-i18n
and add them to the end of ``locale/en/LC_MESSAGES/django.po``. Once you have
translated the file, compile it with::
django-admin compilemessages --all
Adding new languages
--------------------
Besides adding the new translations to the locale folder, they have to be
activated in django and in the application itself.
* **django:** Add an entry to ``LANGUAGES`` in ``settings_global.py``
* **wger:** Add the new language in the language admin page and set the
visibility of excercises and ingredients
* **fixtures:** After having added the language in the admin module, export
the database, filter it with the ``filter-fixtures.py`` script in
``extras/scripts`` and copy ``language_config.json`` to the fixtures folder
in the config app and ``languages.json`` to core.
* **flag icon:** Add an appropriate flag icon in SVG format in ``images/icons/flag-NAME.svg``
in the static folder of the core application
.. note::
At the moment composed language codes such as pt-BR are **not** supported.