O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

gettext

The gettext module provides an interface to the GNU gettext library, which is used to provide support for internationalization (i18n). The primary use of gettext is to provide translation of selected program text in a way that’s easy to extend and that’s mostly transparent to the programmer. For example, if you’re writing a program that prompts a user for a password, you might want it to print password in English, passwort in German, contraseña in Spanish, and so forth.

gettext works by making simple string substitutions of selected program text. To do this, it consults a specially constructed locale database that contains mappings of the original program text to translated versions in various languages. This database is application-specific ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required