locale.setlocale(locale.LC_ALL, 'french')
work on my local machine (windows 7 + Python 3)
locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8')
work on my other machine (Unix) but if I use this on my local machine, I have this error:
locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8')' failed: unsupported locale setting
Probing the Current Locale The most common way to let the user change the locale settings for an application is through an environment variable ( LC_ALL , LC_CTYPE , LANG , or LANGUAGE , depending on the platform). The application then calls setlocale() without a hard-coded value, and the environment value is used.
Python's locale module is part of the standard library for internationalization (i18n) and localization (l10n) in Python. The locale module allows developers to deal with certain cultural issues in their applications.
Locale settings are OS dependent and, at least on *nix systems, might even depend on whether they are installed or not.
This SO post might be a good pointer to what locales to use on Windows systems: https://stackoverflow.com/a/956084/2186184
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