This document is for an old version of Python that is no longer supported. You should upgrade and read the Python 当前稳定版本的文档.

# 22. 国际化

本章中介绍的模块通过提供选择要在程序信息中使用的语言的机制或通过定制输出以匹配本地约定来帮助你编写不依赖于语言和区域设置的软件。

本章中描述的模块列表是：

- 22.1. `gettext` — 多语种国际化服务
  - 22.1.1. GNU gettext API
  - 22.1.2. Class-based API
    - 22.1.2.1. The `NullTranslations` class
    - 22.1.2.2. The `GNUTranslations` class
    - 22.1.2.3. Solaris message catalog support
    - 22.1.2.4. The Catalog constructor
  - 22.1.3. Internationalizing your programs and modules
    - 22.1.3.1. Localizing your module
    - 22.1.3.2. Localizing your application
    - 22.1.3.3. Changing languages on the fly
    - 22.1.3.4. Deferred translations
    - 22.1.3.5. `gettext()` vs. `lgettext()`
  - 22.1.4. 致谢
- 22.2. `locale` — 国际化服务
  - 22.2.1. Background, details, hints, tips and caveats
  - 22.2.2. For extension writers and programs that embed Python
  - 22.2.3. Access to message catalogs