1 1 GNU ‘gettext’ utilities 1 *********************** 1 1 This manual documents the GNU gettext tools and the GNU libintl 1 library, version 0.19.8.1. 1
1 · Introduction Introduction · Users The User’s View · PO Files The Format of PO Files · Sources Preparing Program Sources · Template Making the PO Template File · Creating Creating a New PO File · Updating Updating Existing PO Files · Editing Editing PO Files · Manipulating Manipulating PO Files · Binaries Producing Binary MO Files · Programmers The Programmer’s View · Translators The Translator’s View · Maintainers The Maintainer’s View · Installers The Installer’s and Distributor’s View · Programming Languages Other Programming Languages · Conclusion Concluding Remarks 1 · Language Codes ISO 639 language codes · Country Codes ISO 3166 country codes · Licenses Licenses 1 · Program Index Index of Programs · Option Index Index of Command-Line Options · Variable Index Index of Environment Variables · PO Mode Index Index of Emacs PO Mode Commands · Autoconf Macro Index Index of Autoconf Macros · Index General Index 1 1 — The Detailed Node Listing — 1 1 Introduction 1 · Why The Purpose of GNU ‘gettext’ · Concepts I18n, L10n, and Such · Aspects Aspects in Native Language Support · Files Files Conveying Translations · Overview Overview of GNU ‘gettext’ 1 1 The User’s View 1 · System Installation Questions During Operating System Installation · Setting the GUI Locale How to Specify the Locale Used by GUI Programs · Setting the POSIX Locale How to Specify the Locale According to POSIX · Installing Localizations How to Install Additional Translations 1 1 Setting the Locale through Environment Variables 1 · Locale Names How a Locale Specification Looks Like · Locale Environment Variables Which Environment Variable Specfies What · The LANGUAGE variable How to Specify a Priority List of Languages 1 1 Preparing Program Sources 1 · Importing Importing the ‘gettext’ declaration · Triggering Triggering ‘gettext’ Operations · Preparing Strings Preparing Translatable Strings · Mark Keywords How Marks Appear in Sources · Marking Marking Translatable Strings · c-format Flag Telling something about the following string · Special cases Special Cases of Translatable Strings · Bug Report Address Letting Users Report Translation Bugs · Names Marking Proper Names for Translation · Libraries Preparing Library Sources 1 1 Making the PO Template File 1 · xgettext Invocation Invoking the ‘xgettext’ Program 1 1 Creating a New PO File 1 · msginit Invocation Invoking the ‘msginit’ Program · Header Entry Filling in the Header Entry 1 1 Updating Existing PO Files 1 · msgmerge Invocation Invoking the ‘msgmerge’ Program 1 1 Editing PO Files 1 · KBabel KDE’s PO File Editor · Gtranslator GNOME’s PO File Editor · PO Mode Emacs’s PO File Editor · Compendium Using Translation Compendia 1 1 Emacs’s PO File Editor 1 · Installation Completing GNU ‘gettext’ Installation · Main PO Commands Main Commands · Entry Positioning Entry Positioning · Normalizing Normalizing Strings in Entries · Translated Entries Translated Entries · Fuzzy Entries Fuzzy Entries · Untranslated Entries Untranslated Entries · Obsolete Entries Obsolete Entries · Modifying Translations Modifying Translations · Modifying Comments Modifying Comments · Subedit Mode for Editing Translations · C Sources Context C Sources Context · Auxiliary Consulting Auxiliary PO Files 1 1 Using Translation Compendia 1 · Creating Compendia Merging translations for later use · Using Compendia Using older translations if they fit 1 1 Manipulating PO Files 1 · msgcat Invocation Invoking the ‘msgcat’ Program · msgconv Invocation Invoking the ‘msgconv’ Program · msggrep Invocation Invoking the ‘msggrep’ Program · msgfilter Invocation Invoking the ‘msgfilter’ Program · msguniq Invocation Invoking the ‘msguniq’ Program · msgcomm Invocation Invoking the ‘msgcomm’ Program · msgcmp Invocation Invoking the ‘msgcmp’ Program · msgattrib Invocation Invoking the ‘msgattrib’ Program · msgen Invocation Invoking the ‘msgen’ Program · msgexec Invocation Invoking the ‘msgexec’ Program · Colorizing Highlighting parts of PO files · libgettextpo Writing your own programs that process PO files 1 1 Highlighting parts of PO files 1 · The --color option Triggering colorized output · The TERM variable The environment variable ‘TERM’ · The --style option The ‘--style’ option · Style rules Style rules for PO files · Customizing less Customizing ‘less’ for viewing PO files 1 1 Producing Binary MO Files 1 · msgfmt Invocation Invoking the ‘msgfmt’ Program · msgunfmt Invocation Invoking the ‘msgunfmt’ Program · MO Files The Format of GNU MO Files 1 1 The Programmer’s View 1 · catgets About ‘catgets’ · gettext About ‘gettext’ · Comparison Comparing the two interfaces · Using libintl.a Using libintl.a in own programs · gettext grok Being a ‘gettext’ grok · Temp Programmers Temporary Notes for the Programmers Chapter 1 1 About ‘catgets’ 1 · Interface to catgets The interface · Problems with catgets Problems with the ‘catgets’ interface?! 1 1 About ‘gettext’ 1 · Interface to gettext The interface · Ambiguities Solving ambiguities · Locating Catalogs Locating message catalog files · Charset conversion How to request conversion to Unicode · Contexts Solving ambiguities in GUI programs · Plural forms Additional functions for handling plurals · Optimized gettext Optimization of the *gettext functions 1 1 Temporary Notes for the Programmers Chapter 1 · Temp Implementations Temporary - Two Possible Implementations · Temp catgets Temporary - About ‘catgets’ · Temp WSI Temporary - Why a single implementation · Temp Notes Temporary - Notes 1 1 The Translator’s View 1 · Trans Intro 0 Introduction 0 · Trans Intro 1 Introduction 1 · Discussions Discussions · Organization Organization · Information Flow Information Flow · Translating plural forms How to fill in ‘msgstr[0]’, ‘msgstr[1]’ · Prioritizing messages How to find which messages to translate first 1 1 Organization 1 · Central Coordination Central Coordination · National Teams National Teams · Mailing Lists Mailing Lists 1 1 National Teams 1 · Sub-Cultures Sub-Cultures · Organizational Ideas Organizational Ideas 1 1 The Maintainer’s View 1 · Flat and Non-Flat Flat or Non-Flat Directory Structures · Prerequisites Prerequisite Works · gettextize Invocation Invoking the ‘gettextize’ Program · Adjusting Files Files You Must Create or Alter · autoconf macros Autoconf macros for use in ‘configure.ac’ · Version Control Issues · Release Management Creating a Distribution Tarball 1 1 Files You Must Create or Alter 1 · po/POTFILES.in ‘POTFILES.in’ in ‘po/’ · po/LINGUAS ‘LINGUAS’ in ‘po/’ · po/Makevars ‘Makevars’ in ‘po/’ · po/Rules-* Extending ‘Makefile’ in ‘po/’ · configure.ac ‘configure.ac’ at top level · config.guess ‘config.guess’, ‘config.sub’ at top level · mkinstalldirs ‘mkinstalldirs’ at top level · aclocal ‘aclocal.m4’ at top level · acconfig ‘acconfig.h’ at top level · config.h.in ‘config.h.in’ at top level · Makefile ‘Makefile.in’ at top level · src/Makefile ‘Makefile.in’ in ‘src/’ · lib/gettext.h ‘gettext.h’ in ‘lib/’ 1 1 Autoconf macros for use in ‘configure.ac’ 1 · AM_GNU_GETTEXT AM_GNU_GETTEXT in ‘gettext.m4’ · AM_GNU_GETTEXT_VERSION AM_GNU_GETTEXT_VERSION in ‘gettext.m4’ · AM_GNU_GETTEXT_NEED AM_GNU_GETTEXT_NEED in ‘gettext.m4’ · AM_GNU_GETTEXT_INTL_SUBDIR AM_GNU_GETTEXT_INTL_SUBDIR in ‘intldir.m4’ · AM_PO_SUBDIRS AM_PO_SUBDIRS in ‘po.m4’ · AM_XGETTEXT_OPTION AM_XGETTEXT_OPTION in ‘po.m4’ · AM_ICONV AM_ICONV in ‘iconv.m4’ 1 1 Integrating with Version Control Systems 1 · Distributed Development Avoiding version mismatch in distributed development · Files under Version Control Files to put under version control · Translations under Version Control Put PO Files under Version Control · autopoint Invocation Invoking the ‘autopoint’ Program 1 1 Other Programming Languages 1 · Language Implementors The Language Implementor’s View · Programmers for other Languages The Programmer’s View · Translators for other Languages The Translator’s View · Maintainers for other Languages The Maintainer’s View · List of Programming Languages Individual Programming Languages · List of Data Formats Internationalizable Data 1 1 The Translator’s View 1 · c-format C Format Strings · objc-format Objective C Format Strings · sh-format Shell Format Strings · python-format Python Format Strings · lisp-format Lisp Format Strings · elisp-format Emacs Lisp Format Strings · librep-format librep Format Strings · scheme-format Scheme Format Strings · smalltalk-format Smalltalk Format Strings · java-format Java Format Strings · csharp-format C# Format Strings · awk-format awk Format Strings · object-pascal-format Object Pascal Format Strings · ycp-format YCP Format Strings · tcl-format Tcl Format Strings · perl-format Perl Format Strings · php-format PHP Format Strings · gcc-internal-format GCC internal Format Strings · gfc-internal-format GFC internal Format Strings · qt-format Qt Format Strings · qt-plural-format Qt Plural Format Strings · kde-format KDE Format Strings · boost-format Boost Format Strings · lua-format Lua Format Strings · javascript-format JavaScript Format Strings 1 1 Individual Programming Languages 1 · C C, C++, Objective C · sh sh - Shell Script · bash bash - Bourne-Again Shell Script · Python Python · Common Lisp GNU clisp - Common Lisp · clisp C GNU clisp C sources · Emacs Lisp Emacs Lisp · librep librep · Scheme GNU guile - Scheme · Smalltalk GNU Smalltalk · Java Java · C# C# · gawk GNU awk · Pascal Pascal - Free Pascal Compiler · wxWidgets wxWidgets library · YCP YCP - YaST2 scripting language · Tcl Tcl - Tk’s scripting language · Perl Perl · PHP PHP Hypertext Preprocessor · Pike Pike · GCC-source GNU Compiler Collection sources · Lua Lua · JavaScript JavaScript · Vala Vala 1 1 sh - Shell Script 1 · Preparing Shell Scripts Preparing Shell Scripts for Internationalization · gettext.sh Contents of ‘gettext.sh’ · gettext Invocation Invoking the ‘gettext’ program · ngettext Invocation Invoking the ‘ngettext’ program · envsubst Invocation Invoking the ‘envsubst’ program · eval_gettext Invocation Invoking the ‘eval_gettext’ function · eval_ngettext Invocation Invoking the ‘eval_ngettext’ function 1 1 Perl 1 · General Problems General Problems Parsing Perl Code · Default Keywords Which Keywords Will xgettext Look For? · Special Keywords How to Extract Hash Keys · Quote-like Expressions What are Strings And Quote-like Expressions? · Interpolation I Invalid String Interpolation · Interpolation II Valid String Interpolation · Parentheses When To Use Parentheses · Long Lines How To Grok with Long Lines · Perl Pitfalls Bugs, Pitfalls, and Things That Do Not Work 1 1 Internationalizable Data 1 · POT POT - Portable Object Template · RST Resource String Table · Glade Glade - GNOME user interface description · GSettings GSettings - GNOME user configuration schema · AppData AppData - freedesktop.org application description · Preparing ITS Rules Preparing Rules for XML Internationalization 1 1 Concluding Remarks 1 · History History of GNU ‘gettext’ · References Related Readings 1 1 Language Codes 1 · Usual Language Codes Two-letter ISO 639 language codes · Rare Language Codes Three-letter ISO 639 language codes 1 1 Licenses 1 · GNU GPL GNU General Public License · GNU LGPL GNU Lesser General Public License · GNU FDL GNU Free Documentation License 1 1