473,408 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

using locales


Is there some sort of tutorial on locales or the locale module?

I can't seem to find a list showing all possible locales. I made 'en'
work alright, but when I tried 'de' or 'de_DE' or 'es_ES', etc. it said
that those were not valid locaes. Worst of all, when I tried 'es' it
said that this was estonian?! Obviously, this is not what ISO 639 says.
'es' should be Spanish, and Estonian should be 'et.

Anyway, I'd love to have a method called get_available_locales to tell
me what I can use on my machine, or something like that.

Can anyone tell me how I *do* get these names?

Thanks

Jul 19 '05 #1
2 1730
> Is there some sort of tutorial on locales or the locale module?

I can't seem to find a list showing all possible locales.
I think this depends on the platform
Anyway, I'd love to have a method called get_available_locales to tell
me what I can use on my machine, or something like that.

Can anyone tell me how I *do* get these names?


In linux (glibc) you can see all locales with "locale -a".
--
damjan
Jul 19 '05 #2

<ga******@hotmail.com> schrieb im Newsbeitrag
news:11*********************@l41g2000cwc.googlegro ups.com...
|
| Is there some sort of tutorial on locales or the locale module?
|
| I can't seem to find a list showing all possible locales. I made 'en'
| work alright, but when I tried 'de' or 'de_DE' or 'es_ES', etc. it said
| that those were not valid locaes. Worst of all, when I tried 'es' it
| said that this was estonian?! Obviously, this is not what ISO 639 says.
| 'es' should be Spanish, and Estonian should be 'et.

What makes you think that the underlying C-runtime library cares about
ISO639? If you're on Windows (which from what you've written I assume you
are), you might want to look at:

http://msdn.microsoft.com/library/de...ge_strings.asp

(Unfortunately, I know for a fact that this list is *not* exhaustive, at
least not for WIN2K or XP.)

In addition, you might want to keep in mind - and again this applies to the
Windows platform - that what is returned by locale.getdefaultlocale is not
suitable as input for the the country/language argument of locale.setlocale
(which is somewhat of a pitty, cause I sometimes wish I could do something
like "locale.setlocale(locale.LC_ALL,
".".join(locale.getdefaultlocale())" ).

However, if you really need super-deluxe localization/national language
support independent of the C runtime on Windows you may need to wrap the
appropriate functions living in winnls.h (or the version of winnls.h
contained in the platform SDK) - some of which may have already found there
way into the Python for Win32 Extensions (GetDateFormat for example).
Regards,

--

Vincent Wehren

|
| Anyway, I'd love to have a method called get_available_locales to tell
| me what I can use on my machine, or something like that.
|
| Can anyone tell me how I *do* get these names?
|
| Thanks
|
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Alexander Gräf | last post by:
Hello, I'm stuck with a simple problem, for which I don't have a solution. I basically have an XML file containing fragments of plain text and html, in several languages: <?xml version="1.0"...
3
by: Joshua Stewart | last post by:
Hi, I am trying to characterise a problem I am seeing on our C#/C++ xml driven application. We have recently added some basic Spanish language support to our application, but it seems that there...
0
by: | last post by:
Hi all, running the following code as an console application: #include <locale> #include <iostream> #include <sstream> #include <tchar.h> using namespace std;
8
by: Rik | last post by:
Hi all, is there a in PHP to get the available locales without shellacces (i.e. locale -a)? Grtz, -- Rik Wasmus
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.