Activity Translations: Difference between revisions

From OLPC
Jump to navigation Jump to search
(+cat + cosmetics)
Line 9: Line 9:
from gettext import gettext as _
from gettext import gettext as _


* Mark strings as translatable using _('String')
* Mark strings as translatable using <tt>_('String')</tt>


self._forward.set_tooltip(_('Forward'))
self._forward.set_tooltip('''_('Forward')''')


=== Generate the POT file for translators ===
=== Generate the POT file for translators ===
Line 22: Line 22:


* Open a new [http://dev.laptop.org/newticket Trac ticket], in the Localization component, specifying the source repository location. You will need to include the following information (with examples):
* Open a new [http://dev.laptop.org/newticket Trac ticket], in the Localization component, specifying the source repository location. You will need to include the following information (with examples):
** Module name (Write)
** Module name (''Write'')
** Maintainer Name + Email (Foo Bar / foo@foo.com)
** Maintainer Name + Email (''Foo Bar / foo@foo.com'')
** Maintainer URL (http://fedoraproject.org/wiki/ChristopherBlizzard)
** Maintainer URL (''http://fedoraproject.org/wiki/ChristopherBlizzard'')
** URL to your repository (i.e. http://dev.laptop.org/git.do?p=sugar;a=summary)
** URL to your repository (i.e. ''http://dev.laptop.org/git.do?p=sugar;a=summary'')


Once that's done the people who care about localization can get the .pot files to translate and can contribute them back.
Once that's done the people who [[Translators|care about localization]] can get the <tt>.pot</tt> files to translate and can contribute them back.


== Translators ==
== [[Translators]] ==


* Go to page for the project you want to translate on [http://translate.fedoraproject.org Fedora Translations].
* Go to page for the project you want to translate on [http://translate.fedoraproject.org Fedora Translations].
Line 38: Line 38:
** [http://translate.fedoraproject.org/module/olpc-xbook Xbook]
** [http://translate.fedoraproject.org/module/olpc-xbook Xbook]
* Once your translation is ready open a new [http://dev.laptop.org/newticket Trac ticket], in the Localization component and attach your translation (as a .po file).
* Once your translation is ready open a new [http://dev.laptop.org/newticket Trac ticket], in the Localization component and attach your translation (as a .po file).

== See Also ==

* The [[Kuku]] internationalization sample of [[Python i18n]]
* The [[Activities]] page

[[Category:Language support]]
[[Category:Languages (international)]]
[[Category:Localization]]

Revision as of 15:37, 28 June 2007

These instructions applies to a python activity using the base activity classes and the bundlebuilder. For more background information about Localization please see the Localization page.

Activity authors

Make the code translatable

  • Import the gettext module
from gettext import gettext as _
  • Mark strings as translatable using _('String')
self._forward.set_tooltip(_('Forward'))

Generate the POT file for translators

  • You will need to generate it and push it in the repository every time you add strings. (XXX how do we automatize it)
./setup.py dist

Get your strings localized

Once that's done the people who care about localization can get the .pot files to translate and can contribute them back.

Translators

See Also