I am trying to create dictionaries containing dates that can be set in specific locales. For example, I might need to return my function when called with en_US as an argument:
{'date': 'May 12, 2014', ...}
And this is when called with hu_HU:
{'date': '2014. mรกjus 12.', ...}
Now, based on what I have found so far, I have to use locale.setlocale() to set the locale I want to use, and locale.nl_langinfo(locale.D_FMT) to get the appropriate date format. I could call locale.resetlocale() after that to return to the previously used one, but my program uses several threads, and I believe that others will be affected by this temporary change of locale.
source share