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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access