Activity Team: Difference between revisions
| Line 38: | Line 38: | ||
*[[Activity_Team/Modifying_an_Activity]] | *[[Activity_Team/Modifying_an_Activity]] | ||
===Internationalization=== | |||
We use gettext to internationalize activities. The basic steps are: | |||
In your Python code: | |||
from gettext import gettext as _ | |||
Hence forth, encapsulate strings that you want translated in _(): | |||
_('string to be translated') | |||
Run <code>setup.py</code> to generate a POT file for your project. This file will contain a reference to all of the encapsulated strings. | |||
From here, you need to: | |||
# <code>git add</code>, <code>commit</code>, and <code>push</code> the POT file to git | |||
# request that your project be added to the pootle server (by filing a task to the localization component on bugs.sugarlabs.org) | |||
# add pootle as a committer to your project on gitorious | |||
Once translations are committed to your project: | |||
# do a <code>git pull</code> to get a local copy of the .po files | |||
# run <code>setup.py fix_manifest</code> to create the .mo files used at run time | |||
Details can be found on the [[Translation_Team/i18n_Best_Practices]]. | |||
===General overview of git=== | ===General overview of git=== | ||