GNU gettext utilities: Top
From Get docs
Gettext/docs/latest/index
GNU gettext utilities
Table of Contents
- 1 Introduction
- 2 The User’s View
- 3 The Format of PO Files
- 4 Preparing Program Sources
- 4.1 Importing the
gettext
declaration - 4.2 Triggering
gettext
Operations - 4.3 Preparing Translatable Strings
- 4.4 How Marks Appear in Sources
- 4.5 Marking Translatable Strings
- 4.6 Special Comments preceding Keywords
- 4.7 Special Cases of Translatable Strings
- 4.8 Letting Users Report Translation Bugs
- 4.9 Marking Proper Names for Translation
- 4.10 Preparing Library Sources
- 4.1 Importing the
- 5 Making the PO Template File
- 6 Creating a New PO File
- 7 Updating Existing PO Files
- 8 Editing PO Files
- 8.1 KDE’s PO File Editor
- 8.2 GNOME’s PO File Editor
- 8.3 Emacs’s PO File Editor
- 8.3.1 Completing GNU
gettext
Installation - 8.3.2 Main PO mode Commands
- 8.3.3 Entry Positioning
- 8.3.4 Normalizing Strings in Entries
- 8.3.5 Translated Entries
- 8.3.6 Fuzzy Entries
- 8.3.7 Untranslated Entries
- 8.3.8 Obsolete Entries
- 8.3.9 Modifying Translations
- 8.3.10 Modifying Comments
- 8.3.11 Details of Sub Edition
- 8.3.12 C Sources Context
- 8.3.13 Consulting Auxiliary PO Files
- 8.3.1 Completing GNU
- 8.4 Using Translation Compendia
- 9 Manipulating PO Files
- 9.1 Invoking the
msgcat
Program - 9.2 Invoking the
msgconv
Program - 9.3 Invoking the
msggrep
Program - 9.4 Invoking the
msgfilter
Program - 9.5 Invoking the
msguniq
Program - 9.6 Invoking the
msgcomm
Program - 9.7 Invoking the
msgcmp
Program - 9.8 Invoking the
msgattrib
Program - 9.9 Invoking the
msgen
Program - 9.10 Invoking the
msgexec
Program - 9.11 Highlighting parts of PO files
- 9.12 Other tools for manipulating PO files
- 9.13 Writing your own programs that process PO files
- 9.1 Invoking the
- 10 Producing Binary MO Files
- 10.1 Invoking the
msgfmt
Program- 10.1.1 Input file location
- 10.1.2 Operation mode
- 10.1.3 Output file location
- 10.1.4 Output file location in Java mode
- 10.1.5 Output file location in C# mode
- 10.1.6 Output file location in Tcl mode
- 10.1.7 Desktop Entry mode operations
- 10.1.8 XML mode operations
- 10.1.9 Input file syntax
- 10.1.10 Input file interpretation
- 10.1.11 Output details
- 10.1.12 Informative output
- 10.2 Invoking the
msgunfmt
Program - 10.3 The Format of GNU MO Files
- 10.1 Invoking the
- 11 The Programmer’s View
- 12 The Translator’s View
- 13 The Maintainer’s View
- 13.1 Flat or Non-Flat Directory Structures
- 13.2 Prerequisite Works
- 13.3 Invoking the
gettextize
Program - 13.4 Files You Must Create or Alter
- 13.4.1
POTFILES.in
inpo/
- 13.4.2
LINGUAS
inpo/
- 13.4.3
Makevars
inpo/
- 13.4.4 Extending
Makefile
inpo/
- 13.4.5
configure.ac
at top level - 13.4.6
config.guess
,config.sub
at top level - 13.4.7
mkinstalldirs
at top level - 13.4.8
aclocal.m4
at top level - 13.4.9
config.h.in
at top level - 13.4.10
Makefile.in
at top level - 13.4.11
Makefile.in
insrc/
- 13.4.12
gettext.h
inlib/
- 13.4.1
- 13.5 Autoconf macros for use in
configure.ac
- 13.6 Integrating with Version Control Systems
- 13.7 Creating a Distribution Tarball
- 14 The Installer’s and Distributor’s View
- 15 Other Programming Languages
- 15.1 The Language Implementor’s View
- 15.2 The Programmer’s View
- 15.3 The Translator’s View
- 15.3.1 C Format Strings
- 15.3.2 Objective C Format Strings
- 15.3.3 Python Format Strings
- 15.3.4 Java Format Strings
- 15.3.5 C# Format Strings
- 15.3.6 JavaScript Format Strings
- 15.3.7 Scheme Format Strings
- 15.3.8 Lisp Format Strings
- 15.3.9 Emacs Lisp Format Strings
- 15.3.10 librep Format Strings
- 15.3.11 Ruby Format Strings
- 15.3.12 Shell Format Strings
- 15.3.13 awk Format Strings
- 15.3.14 Lua Format Strings
- 15.3.15 Object Pascal Format Strings
- 15.3.16 Smalltalk Format Strings
- 15.3.17 Qt Format Strings
- 15.3.18 Qt Format Strings
- 15.3.19 KDE Format Strings
- 15.3.20 KUIT Format Strings
- 15.3.21 Boost Format Strings
- 15.3.22 Tcl Format Strings
- 15.3.23 Perl Format Strings
- 15.3.24 PHP Format Strings
- 15.3.25 GCC internal Format Strings
- 15.3.26 GFC internal Format Strings
- 15.3.27 YCP Format Strings
- 15.4 The Maintainer’s View
- 15.5 Individual Programming Languages
- 15.5.1 C, C++, Objective C
- 15.5.2 Python
- 15.5.3 Java
- 15.5.4 C#
- 15.5.5 JavaScript
- 15.5.6 GNU guile - Scheme
- 15.5.7 GNU clisp - Common Lisp
- 15.5.8 GNU clisp C sources
- 15.5.9 Emacs Lisp
- 15.5.10 librep
- 15.5.11 Ruby
- 15.5.12 sh - Shell Script
- 15.5.12.1 Preparing Shell Scripts for Internationalization
- 15.5.12.2 Contents of
gettext.sh
- 15.5.12.3 Invoking the
gettext
program - 15.5.12.4 Invoking the
ngettext
program - 15.5.12.5 Invoking the
envsubst
program - 15.5.12.6 Invoking the
eval_gettext
function - 15.5.12.7 Invoking the
eval_ngettext
function - 15.5.12.8 Invoking the
eval_pgettext
function - 15.5.12.9 Invoking the
eval_npgettext
function
- 15.5.13 bash - Bourne-Again Shell Script
- 15.5.14 GNU awk
- 15.5.15 Lua
- 15.5.16 Pascal - Free Pascal Compiler
- 15.5.17 GNU Smalltalk
- 15.5.18 Vala
- 15.5.19 wxWidgets library
- 15.5.20 Tcl - Tk’s scripting language
- 15.5.21 Perl
- 15.5.21.1 General Problems Parsing Perl Code
- 15.5.21.2 Which keywords will xgettext look for?
- 15.5.21.3 How to Extract Hash Keys
- 15.5.21.4 What are Strings And Quote-like Expressions?
- 15.5.21.5 Invalid Uses Of String Interpolation
- 15.5.21.6 Valid Uses Of String Interpolation
- 15.5.21.7 When To Use Parentheses
- 15.5.21.8 How To Grok with Long Lines
- 15.5.21.9 Bugs, Pitfalls, And Things That Do Not Work
- 15.5.22 PHP Hypertext Preprocessor
- 15.5.23 Pike
- 15.5.24 GNU Compiler Collection sources
- 15.5.25 YCP - YaST2 scripting language
- 16 Other Data Formats
- 16.1 Internationalizable Data Formats
- 16.2 Localized Data Formats
- 17 Concluding Remarks
- Appendix A Language Codes
- Appendix B Country Codes
- Appendix C Licenses
- Program Index
- Option Index
- Variable Index
- PO Mode Index
- Autoconf Macro Index
- General Index
Next: Introduction, Up: (dir) [Contents][Index]
GNU gettext utilities
This manual documents the GNU gettext tools and the GNU libintl library, version 0.21.
• 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 | |
• Data Formats: | Other Data Formats | |
• Conclusion: | Concluding Remarks | |
• Language Codes: | ISO 639 language codes | |
• Country Codes: | ISO 3166 country codes | |
• Licenses: | Licenses | |
• 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 | |
— The Detailed Node Listing — Introduction |
||
• 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
| |
The User’s View |
||
• 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 | |
• Working in a Windows console: | Obtaining good output in a Windows console | |
• Installing Localizations: | How to Install Additional Translations | |
Setting the Locale through Environment Variables |
||
• 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 | |
Preparing Program Sources |
||
• 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 | |
Making the PO Template File |
||
• xgettext Invocation: | Invoking the xgettext Program
| |
Creating a New PO File |
||
• msginit Invocation: | Invoking the msginit Program
| |
• Header Entry: | Filling in the Header Entry | |
Updating Existing PO Files |
||
• msgmerge Invocation: | Invoking the msgmerge Program
| |
Editing PO Files |
||
• KBabel: | KDE’s PO File Editor | |
• Gtranslator: | GNOME’s PO File Editor | |
• PO Mode: | Emacs’s PO File Editor | |
• Compendium: | Using Translation Compendia | |
Emacs’s PO File Editor |
||
• 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 | |
Using Translation Compendia |
||
• Creating Compendia: | Merging translations for later use | |
• Using Compendia: | Using older translations if they fit | |
Manipulating PO Files |
||
• 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 | |
• Other tools: | Other tools for manipulating PO files | |
• libgettextpo: | Writing your own programs that process PO files | |
Highlighting parts of PO files |
||
• 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
| |
Producing Binary MO Files |
||
• msgfmt Invocation: | Invoking the msgfmt Program
| |
• msgunfmt Invocation: | Invoking the msgunfmt Program
| |
• MO Files: | The Format of GNU MO Files | |
The Programmer’s View |
||
• 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 | |
About catgets |
||
• Interface to catgets: | The interface | |
• Problems with catgets: | Problems with the catgets interface?!
| |
About gettext |
||
• 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 | |
Temporary Notes for the Programmers Chapter |
||
• Temp Implementations: | Temporary - Two Possible Implementations | |
• Temp catgets: | Temporary - About catgets
| |
• Temp WSI: | Temporary - Why a single implementation | |
• Temp Notes: | Temporary - Notes | |
The Translator’s View |
||
• 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 | |
Organization |
||
• Central Coordination: | Central Coordination | |
• National Teams: | National Teams | |
• Mailing Lists: | Mailing Lists | |
National Teams |
||
• Sub-Cultures: | Sub-Cultures | |
• Organizational Ideas: | Organizational Ideas | |
The Maintainer’s View |
||
• 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 | |
Files You Must Create or Alter |
||
• 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
| |
• 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/
| |
Autoconf macros for use in configure.ac |
||
• 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_PO_SUBDIRS: | AM_PO_SUBDIRS in po.m4
| |
• AM_XGETTEXT_OPTION: | AM_XGETTEXT_OPTION in po.m4
| |
• AM_ICONV: | AM_ICONV in iconv.m4
| |
Integrating with Version Control Systems |
||
• 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
| |
Other Programming Languages |
||
• 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 | |
The Translator’s View |
||
• c-format: | C Format Strings | |
• objc-format: | Objective C Format Strings | |
• python-format: | Python Format Strings | |
• java-format: | Java Format Strings | |
• csharp-format: | C# Format Strings | |
• javascript-format: | JavaScript Format Strings | |
• scheme-format: | Scheme Format Strings | |
• lisp-format: | Lisp Format Strings | |
• elisp-format: | Emacs Lisp Format Strings | |
• librep-format: | librep Format Strings | |
• ruby-format: | Ruby Format Strings | |
• sh-format: | Shell Format Strings | |
• awk-format: | awk Format Strings | |
• lua-format: | Lua Format Strings | |
• object-pascal-format: | Object Pascal Format Strings | |
• smalltalk-format: | Smalltalk Format Strings | |
• qt-format: | Qt Format Strings | |
• qt-plural-format: | Qt Plural Format Strings | |
• kde-format: | KDE Format Strings | |
• kde-kuit-format: | KUIT Format Strings | |
• boost-format: | Boost 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 | |
• ycp-format: | YCP Format Strings | |
Individual Programming Languages |
||
• C: | C, C++, Objective C | |
• Python: | Python | |
• Java: | Java | |
• C#: | C# | |
• JavaScript: | JavaScript | |
• Scheme: | GNU guile - Scheme | |
• Common Lisp: | GNU clisp - Common Lisp | |
• clisp C: | GNU clisp C sources | |
• Emacs Lisp: | Emacs Lisp | |
• librep: | librep | |
• Ruby: | Ruby | |
• sh: | sh - Shell Script | |
• bash: | bash - Bourne-Again Shell Script | |
• gawk: | GNU awk | |
• Lua: | Lua | |
• Pascal: | Pascal - Free Pascal Compiler | |
• Smalltalk: | GNU Smalltalk | |
• Vala: | Vala | |
• wxWidgets: | wxWidgets library | |
• Tcl: | Tcl - Tk’s scripting language | |
• Perl: | Perl | |
• PHP: | PHP Hypertext Preprocessor | |
• Pike: | Pike | |
• GCC-source: | GNU Compiler Collection sources | |
• YCP: | YCP - YaST2 scripting language | |
sh - Shell Script |
||
• 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
| |
• eval_pgettext Invocation: | Invoking the eval_pgettext function
| |
• eval_npgettext Invocation: | Invoking the eval_npgettext function
| |
Perl |
||
• 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 | |
Other Data Formats |
||
• Internationalizable Data: | Internationalizable Data Formats | |
• Localized Data: | Localized Data Formats | |
Internationalizable Data Formats |
||
• 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 | |
Localized Data Formats |
||
• Editable Message Catalogs: | Editable Message Catalogs | |
• Compiled Message Catalogs: | Compiled Message Catalogs | |
• Desktop Entry: | Desktop Entry files | |
• XML: | XML files | |
Editable Message Catalogs |
||
• PO: | PO - Portable Object | |
• Java .properties: | Java .properties | |
• GNUstep .strings: | NeXTstep/GNUstep .strings | |
Compiled Message Catalogs |
||
• MO: | MO - Machine Object | |
• Java ResourceBundle: | Java ResourceBundle | |
• C# Satellite Assembly: | C# Satellite Assembly | |
• C# Resource: | C# Resource | |
• Tcl message catalog: | Tcl message catalog | |
• Qt message catalog: | Qt message catalog | |
Concluding Remarks |
||
• History: | History of GNU gettext
| |
• The original ABOUT-NLS: | Historical introduction | |
• References: | Related Readings | |
Language Codes |
||
• Usual Language Codes: | Two-letter ISO 639 language codes | |
• Rare Language Codes: | Three-letter ISO 639 language codes | |
Licenses |
||
• GNU GPL: | GNU General Public License | |
• GNU LGPL: | GNU Lesser General Public License | |
• GNU FDL: | GNU Free Documentation License | |
Next: Introduction, Up: (dir) [Contents][Index]