GNOME Bugzilla – Bug 660631
story and year should probably not be translated
Last modified: 2011-10-02 15:33:32 UTC
In src/louis_braille-activity/louis_braille.py, "story" and "year" strings are marked as translatable. However, when testing in French, I obtain the following error: Traceback (most recent call last):
+ Trace 228661
self.refresh_level()
self.display_image()
story = self.dataset.get( str(self.gcomprisBoard.level), _("story") )
raise NoOptionError(option, section)
If i read the code well, these strings are keys in the config file. Therefore, I think they should not be marked as translatable. Am I wrong?
While reading the code, I'm beginning to understand. So it is not the "story" string that should be translated, but the result of the dataset.get call. So instead of: story = self.dataset.get( str(self.gcomprisBoard.level), _("story") ) this should be: story = _(self.dataset.get( str(self.gcomprisBoard.level), "story")) Now I'm still getting untranslated strings because of the initial space that is extracted in the po file from the activity.desktop.in file. Investigating...
Created attachment 197962 [details] [review] Fix i18n of louis-braille activity Here's my patch which should fix i18n for Louis Braille Story activity. First, the spaces around '=' are removed in activity.desktop.in so as there are no initial spaces in extracted strings by intltool. Second, in the code, translate the dataset.get result, not the "string" key.
Thanks a lot Claude, your patch is applied.
Sorry, but I just realize than in the last item, the year is translatable (_year=After his Death). So you should still modify the Python code to also translate the year part: year = _(self.dataset.get( str(self.gcomprisBoard.level) , "year")) Fortunately, this doesn't affect translators.
Fixed in commit 530afeb