6.23 gettext -- Multilingual internationalization services
Keywords: lib

# 6.23 `gettext` -- Multilingual internationalization services

The `gettext` module provides internationalization (I18N) and localization (L10N) services for your Python modules and applications. It supports both the GNU `gettext` message catalog API and a higher level, class-based API that may be more appropriate for Python files. The interface described below allows you to write your module and application messages in one natural language, and provide a catalog of translated messages for running under different natural languages.

Some hints on localizing your Python modules and applications are also given.

Subsections

- 6.23.1 GNU gettext API
- 6.23.2 Class-based API
  - 6.23.2.1 The `NullTranslations` class
  - 6.23.2.2 The `GNUTranslations` class
  - 6.23.2.3 Solaris message catalog support
  - 6.23.2.4 The Catalog constructor
- 6.23.3 Internationalizing your programs and modules
  - 6.23.3.1 Localizing your module
  - 6.23.3.2 Localizing your application
  - 6.23.3.3 Changing languages on the fly
  - 6.23.3.4 Deferred translations
- 6.23.4 Acknowledgements