Gettext/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
gettextdeclaration - 4.2 Triggering
gettextOperations - 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
gettextInstallation - 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
msgcatProgram - 9.2 Invoking the
msgconvProgram - 9.3 Invoking the
msggrepProgram - 9.4 Invoking the
msgfilterProgram - 9.5 Invoking the
msguniqProgram - 9.6 Invoking the
msgcommProgram - 9.7 Invoking the
msgcmpProgram - 9.8 Invoking the
msgattribProgram - 9.9 Invoking the
msgenProgram - 9.10 Invoking the
msgexecProgram - 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
msgfmtProgram- 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
msgunfmtProgram - 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
gettextizeProgram - 13.4 Files You Must Create or Alter
- 13.4.1
POTFILES.ininpo/ - 13.4.2
LINGUASinpo/ - 13.4.3
Makevarsinpo/ - 13.4.4 Extending
Makefileinpo/ - 13.4.5
configure.acat top level - 13.4.6
config.guess,config.subat top level - 13.4.7
mkinstalldirsat top level - 13.4.8
aclocal.m4at top level - 13.4.9
config.h.inat top level - 13.4.10
Makefile.inat top level - 13.4.11
Makefile.ininsrc/ - 13.4.12
gettext.hinlib/
- 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
gettextprogram - 15.5.12.4 Invoking the
ngettextprogram - 15.5.12.5 Invoking the
envsubstprogram - 15.5.12.6 Invoking the
eval_gettextfunction - 15.5.12.7 Invoking the
eval_ngettextfunction - 15.5.12.8 Invoking the
eval_pgettextfunction - 15.5.12.9 Invoking the
eval_npgettextfunction
- 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
Other Programming Languages
• Data Formats:
Other Data Formats
• Conclusion:
Concluding Remarks
ISO 639 language codes
ISO 3166 country codes
• Licenses:
Licenses
Index of Programs
• Option Index:
Index of Command-Line Options
Index of Environment Variables
Index of Emacs PO Mode Commands
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
Questions During Operating System Installation
How to Specify the Locale Used by GUI Programs
How to Specify the Locale According to POSIX
• Working in a Windows console:
Obtaining good output in a Windows console
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
How to Specify a Priority List of Languages
Preparing Program Sources
• Importing:
Importing the gettext declaration
• Triggering:
Triggering gettext Operations
Preparing Translatable Strings
How Marks Appear in Sources
• Marking:
Marking Translatable Strings
Telling something about the following string
Special Cases of Translatable Strings
Letting Users Report Translation Bugs
• Names:
Marking Proper Names for Translation
• Libraries:
Preparing Library Sources
Making the PO Template File
Invoking the xgettext Program
Creating a New PO File
Invoking the msginit Program
• Header Entry:
Filling in the Header Entry
Updating Existing PO Files
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 Commands
Entry Positioning
• Normalizing:
Normalizing Strings in Entries
Translated Entries
Fuzzy Entries
Untranslated Entries
Obsolete Entries
Modifying Translations
Modifying Comments
• Subedit:
Mode for Editing Translations
C Sources Context
• Auxiliary:
Consulting Auxiliary PO Files
Using Translation Compendia
Merging translations for later use
Using older translations if they fit
Manipulating PO Files
Invoking the msgcat Program
Invoking the msgconv Program
Invoking the msggrep Program
Invoking the msgfilter Program
Invoking the msguniq Program
Invoking the msgcomm Program
Invoking the msgcmp Program
Invoking the msgattrib Program
Invoking the msgen Program
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
Triggering colorized output
The environment variable TERM
The --style option
• Style rules:
Style rules for PO files
Customizing less for viewing PO files
Producing Binary MO Files
Invoking the msgfmt Program
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 in own programs
• gettext grok:
Being a gettext grok
Temporary Notes for the Programmers Chapter
About catgets
The interface
Problems with the catgets interface?!
About gettext
The interface
• Ambiguities:
Solving ambiguities
Locating message catalog files
How to request conversion to Unicode
• Contexts:
Solving ambiguities in GUI programs
• Plural forms:
Additional functions for handling plurals
Optimization of the *gettext functions
Temporary Notes for the Programmers Chapter
Temporary - Two Possible Implementations
• Temp catgets:
Temporary - About catgets
• Temp WSI:
Temporary - Why a single implementation
• Temp Notes:
Temporary - Notes
The Translator’s View
Introduction 0
Introduction 1
• Discussions:
Discussions
• Organization:
Organization
Information Flow
How to fill in msgstr[0], msgstr[1]
How to find which messages to translate first
Organization
Central Coordination
National Teams
Mailing Lists
National Teams
• Sub-Cultures:
Sub-Cultures
Organizational Ideas
The Maintainer’s View
Flat or Non-Flat Directory Structures
Prerequisite Works
Invoking the gettextize Program
Files You Must Create or Alter
Autoconf macros for use in configure.ac
Creating a Distribution Tarball
Files You Must Create or Alter
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 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/
gettext.h in lib/
Autoconf macros for use in configure.ac
AM_GNU_GETTEXT in gettext.m4
AM_GNU_GETTEXT_VERSION in gettext.m4
AM_GNU_GETTEXT_NEED in gettext.m4
AM_PO_SUBDIRS in po.m4
AM_XGETTEXT_OPTION in po.m4
• AM_ICONV:
AM_ICONV in iconv.m4
Integrating with Version Control Systems
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
Invoking the autopoint Program
Other Programming Languages
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 Strings
• java-format:
Java Format Strings
C# Format Strings
JavaScript Format Strings
Scheme Format Strings
• lisp-format:
Lisp Format Strings
• elisp-format:
Emacs Lisp Format Strings
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 Strings
Smalltalk Format Strings
• qt-format:
Qt Format Strings
Qt Plural Format Strings
• kde-format:
KDE Format Strings
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 Strings
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 for Internationalization
• gettext.sh:
Contents of gettext.sh
Invoking the gettext program
Invoking the ngettext program
Invoking the envsubst program
Invoking the eval_gettext function
Invoking the eval_ngettext function
Invoking the eval_pgettext function
Invoking the eval_npgettext function
Perl
General Problems Parsing Perl Code
Which Keywords Will xgettext Look For?
How to Extract Hash Keys
What are Strings And Quote-like Expressions?
Invalid String Interpolation
Valid String Interpolation
• Parentheses:
When To Use Parentheses
• Long Lines:
How To Grok with Long Lines
Bugs, Pitfalls, and Things That Do Not Work
Other Data Formats
Internationalizable Data Formats
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 Rules for XML Internationalization
Localized Data Formats
Editable Message Catalogs
Compiled Message Catalogs
Desktop Entry files
• XML:
XML files
Editable Message Catalogs
• PO:
PO - Portable Object
Java .properties
NeXTstep/GNUstep .strings
Compiled Message Catalogs
• MO:
MO - Machine Object
Java ResourceBundle
C# Satellite Assembly
• C# Resource:
C# Resource
Tcl message catalog
Qt message catalog
Concluding Remarks
• History:
History of GNU gettext
Historical introduction
• References:
Related Readings
Language Codes
Two-letter ISO 639 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]