What is a way to get current Windows (or OSX) Locale id on Python 2.x. I want to get an int (or str) which tells what language in OS is active.
Is possible without using WinAPI?
This is the documentation related to the locale module in Python 2.6.
To be more specific, here is an example (from the above link) of how to get your system's locale:
import locale
loc = locale.getlocale() # get current locale
locale.getdefaultlocale() # Tries to determine the default locale settings and returns them as a tuple of the form (language code, encoding); e.g, ('en_US', 'UTF-8').
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With