By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,767 Members | 1,310 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,767 IT Pros & Developers. It's quick & easy.

Internationalisation (i8n) of messages

P: n/a
I've just externalised the messages in my program and was thinking
about internationalisation.

I could probably translate my messages to French and German, and a
friend could do Spanish. I was also thinking of date formats - as a
Brit, I can't get used to the awful American MM/DD/YY format ;o) I
don't think I'll be needing currency or decimal (. or ,) info.

I was basically thinking of doing something like:

import locale
self.locale_array = locale.getlocale()
self.language = self.locale_array[0]

if self.language == "en_GB":
self.dateformat = "DD/MM/YYYY"
elif self.language == "de_DE":
self.dateformat = "DD-MM-YYYY"
else:
self.dateformat = "MM/DD/YY"

So if getlocale returns None, None (like on my Sparc) then it defaults
to US English, otherwise it does UK English or German.

The problem is that the languages I've come across seem to differ
widely between Solaris/py2.3.2, Linux/py2.2.2 and Windows/py2.3.3 (all
I've tested), I was thinking of doing a case-insensitive grep, but
that seems hacky.

The Python 2.3 locale documentation seems crappy, just a bit of info
about POSIX locale.

Any ideas of how I can do this or better documentation URLs? I'm using
wxPython for my GUI, in case that provides some i8n support....?
Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.