Python Internationalization
Table of Contents

Python ensures that software can be developed that is independent of language and locale by providing mechanisms for selecting a language to be used in program messages or by tailoring output to match local conventions.


The gettext module provides internationalization (I18N) and localization (L10N) services for your Python modules and applications.


The locale module opens access to the POSIX locale database and functionality. The POSIX locale mechanism allows programmers to deal with certain cultural issues in an application, without requiring the programmer to know all the specifics of each country where the software is executed.


setlocale(category[, locale])

If locale is specified, it may be a string, a tuple of the form (language code, encoding), or None. If it is a tuple, it is converted to a string using the locale aliasing engine. If locale is given and not None, setlocale() modifies the locale setting for the category.

More information in the Python documentation.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.