Re: Setting my Locale

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gabriel Genellina

    Re: Setting my Locale

    En Tue, 26 Aug 2008 07:52:21 -0300, Robert Rawlins
    <robert.rawlins @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.setlocal e(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.setlocal e(locale.LC_ALL , 'de_DE')
    >
    File "/usr/lib/python2.5/locale.py", line 478, in setlocale
    >
    return _setlocale(cate gory, 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.setlocal e(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

Working...