2018-03-27, 13:52
The locale string needed on windows is not the same as the one needed on linux
I got it working with "French" instead of "fr_FR"
We could use pycountry to support both format, here is a working exemple on my env :
I got it working with "French" instead of "fr_FR"
We could use pycountry to support both format, here is a working exemple on my env :
python:import os
import locale
import pycountry
import datetime
language = pycountry.languages.lookup(xbmc.getLanguage(xbmc.ISO_639_1))
if os.name == "posix":
locale.setlocale(locale.LC_ALL, language.alpha_2)
else:
locale.setlocale(locale.LC_ALL, language.name)
print(datetime.datetime.today().strftime("%A"))