wx is searching for wx.LANGUAGE_WELSH as "cy" locale

Hi,

I just installed the Welsh language pack on Ubuntu 9.04, and it's
installed to my system as "cy-GB". I'm using the following code:

locale = wx.Locale(wx.LANGUAGE_WELSH, wx.LOCALE_LOAD_DEFAULT)
path = os.path.dirname(sys.argv[0])
langdir = os.path.join(path, 'locale')

with a locale/cy/LC_MESSAGES/Whyteboard.mo file, defining the Welsh
translation

However, a message pops up saying locale "cy" could not be found -- is
this because of the -GB extension Ubuntu added?
I'm not sure how I'd go about changing the locale string that wx is
searching for since I'm passing in a constant, with the value of 223.
How do I overcome this?

Python 2.6.3 / wx 2.8.10.1/ Linux ubuntu 2.6.28-15-generic #52-Ubuntu
SMP Wed Sep 9 10:48:52 UTC 2009 x86_64 GNU/Linux

Regards

Does this work?

  locale = wx.Locale()
  locale.Init("MyLocale", "cy", "cy_GB")

···

On 10/8/09 8:47 PM, Steven Sproat wrote:

Hi,

I just installed the Welsh language pack on Ubuntu 9.04, and it's
installed to my system as "cy-GB". I'm using the following code:

locale = wx.Locale(wx.LANGUAGE_WELSH, wx.LOCALE_LOAD_DEFAULT)
path = os.path.dirname(sys.argv[0])
langdir = os.path.join(path, 'locale')

with a locale/cy/LC_MESSAGES/Whyteboard.mo file, defining the Welsh
translation

However, a message pops up saying locale "cy" could not be found -- is
this because of the -GB extension Ubuntu added?
I'm not sure how I'd go about changing the locale string that wx is
searching for since I'm passing in a constant, with the value of 223.
How do I overcome this?

--
Robin Dunn
Software Craftsman

Robin Dunn wrote:

···

On 10/8/09 8:47 PM, Steven Sproat wrote:
  

Hi,

I just installed the Welsh language pack on Ubuntu 9.04, and it's
installed to my system as "cy-GB". I'm using the following code:

locale = wx.Locale(wx.LANGUAGE_WELSH, wx.LOCALE_LOAD_DEFAULT)
path = os.path.dirname(sys.argv[0])
langdir = os.path.join(path, 'locale')

with a locale/cy/LC_MESSAGES/Whyteboard.mo file, defining the Welsh
translation

However, a message pops up saying locale "cy" could not be found -- is
this because of the -GB extension Ubuntu added?
I'm not sure how I'd go about changing the locale string that wx is
searching for since I'm passing in a constant, with the value of 223.
How do I overcome this?
    
Does this work?

  locale = wx.Locale()
  locale.Init("MyLocale", "cy", "cy_GB")

ah yes, it does! Excellent! You mentioned earlier in IRC to set an
environment variable, but this should be better for cross-platform usage.
Thanks very much Rob :slight_smile: