wx stock labels not translated

Bug #346708 reported by Karel Kolman
2
Affects Status Importance Assigned to Milestone
wxBanker
Fix Released
Medium
Michael Rooney

Bug Description

Running wx banker with the russian locale/language, the "&Save" menu item in the File menu is not translated.
The locale has to be initialized for wx as well, see the attached patch (not really meant to be applied to the tree, only to show what could be done to fix it)

Have you considered reusing some of the wx translations ? For example replacing

self.Append(fileMenu, _("&File"))
with
self.Append(fileMenu, wx.GetStockLabel(wx.ID_FILE))

though i'm not sure how up-to-date are the wx translations files (the czech one certainly isn't).

Related branches

Revision history for this message
Karel Kolman (kolmis) wrote :
Revision history for this message
Michael Rooney (mrooney) wrote :

Looking at this bug again, I'm wondering if the solution should be to use wx translations, or just not use stock labels and have them be translated in wxBanker, as I think Ubuntu translators can do a better and more up-to-date job.

I think the "Save" issue was fixed by not using a stock label? Assuming there aren't any stock labels and thus untranslatable strings left, what do you think of closing this bug as a result?

Changed in wxbanker:
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Karel Kolman (kolmis) wrote :

Now i see that my bug report is very unclear and also mixing different issues. What I wanted to report originally was this:

If I run wxbanker
- logged in with russian locale
- with the "--lang=RU" option
- or the "LC_ALL=ru_RU.utf8" variable set

the Save item menu produced by the following code:

self.saveMenuItem = fileMenu.Append(wx.ID_SAVE)

is not translated.
My observation is that an internationalized WX app NEEDS to be told to use the locale in all three cases - see the last line of the proposed patch. (One also has to have wx-i18n package installed).

The 0.6 branch stil has the "Save" untranslated, since the menu item is appended without _("Save") translation.

I'm not sure you can completely rely on not using wx stock translations, since they may pop up here and there, in dialogs, etc.
Therefore i suggest setting the locale. Ignoring the --lang wxbanker option, the important statement is

l = wx.Locale(wx.LANGUAGE_DEFAULT)

Revision history for this message
Karel Kolman (kolmis) wrote :

BTW the locales don't work when trying to load them from the src directory

localization.py
- DIR = os.path.join(os.path.dirname(__file__), 'locale')
+ DIR = os.path.join(os.path.dirname(__file__), '../locale')

Revision history for this message
Michael Rooney (mrooney) wrote :

Ah yes, that is clear indeed, thanks!

Changed in wxbanker:
assignee: nobody → Michael Rooney (mrooney)
importance: Low → Medium
milestone: none → 0.7
status: Incomplete → Triaged
Revision history for this message
Michael Rooney (mrooney) wrote :

Okay, this is working for me after pushing r426, give it a shot!

In my case it required installing "wx2.8-i18n", so I guess I should add this to the package's "Suggests" field? I could recommend it, though it seems silly to pull this in for everything, although it is only around 900K, and I'm not sure people who could use it would realize to install it, unless it somehow gets installed when installing wx if you are on a non en_US locale. Any opinions?

Changed in wxbanker:
status: Triaged → Fix Committed
Revision history for this message
Karel Kolman (kolmis) wrote :

the commited code works fine.

still, the "Save" menu item remains untranslated in czech, because it's missing from the czech wx translations files, but that's another story...

Michael Rooney (mrooney)
Changed in wxbanker:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.