473,406 Members | 2,439 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,406 software developers and data experts.

Re: Setting my Locale

En Tue, 26 Aug 2008 07:52:21 -0300, Robert Rawlins
<ro************@thinkbluemedia.co.ukescribi�:
I'm running python 2.5 on a Debian based system and I'm looking for your
advice on how to set the locale for my application. I've read through the
locale module documentation http://docs.python.org/lib/module-locale.html
and tried a couple of the examples but can't seem to get it working.
For instance, when I attempt to run the following code:
import locale

locale.setlocale(locale.LC_ALL, 'de_DE')
I get an exception raised by the application which says:
Traceback (most recent call last):

File "locale_test.py", line 2, in <module>

locale.setlocale(locale.LC_ALL, 'de_DE')

File "/usr/lib/python2.5/locale.py", line 478, in setlocale

return _setlocale(category, locale)

locale.Error: unsupported locale setting
My questions are; what would be causing this error? Do I need any
additional
packages installed on the system for this locale support to work
properly?
Probably you don't have support for 'de_DE' locale.
Try using locale.setlocale(locale.LC_ALL, '')
and see what you get in response.
How can I get a list of available locales?
I'd like to know how to retrieve that too...

--
Gabriel Genellina

Aug 27 '08 #1
0 1041

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

Similar topics

0
by: Jim Seymour | last post by:
I have this thing I wrote called "Simple Contact Form." It's just a straight-forward contact form. (Rather than repeat myself, check out http://jimsun.linxnet.com/SCForm.html if you need to know...
4
by: Grumfish | last post by:
Is there a way to tell Java what localization to use so applications and the compiler doesn't default to the system's setting? I'm using a computer with Windows 2000 with a regional setting of...
0
by: Darren | last post by:
I used the following code on a server; <% ReturnDateTime 1033, "English (US)" ReturnDateTime 2057, "English (UK)" ReturnDateTime 3081, "English (Australia)" ReturnDateTime 1031, "German" ...
1
by: David Lee AU | last post by:
We have an ASP.NET page that displays a date without a format specifier (in order to determine to default locale setting) and the date is shown as mm/dd/yyyy. We previously were able to set the...
3
by: Torsten Bronger | last post by:
Hallöchen! I have to generate excerpts in different human languages in a program. In general, the language is not the locale's language, but set at runtime. Nevertheless, GNU's gettext should...
6
by: Troels Arvin | last post by:
Hello, In the init-script contained in the RPMs downloadable from the PostgreSQL site (I checked the one for Fedora), an explicit locale is set before running initdb. - And the explicit locale...
3
by: robert | last post by:
Why can the default locale not be set by its true name? but only by '' ? : PythonWin 2.5 (r25:51908, Sep 19 2006, 09:52:17) on win32. (None, None) Traceback (most recent call last): File...
2
by: cris | last post by:
Hi, I got trouble when I try to change the locale used in a program foo.cc // ----------------- begin #include <iostream> #include <locale> #include <exception> using namespace std; int...
1
by: Torsten Bronger | last post by:
Hallöchen! I start a python script with subprocess from another Python script with python = subprocess.Popen(, stdout=subprocess.PIPE, stderr=subprocess.PIPE) However, this child script...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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...

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.