After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 660631 - story and year should probably not be translated
story and year should probably not be translated
Status: RESOLVED FIXED
Product: gcompris
Classification: Other
Component: general
unspecified
Other Linux
: Normal major
: ---
Assigned To: Bruno Coudoin
Rami Aubourg-Kaires
Depends on:
Blocks:
 
 
Reported: 2011-10-01 13:47 UTC by Claude Paroz
Modified: 2011-10-02 15:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix i18n of louis-braille activity (4.96 KB, patch)
2011-10-01 14:45 UTC, Claude Paroz
none Details | Review

Description Claude Paroz 2011-10-01 13:47:57 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):
  • File "/opt/gnome/share/gcompris/python/louis_braille.py", line 266 in next_event
    self.refresh_level()
  • File "/opt/gnome/share/gcompris/python/louis_braille.py", line 249 in refresh_level
    self.display_image()
  • File "/opt/gnome/share/gcompris/python/louis_braille.py", line 222 in display_image
    story = self.dataset.get( str(self.gcomprisBoard.level), _("story") )
  • File "/usr/lib/python2.7/ConfigParser.py", line 332 in get
    raise NoOptionError(option, section)
ConfigParser.NoOptionError: No option 'histoire' in section: '3'

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?
Comment 1 Claude Paroz 2011-10-01 14:31:24 UTC
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...
Comment 2 Claude Paroz 2011-10-01 14:45:17 UTC
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.
Comment 3 Bruno Coudoin 2011-10-01 15:00:16 UTC
Thanks a lot Claude, your patch is applied.
Comment 4 Claude Paroz 2011-10-01 15:23:05 UTC
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.
Comment 5 Bruno Coudoin 2011-10-02 15:33:32 UTC
Fixed in commit 530afeb