Localized month names?

Kent Johnson kent at kentsjohnson.com
Tue Mar 14 14:29:26 CET 2006


Peter Otten wrote:
> Sibylle Koczian wrote:
>>What did you leave out? 
> 
> 
> Nothing, most likely.
> 
> 
>>I get 
>>
>>Traceback (most recent call last):
>>  File "<pyshell#3>", line 1, in -toplevel-
>>    locale.nl_langinfo(locale.MON_1)
>>AttributeError: 'module' object has no attribute 'nl_langinfo'
>>
>>(Python 2.4, german Windows XP Pro)
>>
>>Moreover, 'January' is probably not localized.
> 
> 
> Python 2.4.2 (#4, Nov 19 2005, 13:25:59)
> [GCC 3.3.3 (SuSE Linux)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> 
>>>>import locale
>>>>locale.nl_langinfo(locale.MON_1)

 From the docs:
nl_langinfo(  	option)

     Return some locale-specific information as a string. This function 
is not available on all systems, and the set of possible options might 
also vary across platforms.

It doesn't seem to be available on Windows:
Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.

In [1]: import locale

In [2]: locale.nl_langinfo(locale.MON_1)
------------------------------------------------------------
Traceback (most recent call last):
   File "<ipython console>", line 1, in ?
AttributeError: 'module' object has no attribute 'nl_langinfo'

Kent



More information about the Python-list mailing list