[Sugar-devel] internationalization: homonym handling in genpot?

Gary Martin garycmartin at googlemail.com
Fri Sep 10 13:11:43 EDT 2010

Hi Erik,

On 10 Sep 2010, at 16:36, Erik Blankinship <erikb at mediamods.com> wrote:

> (maybe there is genpot list where this message is more apropos?  Sorry, genpot is opaque to me.)
> My activity has two identical-in-english strings (homonyms) which need translating, but have two different meanings depending on context in an activity.
> How should I flag genpot that these are two different strings which might require different translations?
> 	#TRANS: bow and arrow
> 	activeDisplay = _("Bow")
> 	#TRANS: the front of a ship
> 	istrDisplay = _("Bow")

Ooh interesting, not bumped into this need myself yet, but (as a cheat) it strikes me that gettext is using the given strings as IDs for its string lookups so you could replace your strings with _("Arrow|Bow") and _("Ship|Bow"), then make sure the pot file actually has the correct Bow msgstr set. I think though what your really looking for is context support but have not tinkered other than a few min googling:


If the Python workflow is working/there, and I haven't tested... you'd get extra msgctxt entry in the pot file containing your extra context argument supplied with the string allowing for disambiguation.

Interesting questing, hope that helped :) 


> Currently python setup.py genpot produces this output, making it impossible for the translator to handle both meanings differently:
> #. TRANS: bow and arrow
> #. TRANS: the front of a ship
> #: constants.py:35
> #: constants.py:38
> msgid "Bow"
> msgstr ""
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sugarlabs.org/archive/sugar-devel/attachments/20100910/d76403ce/attachment-0001.htm 

More information about the Sugar-devel mailing list