Generated by GPT-5-mini| gettext | |
|---|---|
| Name | gettext |
| Author | Richard Stallman |
| Developer | Free Software Foundation |
| Released | 1995 |
| Operating system | Unix-like, Microsoft Windows |
| License | GNU General Public License |
gettext gettext is a widely used internationalization and localization system originating in the GNU project that provides runtime message translation, message extraction, and locale management for software. It integrates with build systems and runtime environments to map program strings to translated equivalents and is used across many open source and proprietary projects for supporting multiple natural languages. The system influenced and interoperates with other localization initiatives and libraries in diverse ecosystems.
The technology emerged within the GNU Project in the context of efforts by Richard Stallman and contributors at the Free Software Foundation to internationalize software during the 1990s. Early adoption occurred in GNU Emacs, GCC, and other flagship GNU Project packages, while portability work extended support to Unix variants, Linux, and later Microsoft Windows through ports and wrappers. Over time, the approach spread to distributions such as Debian and Red Hat Enterprise Linux and was referenced in standards discussions at organizations like POSIX working groups. Collaborations with projects such as KDE and GNOME led to integration points in desktop environments and toolchains maintained by entities like Freedesktop.org.
The system centers on runtime lookup of translatable strings and compile-time tooling to extract messages from source code. It provides APIs typically consumed via C functions and language bindings used in projects like Python’s CPython, Perl implementations, and bindings for Ruby, PHP, and JavaScript runtimes hosted by projects such as Node.js. Locale data interact with system-level locale configurations on platforms like GNU/Linux distributions and macOS internationalization layers. Key mechanisms include message catalogs, context markers, and plural forms configured per-language with rules informed by standards such as those from ISO and linguistic resources curated by communities including Unicode Consortium contributors.
Besides the original implementation maintained by the Free Software Foundation, multiple reimplementations and wrappers exist to serve language ecosystems and platform constraints. Notable projects include lib implementations used by Glibc-based systems, language-specific bindings in CPython’s standard library, and portability layers in projects like Cygwin and MinGW for Microsoft Windows support. Commercial and open source toolchains such as those from Canonical and SUSE integrate related tooling into package builds; desktop suites like LibreOffice and OpenOffice.org rely on compatible libraries for UI translation. Toolchains for mobile and web frameworks—used by organizations like Mozilla and Google—offer converters and bridges between catalog formats and platform-specific resource systems.
Developers mark translatable strings in source code using API calls and extraction annotations, then run extraction utilities to produce template files used by translators from teams organized within ecosystems such as GNOME Translation Project or community efforts coordinated via platforms like Launchpad and Transifex. Translators edit message catalogs and testers integrate translated catalogs into package artifacts for distributions like Ubuntu and Fedora; continuous integration pipelines maintained by projects such as Jenkins or GitLab CI may automate validation steps. Runtime libraries load appropriate catalog files based on environment variables or platform locale settings, coordinating with configuration tools found in systemd-based distributions and desktop session managers, while packaging metadata in formats aligned with Debian Policy or RPM standards ensures deployable localization packages.
The tooling chain revolves around text-based templates and binary catalog formats that support translators and build systems. Core files include template files used by translators and compiled binary catalogs optimized for runtime lookup; utilities for conversion, merging, and validation are included in tool suites distributed with projects like gettextutils and third-party plugins maintained in repositories on hosting sites such as GitHub and GitLab. Editor integrations facilitate translation in environments like Poedit and web-based platforms used by communities such as Mozilla l10n. Build systems including Autotools and CMake provide macros and modules to incorporate extraction passes and installation rules for catalog files during package builds.
Critiques have focused on plural handling complexity across languages with diverse plural rules codified by linguistic bodies like ISO and the Unicode Consortium, the limitations of context disambiguation for ambiguous source strings in large projects such as LibreOffice and KDE, and challenges integrating with non-textual resource systems in mobile ecosystems like Android and iOS. Some communities argue for richer metadata and structured translation resources akin to those used by XLIFF or TMX standards, while others note difficulties in scaling collaborative workflows without centralized services exemplified by platforms like Crowdin and Transifex. Performance and binary catalog caching strategies have prompted alternative approaches in projects driven by organizations including Google and Mozilla.
Category:Localization