Python: get OS language
Question: 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?


Answer: This is the documentation related to the
**[locale](http://www.python.org/doc//current/library/locale.html)** 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').
    

