Forum Archive

Month name in local language

cvp

I use matplotlib.dates.DateFormatter('%b') to display months names, hoping see them in my mother language.
But my code displays them in English.
Thus after searching, I've found the code
locale.set_locale(locale.LC_ALL, 'fr_FR')
print locale.nl_langinfo(locale.LC_MON1)

But that does not give me the hoped French "janvier" instead of the English "January"...
Thanks to help me

ccc

Does this do it?

import calendar
print([x for x in calendar.month_name])

EDIT: On second thought, perhaps locale.setlocale(locale.LC_ALL, 'fr_FR') is a no-op in Pythonista.

cvp

No, the code prints the months names in English.

locale.set_locale(locale.LC_ALL, 'fr_FR') is refused but I found it in Python general help (perhaps not for IOS, I agree)

ccc

https://forum.omz-software.com/topic/608/locale-currency-doesn-t-work

cvp

Thanks for your so quick answer.
The problem seems to be 2 years old, thus no hope.
Not vital.. (Belgium has more important problems actually)

cvp

Resolved:

ax.set_xticklabels(('...names of months in local language'))