Ticket #576 (closed enhancement: fixed)
Add new widget attribute i18n= that does absolutely nothing, but also is not dismissed as Unknown GUI Attribute
|Reported by:||ChrisOelmueller||Owned by:||FIFE|
|Time remaining:||Time spent:|
With UH as use case, we extract all strings from our xml files so that we can throw them into gettext. Because some of those strings are ambiguous and hard to translate if they lack context, we added an attribute i18n="" that gets extracted as well and added as comment. Looks like this: <Label name="neutral_label" text="neutral" i18n="Diplomacy state of player" />
When we display that widget though, pychan tells us how bad we've been and throws the following:
File "/home/eoc/UH/fife/trunk/engine/python/fife/extensions/pychan/__init__.py", line 351, in startElement self._createInstance(cls,name,attrs) File "/home/eoc/UH/fife/trunk/engine/python/fife/extensions/pychan/__init__.py", line 362, in _createInstance self._setAttr(obj,k,v) File "/home/eoc/UH/fife/trunk/engine/python/fife/extensions/pychan/__init__.py", line 344, in _setAttr raise GuiXMLError("Unknown GUI Attribute '%s' on '%s'" % (name,repr(obj))) fife.extensions.pychan.exceptions.GuiXMLError: Unknown GUI Attribute 'i18n' on '<Label(name='__unnamed__') at 9448fcc>'
We'd thus like an attribute that is kindly ignored by pychan for the purpose of providing i18n context to translators. Choose whatever name you think fits, stuff is not urgent (right now we simply generate the .pot files in a different branch than master) but would certainly be useful to not only UH.
Using helptext= is no option by the way as that's help for players ingame (e.g. displayed per tooltip) and really does not match the same helpfulness criteria as i18n= content.