Localized month name in Python
If you have your locale set at the OS level,
locale.set_locale(locale.LC_ALL, '')
print locale.nl_langinfo(locale.LC_MON1)
"janvier"
Or you can set it at python level:
locale.set_locale(locale.LC_ALL, 'fr_FR')
print locale.nl_langinfo(locale.LC_MON1)
"janvier"
If you only wan't it to affect the datetime function try this:
def getLocalizedMonth(j):
locale.setlocale(locale.LC_ALL, "")
datetime.datetime.strptime(j, "%m").strftime("%B")
locale.setlocale(locale.getdefaultlocale())
And yes I think using the locale.setlocale is the best solution!