1This is gettext.info, produced by makeinfo version 6.3 from 2gettext.texi. 3 4 Copyright (C) 1995-1998, 2001-2020 Free Software Foundation, Inc. 5 6 This manual is free documentation. It is dually licensed under the 7GNU FDL and the GNU GPL. This means that you can redistribute this 8manual under either of these two licenses, at your choice. 9 10 This manual is covered by the GNU FDL. Permission is granted to copy, 11distribute and/or modify this document under the terms of the GNU Free 12Documentation License (FDL), either version 1.2 of the License, or (at 13your option) any later version published by the Free Software Foundation 14(FSF); with no Invariant Sections, with no Front-Cover Text, and with no 15Back-Cover Texts. A copy of the license is included in *note GNU FDL::. 16 17 This manual is covered by the GNU GPL. You can redistribute it and/or 18modify it under the terms of the GNU General Public License (GPL), 19either version 2 of the License, or (at your option) any later version 20published by the Free Software Foundation (FSF). A copy of the license 21is included in *note GNU GPL::. 22INFO-DIR-SECTION GNU Gettext Utilities 23START-INFO-DIR-ENTRY 24* gettext: (gettext). GNU gettext utilities. 25* autopoint: (gettext)autopoint Invocation. Copy gettext infrastructure. 26* envsubst: (gettext)envsubst Invocation. Expand environment variables. 27* gettextize: (gettext)gettextize Invocation. Prepare a package for gettext. 28* msgattrib: (gettext)msgattrib Invocation. Select part of a PO file. 29* msgcat: (gettext)msgcat Invocation. Combine several PO files. 30* msgcmp: (gettext)msgcmp Invocation. Compare a PO file and template. 31* msgcomm: (gettext)msgcomm Invocation. Match two PO files. 32* msgconv: (gettext)msgconv Invocation. Convert PO file to encoding. 33* msgen: (gettext)msgen Invocation. Create an English PO file. 34* msgexec: (gettext)msgexec Invocation. Process a PO file. 35* msgfilter: (gettext)msgfilter Invocation. Pipe a PO file through a filter. 36* msgfmt: (gettext)msgfmt Invocation. Make MO files out of PO files. 37* msggrep: (gettext)msggrep Invocation. Select part of a PO file. 38* msginit: (gettext)msginit Invocation. Create a fresh PO file. 39* msgmerge: (gettext)msgmerge Invocation. Update a PO file from template. 40* msgunfmt: (gettext)msgunfmt Invocation. Uncompile MO file into PO file. 41* msguniq: (gettext)msguniq Invocation. Unify duplicates for PO file. 42* ngettext: (gettext)ngettext Invocation. Translate a message with plural. 43* xgettext: (gettext)xgettext Invocation. Extract strings into a PO file. 44* ISO639: (gettext)Language Codes. ISO 639 language codes. 45* ISO3166: (gettext)Country Codes. ISO 3166 country codes. 46END-INFO-DIR-ENTRY 47 48 This file provides documentation for GNU ‘gettext’ utilities. It 49also serves as a reference for the free Translation Project. 50 51 52File: gettext.info, Node: Top, Next: Introduction, Up: (dir) 53 54GNU ‘gettext’ utilities 55*********************** 56 57 This manual documents the GNU gettext tools and the GNU libintl 58library, version 0.21. 59 60* Menu: 61 62* Introduction:: Introduction 63* Users:: The User’s View 64* PO Files:: The Format of PO Files 65* Sources:: Preparing Program Sources 66* Template:: Making the PO Template File 67* Creating:: Creating a New PO File 68* Updating:: Updating Existing PO Files 69* Editing:: Editing PO Files 70* Manipulating:: Manipulating PO Files 71* Binaries:: Producing Binary MO Files 72* Programmers:: The Programmer’s View 73* Translators:: The Translator’s View 74* Maintainers:: The Maintainer’s View 75* Installers:: The Installer’s and Distributor’s View 76* Programming Languages:: Other Programming Languages 77* Data Formats:: Other Data Formats 78* Conclusion:: Concluding Remarks 79 80* Language Codes:: ISO 639 language codes 81* Country Codes:: ISO 3166 country codes 82* Licenses:: Licenses 83 84* Program Index:: Index of Programs 85* Option Index:: Index of Command-Line Options 86* Variable Index:: Index of Environment Variables 87* PO Mode Index:: Index of Emacs PO Mode Commands 88* Autoconf Macro Index:: Index of Autoconf Macros 89* Index:: General Index 90 91 — The Detailed Node Listing — 92 93Introduction 94 95* Why:: The Purpose of GNU ‘gettext’ 96* Concepts:: I18n, L10n, and Such 97* Aspects:: Aspects in Native Language Support 98* Files:: Files Conveying Translations 99* Overview:: Overview of GNU ‘gettext’ 100 101The User’s View 102 103* System Installation:: Questions During Operating System Installation 104* Setting the GUI Locale:: How to Specify the Locale Used by GUI Programs 105* Setting the POSIX Locale:: How to Specify the Locale According to POSIX 106* Working in a Windows console:: Obtaining good output in a Windows console 107* Installing Localizations:: How to Install Additional Translations 108 109Setting the Locale through Environment Variables 110 111* Locale Names:: How a Locale Specification Looks Like 112* Locale Environment Variables:: Which Environment Variable Specfies What 113* The LANGUAGE variable:: How to Specify a Priority List of Languages 114 115Preparing Program Sources 116 117* Importing:: Importing the ‘gettext’ declaration 118* Triggering:: Triggering ‘gettext’ Operations 119* Preparing Strings:: Preparing Translatable Strings 120* Mark Keywords:: How Marks Appear in Sources 121* Marking:: Marking Translatable Strings 122* c-format Flag:: Telling something about the following string 123* Special cases:: Special Cases of Translatable Strings 124* Bug Report Address:: Letting Users Report Translation Bugs 125* Names:: Marking Proper Names for Translation 126* Libraries:: Preparing Library Sources 127 128Making the PO Template File 129 130* xgettext Invocation:: Invoking the ‘xgettext’ Program 131 132Creating a New PO File 133 134* msginit Invocation:: Invoking the ‘msginit’ Program 135* Header Entry:: Filling in the Header Entry 136 137Updating Existing PO Files 138 139* msgmerge Invocation:: Invoking the ‘msgmerge’ Program 140 141Editing PO Files 142 143* KBabel:: KDE’s PO File Editor 144* Gtranslator:: GNOME’s PO File Editor 145* PO Mode:: Emacs’s PO File Editor 146* Compendium:: Using Translation Compendia 147 148Emacs’s PO File Editor 149 150* Installation:: Completing GNU ‘gettext’ Installation 151* Main PO Commands:: Main Commands 152* Entry Positioning:: Entry Positioning 153* Normalizing:: Normalizing Strings in Entries 154* Translated Entries:: Translated Entries 155* Fuzzy Entries:: Fuzzy Entries 156* Untranslated Entries:: Untranslated Entries 157* Obsolete Entries:: Obsolete Entries 158* Modifying Translations:: Modifying Translations 159* Modifying Comments:: Modifying Comments 160* Subedit:: Mode for Editing Translations 161* C Sources Context:: C Sources Context 162* Auxiliary:: Consulting Auxiliary PO Files 163 164Using Translation Compendia 165 166* Creating Compendia:: Merging translations for later use 167* Using Compendia:: Using older translations if they fit 168 169Manipulating PO Files 170 171* msgcat Invocation:: Invoking the ‘msgcat’ Program 172* msgconv Invocation:: Invoking the ‘msgconv’ Program 173* msggrep Invocation:: Invoking the ‘msggrep’ Program 174* msgfilter Invocation:: Invoking the ‘msgfilter’ Program 175* msguniq Invocation:: Invoking the ‘msguniq’ Program 176* msgcomm Invocation:: Invoking the ‘msgcomm’ Program 177* msgcmp Invocation:: Invoking the ‘msgcmp’ Program 178* msgattrib Invocation:: Invoking the ‘msgattrib’ Program 179* msgen Invocation:: Invoking the ‘msgen’ Program 180* msgexec Invocation:: Invoking the ‘msgexec’ Program 181* Colorizing:: Highlighting parts of PO files 182* Other tools:: Other tools for manipulating PO files 183* libgettextpo:: Writing your own programs that process PO files 184 185Highlighting parts of PO files 186 187* The --color option:: Triggering colorized output 188* The TERM variable:: The environment variable ‘TERM’ 189* The --style option:: The ‘--style’ option 190* Style rules:: Style rules for PO files 191* Customizing less:: Customizing ‘less’ for viewing PO files 192 193Producing Binary MO Files 194 195* msgfmt Invocation:: Invoking the ‘msgfmt’ Program 196* msgunfmt Invocation:: Invoking the ‘msgunfmt’ Program 197* MO Files:: The Format of GNU MO Files 198 199The Programmer’s View 200 201* catgets:: About ‘catgets’ 202* gettext:: About ‘gettext’ 203* Comparison:: Comparing the two interfaces 204* Using libintl.a:: Using libintl.a in own programs 205* gettext grok:: Being a ‘gettext’ grok 206* Temp Programmers:: Temporary Notes for the Programmers Chapter 207 208About ‘catgets’ 209 210* Interface to catgets:: The interface 211* Problems with catgets:: Problems with the ‘catgets’ interface?! 212 213About ‘gettext’ 214 215* Interface to gettext:: The interface 216* Ambiguities:: Solving ambiguities 217* Locating Catalogs:: Locating message catalog files 218* Charset conversion:: How to request conversion to Unicode 219* Contexts:: Solving ambiguities in GUI programs 220* Plural forms:: Additional functions for handling plurals 221* Optimized gettext:: Optimization of the *gettext functions 222 223Temporary Notes for the Programmers Chapter 224 225* Temp Implementations:: Temporary - Two Possible Implementations 226* Temp catgets:: Temporary - About ‘catgets’ 227* Temp WSI:: Temporary - Why a single implementation 228* Temp Notes:: Temporary - Notes 229 230The Translator’s View 231 232* Trans Intro 0:: Introduction 0 233* Trans Intro 1:: Introduction 1 234* Discussions:: Discussions 235* Organization:: Organization 236* Information Flow:: Information Flow 237* Translating plural forms:: How to fill in ‘msgstr[0]’, ‘msgstr[1]’ 238* Prioritizing messages:: How to find which messages to translate first 239 240Organization 241 242* Central Coordination:: Central Coordination 243* National Teams:: National Teams 244* Mailing Lists:: Mailing Lists 245 246National Teams 247 248* Sub-Cultures:: Sub-Cultures 249* Organizational Ideas:: Organizational Ideas 250 251The Maintainer’s View 252 253* Flat and Non-Flat:: Flat or Non-Flat Directory Structures 254* Prerequisites:: Prerequisite Works 255* gettextize Invocation:: Invoking the ‘gettextize’ Program 256* Adjusting Files:: Files You Must Create or Alter 257* autoconf macros:: Autoconf macros for use in ‘configure.ac’ 258* Version Control Issues:: 259* Release Management:: Creating a Distribution Tarball 260 261Files You Must Create or Alter 262 263* po/POTFILES.in:: ‘POTFILES.in’ in ‘po/’ 264* po/LINGUAS:: ‘LINGUAS’ in ‘po/’ 265* po/Makevars:: ‘Makevars’ in ‘po/’ 266* po/Rules-*:: Extending ‘Makefile’ in ‘po/’ 267* configure.ac:: ‘configure.ac’ at top level 268* config.guess:: ‘config.guess’, ‘config.sub’ at top level 269* mkinstalldirs:: ‘mkinstalldirs’ at top level 270* aclocal:: ‘aclocal.m4’ at top level 271* config.h.in:: ‘config.h.in’ at top level 272* Makefile:: ‘Makefile.in’ at top level 273* src/Makefile:: ‘Makefile.in’ in ‘src/’ 274* lib/gettext.h:: ‘gettext.h’ in ‘lib/’ 275 276Autoconf macros for use in ‘configure.ac’ 277 278* AM_GNU_GETTEXT:: AM_GNU_GETTEXT in ‘gettext.m4’ 279* AM_GNU_GETTEXT_VERSION:: AM_GNU_GETTEXT_VERSION in ‘gettext.m4’ 280* AM_GNU_GETTEXT_NEED:: AM_GNU_GETTEXT_NEED in ‘gettext.m4’ 281* AM_PO_SUBDIRS:: AM_PO_SUBDIRS in ‘po.m4’ 282* AM_XGETTEXT_OPTION:: AM_XGETTEXT_OPTION in ‘po.m4’ 283* AM_ICONV:: AM_ICONV in ‘iconv.m4’ 284 285Integrating with Version Control Systems 286 287* Distributed Development:: Avoiding version mismatch in distributed development 288* Files under Version Control:: Files to put under version control 289* Translations under Version Control:: Put PO Files under Version Control 290* autopoint Invocation:: Invoking the ‘autopoint’ Program 291 292Other Programming Languages 293 294* Language Implementors:: The Language Implementor’s View 295* Programmers for other Languages:: The Programmer’s View 296* Translators for other Languages:: The Translator’s View 297* Maintainers for other Languages:: The Maintainer’s View 298* List of Programming Languages:: Individual Programming Languages 299 300The Translator’s View 301 302* c-format:: C Format Strings 303* objc-format:: Objective C Format Strings 304* python-format:: Python Format Strings 305* java-format:: Java Format Strings 306* csharp-format:: C# Format Strings 307* javascript-format:: JavaScript Format Strings 308* scheme-format:: Scheme Format Strings 309* lisp-format:: Lisp Format Strings 310* elisp-format:: Emacs Lisp Format Strings 311* librep-format:: librep Format Strings 312* ruby-format:: Ruby Format Strings 313* sh-format:: Shell Format Strings 314* awk-format:: awk Format Strings 315* lua-format:: Lua Format Strings 316* object-pascal-format:: Object Pascal Format Strings 317* smalltalk-format:: Smalltalk Format Strings 318* qt-format:: Qt Format Strings 319* qt-plural-format:: Qt Plural Format Strings 320* kde-format:: KDE Format Strings 321* kde-kuit-format:: KUIT Format Strings 322* boost-format:: Boost Format Strings 323* tcl-format:: Tcl Format Strings 324* perl-format:: Perl Format Strings 325* php-format:: PHP Format Strings 326* gcc-internal-format:: GCC internal Format Strings 327* gfc-internal-format:: GFC internal Format Strings 328* ycp-format:: YCP Format Strings 329 330Individual Programming Languages 331 332* C:: C, C++, Objective C 333* Python:: Python 334* Java:: Java 335* C#:: C# 336* JavaScript:: JavaScript 337* Scheme:: GNU guile - Scheme 338* Common Lisp:: GNU clisp - Common Lisp 339* clisp C:: GNU clisp C sources 340* Emacs Lisp:: Emacs Lisp 341* librep:: librep 342* Ruby:: Ruby 343* sh:: sh - Shell Script 344* bash:: bash - Bourne-Again Shell Script 345* gawk:: GNU awk 346* Lua:: Lua 347* Pascal:: Pascal - Free Pascal Compiler 348* Smalltalk:: GNU Smalltalk 349* Vala:: Vala 350* wxWidgets:: wxWidgets library 351* Tcl:: Tcl - Tk’s scripting language 352* Perl:: Perl 353* PHP:: PHP Hypertext Preprocessor 354* Pike:: Pike 355* GCC-source:: GNU Compiler Collection sources 356* YCP:: YCP - YaST2 scripting language 357 358sh - Shell Script 359 360* Preparing Shell Scripts:: Preparing Shell Scripts for Internationalization 361* gettext.sh:: Contents of ‘gettext.sh’ 362* gettext Invocation:: Invoking the ‘gettext’ program 363* ngettext Invocation:: Invoking the ‘ngettext’ program 364* envsubst Invocation:: Invoking the ‘envsubst’ program 365* eval_gettext Invocation:: Invoking the ‘eval_gettext’ function 366* eval_ngettext Invocation:: Invoking the ‘eval_ngettext’ function 367* eval_pgettext Invocation:: Invoking the ‘eval_pgettext’ function 368* eval_npgettext Invocation:: Invoking the ‘eval_npgettext’ function 369 370Perl 371 372* General Problems:: General Problems Parsing Perl Code 373* Default Keywords:: Which Keywords Will xgettext Look For? 374* Special Keywords:: How to Extract Hash Keys 375* Quote-like Expressions:: What are Strings And Quote-like Expressions? 376* Interpolation I:: Invalid String Interpolation 377* Interpolation II:: Valid String Interpolation 378* Parentheses:: When To Use Parentheses 379* Long Lines:: How To Grok with Long Lines 380* Perl Pitfalls:: Bugs, Pitfalls, and Things That Do Not Work 381 382Other Data Formats 383 384* Internationalizable Data:: Internationalizable Data Formats 385* Localized Data:: Localized Data Formats 386 387Internationalizable Data Formats 388 389* POT:: POT - Portable Object Template 390* RST:: Resource String Table 391* Glade:: Glade - GNOME user interface description 392* GSettings:: GSettings - GNOME user configuration schema 393* AppData:: AppData - freedesktop.org application description 394* Preparing ITS Rules:: Preparing Rules for XML Internationalization 395 396Localized Data Formats 397 398* Editable Message Catalogs:: Editable Message Catalogs 399* Compiled Message Catalogs:: Compiled Message Catalogs 400* Desktop Entry:: Desktop Entry files 401* XML:: XML files 402 403Editable Message Catalogs 404 405* PO:: PO - Portable Object 406* Java .properties:: Java .properties 407* GNUstep .strings:: NeXTstep/GNUstep .strings 408 409Compiled Message Catalogs 410 411* MO:: MO - Machine Object 412* Java ResourceBundle:: Java ResourceBundle 413* C# Satellite Assembly:: C# Satellite Assembly 414* C# Resource:: C# Resource 415* Tcl message catalog:: Tcl message catalog 416* Qt message catalog:: Qt message catalog 417 418Concluding Remarks 419 420* History:: History of GNU ‘gettext’ 421* The original ABOUT-NLS:: Historical introduction 422* References:: Related Readings 423 424Language Codes 425 426* Usual Language Codes:: Two-letter ISO 639 language codes 427* Rare Language Codes:: Three-letter ISO 639 language codes 428 429Licenses 430 431* GNU GPL:: GNU General Public License 432* GNU LGPL:: GNU Lesser General Public License 433* GNU FDL:: GNU Free Documentation License 434 435 436 437File: gettext.info, Node: Introduction, Next: Users, Prev: Top, Up: Top 438 4391 Introduction 440************** 441 442 This chapter explains the goals sought in the creation of GNU 443‘gettext’ and the free Translation Project. Then, it explains a few 444broad concepts around Native Language Support, and positions message 445translation with regard to other aspects of national and cultural 446variance, as they apply to programs. It also surveys those files used 447to convey the translations. It explains how the various tools interact 448in the initial generation of these files, and later, how the maintenance 449cycle should usually operate. 450 451 In this manual, we use _he_ when speaking of the programmer or 452maintainer, _she_ when speaking of the translator, and _they_ when 453speaking of the installers or end users of the translated program. This 454is only a convenience for clarifying the documentation. It is 455_absolutely_ not meant to imply that some roles are more appropriate to 456males or females. Besides, as you might guess, GNU ‘gettext’ is meant 457to be useful for people using computers, whatever their sex, race, 458religion or nationality! 459 460 Please submit suggestions and corrections 461 • either in the bug tracker at 462 <https://savannah.gnu.org/projects/gettext> 463 • or by email to ‘bug-gettext@gnu.org’. 464 465Please include the manual’s edition number and update date in your 466messages. 467 468* Menu: 469 470* Why:: The Purpose of GNU ‘gettext’ 471* Concepts:: I18n, L10n, and Such 472* Aspects:: Aspects in Native Language Support 473* Files:: Files Conveying Translations 474* Overview:: Overview of GNU ‘gettext’ 475 476 477File: gettext.info, Node: Why, Next: Concepts, Up: Introduction 478 4791.1 The Purpose of GNU ‘gettext’ 480================================ 481 482 Usually, programs are written and documented in English, and use 483English at execution time to interact with users. This is true not only 484of GNU software, but also of a great deal of proprietary and free 485software. Using a common language is quite handy for communication 486between developers, maintainers and users from all countries. On the 487other hand, most people are less comfortable with English than with 488their own native language, and would prefer to use their mother tongue 489for day to day’s work, as far as possible. Many would simply _love_ to 490see their computer screen showing a lot less of English, and far more of 491their own language. 492 493 However, to many people, this dream might appear so far fetched that 494they may believe it is not even worth spending time thinking about it. 495They have no confidence at all that the dream might ever become true. 496Yet some have not lost hope, and have organized themselves. The 497Translation Project is a formalization of this hope into a workable 498structure, which has a good chance to get all of us nearer the 499achievement of a truly multi-lingual set of programs. 500 501 GNU ‘gettext’ is an important step for the Translation Project, as it 502is an asset on which we may build many other steps. This package offers 503to programmers, translators and even users, a well integrated set of 504tools and documentation. Specifically, the GNU ‘gettext’ utilities are 505a set of tools that provides a framework within which other free 506packages may produce multi-lingual messages. These tools include 507 508 • A set of conventions about how programs should be written to 509 support message catalogs. 510 511 • A directory and file naming organization for the message catalogs 512 themselves. 513 514 • A runtime library supporting the retrieval of translated messages. 515 516 • A few stand-alone programs to massage in various ways the sets of 517 translatable strings, or already translated strings. 518 519 • A library supporting the parsing and creation of files containing 520 translated messages. 521 522 • A special mode for Emacs(1) which helps preparing these sets and 523 bringing them up to date. 524 525 GNU ‘gettext’ is designed to minimize the impact of 526internationalization on program sources, keeping this impact as small 527and hardly noticeable as possible. Internationalization has better 528chances of succeeding if it is very light weighted, or at least, appear 529to be so, when looking at program sources. 530 531 The Translation Project also uses the GNU ‘gettext’ distribution as a 532vehicle for documenting its structure and methods. This goes beyond the 533strict technicalities of documenting the GNU ‘gettext’ proper. By so 534doing, translators will find in a single place, as far as possible, all 535they need to know for properly doing their translating work. Also, this 536supplemental documentation might also help programmers, and even curious 537users, in understanding how GNU ‘gettext’ is related to the remainder of 538the Translation Project, and consequently, have a glimpse at the _big 539picture_. 540 541 ---------- Footnotes ---------- 542 543 (1) In this manual, all mentions of Emacs refers to either GNU Emacs 544or to XEmacs, which people sometimes call FSF Emacs and Lucid Emacs, 545respectively. 546 547 548File: gettext.info, Node: Concepts, Next: Aspects, Prev: Why, Up: Introduction 549 5501.2 I18n, L10n, and Such 551======================== 552 553 Two long words appear all the time when we discuss support of native 554language in programs, and these words have a precise meaning, worth 555being explained here, once and for all in this document. The words are 556_internationalization_ and _localization_. Many people, tired of 557writing these long words over and over again, took the habit of writing 558“i18n” and “l10n” instead, quoting the first and last letter of each 559word, and replacing the run of intermediate letters by a number merely 560telling how many such letters there are. But in this manual, in the 561sake of clarity, we will patiently write the names in full, each time... 562 563 By “internationalization”, one refers to the operation by which a 564program, or a set of programs turned into a package, is made aware of 565and able to support multiple languages. This is a generalization 566process, by which the programs are untied from calling only English 567strings or other English specific habits, and connected to generic ways 568of doing the same, instead. Program developers may use various 569techniques to internationalize their programs. Some of these have been 570standardized. GNU ‘gettext’ offers one of these standards. *Note 571Programmers::. 572 573 By “localization”, one means the operation by which, in a set of 574programs already internationalized, one gives the program all needed 575information so that it can adapt itself to handle its input and output 576in a fashion which is correct for some native language and cultural 577habits. This is a particularisation process, by which generic methods 578already implemented in an internationalized program are used in specific 579ways. The programming environment puts several functions to the 580programmers disposal which allow this runtime configuration. The formal 581description of specific set of cultural habits for some country, 582together with all associated translations targeted to the same native 583language, is called the “locale” for this language or country. Users 584achieve localization of programs by setting proper values to special 585environment variables, prior to executing those programs, identifying 586which locale should be used. 587 588 In fact, locale message support is only one component of the cultural 589data that makes up a particular locale. There are a whole host of 590routines and functions provided to aid programmers in developing 591internationalized software and which allow them to access the data 592stored in a particular locale. When someone presently refers to a 593particular locale, they are obviously referring to the data stored 594within that particular locale. Similarly, if a programmer is referring 595to “accessing the locale routines”, they are referring to the complete 596suite of routines that access all of the locale’s information. 597 598 One uses the expression “Native Language Support”, or merely NLS, for 599speaking of the overall activity or feature encompassing both 600internationalization and localization, allowing for multi-lingual 601interactions in a program. In a nutshell, one could say that 602internationalization is the operation by which further localizations are 603made possible. 604 605 Also, very roughly said, when it comes to multi-lingual messages, 606internationalization is usually taken care of by programmers, and 607localization is usually taken care of by translators. 608 609 610File: gettext.info, Node: Aspects, Next: Files, Prev: Concepts, Up: Introduction 611 6121.3 Aspects in Native Language Support 613====================================== 614 615 For a totally multi-lingual distribution, there are many things to 616translate beyond output messages. 617 618 • As of today, GNU ‘gettext’ offers a complete toolset for 619 translating messages output by C programs. Perl scripts and shell 620 scripts will also need to be translated. Even if there are today 621 some hooks by which this can be done, these hooks are not 622 integrated as well as they should be. 623 624 • Some programs, like ‘autoconf’ or ‘bison’, are able to produce 625 other programs (or scripts). Even if the generating programs 626 themselves are internationalized, the generated programs they 627 produce may need internationalization on their own, and this 628 indirect internationalization could be automated right from the 629 generating program. In fact, quite usually, generating and 630 generated programs could be internationalized independently, as the 631 effort needed is fairly orthogonal. 632 633 • A few programs include textual tables which might need translation 634 themselves, independently of the strings contained in the program 635 itself. For example, RFC 1345 gives an English description for 636 each character which the ‘recode’ program is able to reconstruct at 637 execution. Since these descriptions are extracted from the RFC by 638 mechanical means, translating them properly would require a prior 639 translation of the RFC itself. 640 641 • Almost all programs accept options, which are often worded out so 642 to be descriptive for the English readers; one might want to 643 consider offering translated versions for program options as well. 644 645 • Many programs read, interpret, compile, or are somewhat driven by 646 input files which are texts containing keywords, identifiers, or 647 replies which are inherently translatable. For example, one may 648 want ‘gcc’ to allow diacriticized characters in identifiers or use 649 translated keywords; ‘rm -i’ might accept something else than ‘y’ 650 or ‘n’ for replies, etc. Even if the program will eventually make 651 most of its output in the foreign languages, one has to decide 652 whether the input syntax, option values, etc., are to be localized 653 or not. 654 655 • The manual accompanying a package, as well as all documentation 656 files in the distribution, could surely be translated, too. 657 Translating a manual, with the intent of later keeping up with 658 updates, is a major undertaking in itself, generally. 659 660 As we already stressed, translation is only one aspect of locales. 661Other internationalization aspects are system services and are handled 662in GNU ‘libc’. There are many attributes that are needed to define a 663country’s cultural conventions. These attributes include beside the 664country’s native language, the formatting of the date and time, the 665representation of numbers, the symbols for currency, etc. These local 666“rules” are termed the country’s locale. The locale represents the 667knowledge needed to support the country’s native attributes. 668 669 There are a few major areas which may vary between countries and 670hence, define what a locale must describe. The following list helps 671putting multi-lingual messages into the proper context of other tasks 672related to locales. See the GNU ‘libc’ manual for details. 673 674_Characters and Codesets_ 675 676 The codeset most commonly used through out the USA and most English 677 speaking parts of the world is the ASCII codeset. However, there 678 are many characters needed by various locales that are not found 679 within this codeset. The 8-bit ISO 8859-1 code set has most of the 680 special characters needed to handle the major European languages. 681 However, in many cases, choosing ISO 8859-1 is nevertheless not 682 adequate: it doesn’t even handle the major European currency. 683 Hence each locale will need to specify which codeset they need to 684 use and will need to have the appropriate character handling 685 routines to cope with the codeset. 686 687_Currency_ 688 689 The symbols used vary from country to country as does the position 690 used by the symbol. Software needs to be able to transparently 691 display currency figures in the native mode for each locale. 692 693_Dates_ 694 695 The format of date varies between locales. For example, Christmas 696 day in 1994 is written as 12/25/94 in the USA and as 25/12/94 in 697 Australia. Other countries might use ISO 8601 dates, etc. 698 699 Time of the day may be noted as HH:MM, HH.MM, or otherwise. Some 700 locales require time to be specified in 24-hour mode rather than as 701 AM or PM. Further, the nature and yearly extent of the Daylight 702 Saving correction vary widely between countries. 703 704_Numbers_ 705 706 Numbers can be represented differently in different locales. For 707 example, the following numbers are all written correctly for their 708 respective locales: 709 710 12,345.67 English 711 12.345,67 German 712 12345,67 French 713 1,2345.67 Asia 714 715 Some programs could go further and use different unit systems, like 716 English units or Metric units, or even take into account variants 717 about how numbers are spelled in full. 718 719_Messages_ 720 721 The most obvious area is the language support within a locale. 722 This is where GNU ‘gettext’ provides the means for developers and 723 users to easily change the language that the software uses to 724 communicate to the user. 725 726 These areas of cultural conventions are called _locale categories_. 727It is an unfortunate term; _locale aspects_ or _locale feature 728categories_ would be a better term, because each “locale category” 729describes an area or task that requires localization. The concrete data 730that describes the cultural conventions for such an area and for a 731particular culture is also called a _locale category_. In this sense, a 732locale is composed of several locale categories: the locale category 733describing the codeset, the locale category describing the formatting of 734numbers, the locale category containing the translated messages, and so 735on. 736 737 Components of locale outside of message handling are standardized in 738the ISO C standard and the POSIX:2001 standard (also known as the SUSV3 739specification). GNU ‘libc’ fully implements this, and most other modern 740systems provide a more or less reasonable support for at least some of 741the missing components. 742 743 744File: gettext.info, Node: Files, Next: Overview, Prev: Aspects, Up: Introduction 745 7461.4 Files Conveying Translations 747================================ 748 749 The letters PO in ‘.po’ files means Portable Object, to distinguish 750it from ‘.mo’ files, where MO stands for Machine Object. This paradigm, 751as well as the PO file format, is inspired by the NLS standard developed 752by Uniforum, and first implemented by Sun in their Solaris system. 753 754 PO files are meant to be read and edited by humans, and associate 755each original, translatable string of a given package with its 756translation in a particular target language. A single PO file is 757dedicated to a single target language. If a package supports many 758languages, there is one such PO file per language supported, and each 759package has its own set of PO files. These PO files are best created by 760the ‘xgettext’ program, and later updated or refreshed through the 761‘msgmerge’ program. Program ‘xgettext’ extracts all marked messages 762from a set of C files and initializes a PO file with empty translations. 763Program ‘msgmerge’ takes care of adjusting PO files between releases of 764the corresponding sources, commenting obsolete entries, initializing new 765ones, and updating all source line references. Files ending with ‘.pot’ 766are kind of base translation files found in distributions, in PO file 767format. 768 769 MO files are meant to be read by programs, and are binary in nature. 770A few systems already offer tools for creating and handling MO files as 771part of the Native Language Support coming with the system, but the 772format of these MO files is often different from system to system, and 773non-portable. The tools already provided with these systems don’t 774support all the features of GNU ‘gettext’. Therefore GNU ‘gettext’ uses 775its own format for MO files. Files ending with ‘.gmo’ are really MO 776files, when it is known that these files use the GNU format. 777 778 779File: gettext.info, Node: Overview, Prev: Files, Up: Introduction 780 7811.5 Overview of GNU ‘gettext’ 782============================= 783 784 The following diagram summarizes the relation between the files 785handled by GNU ‘gettext’ and the tools acting on these files. It is 786followed by somewhat detailed explanations, which you should read while 787keeping an eye on the diagram. Having a clear understanding of these 788interrelations will surely help programmers, translators and 789maintainers. 790 791 Original C Sources ---> Preparation ---> Marked C Sources ---. 792 | 793 .---------<--- GNU gettext Library | 794 .--- make <---+ | 795 | `---------<--------------------+---------------' 796 | | 797 | .-----<--- PACKAGE.pot <--- xgettext <---' .---<--- PO Compendium 798 | | | ^ 799 | | `---. | 800 | `---. +---> PO editor ---. 801 | +----> msgmerge ------> LANG.po ---->--------' | 802 | .---' | 803 | | | 804 | `-------------<---------------. | 805 | +--- New LANG.po <--------------------' 806 | .--- LANG.gmo <--- msgfmt <---' 807 | | 808 | `---> install ---> /.../LANG/PACKAGE.mo ---. 809 | +---> "Hello world!" 810 `-------> install ---> /.../bin/PROGRAM -------' 811 812 As a programmer, the first step to bringing GNU ‘gettext’ into your 813package is identifying, right in the C sources, those strings which are 814meant to be translatable, and those which are untranslatable. This 815tedious job can be done a little more comfortably using emacs PO mode, 816but you can use any means familiar to you for modifying your C sources. 817Beside this some other simple, standard changes are needed to properly 818initialize the translation library. *Note Sources::, for more 819information about all this. 820 821 For newly written software the strings of course can and should be 822marked while writing it. The ‘gettext’ approach makes this very easy. 823Simply put the following lines at the beginning of each file or in a 824central header file: 825 826 #define _(String) (String) 827 #define N_(String) String 828 #define textdomain(Domain) 829 #define bindtextdomain(Package, Directory) 830 831Doing this allows you to prepare the sources for internationalization. 832Later when you feel ready for the step to use the ‘gettext’ library 833simply replace these definitions by the following: 834 835 #include <libintl.h> 836 #define _(String) gettext (String) 837 #define gettext_noop(String) String 838 #define N_(String) gettext_noop (String) 839 840and link against ‘libintl.a’ or ‘libintl.so’. Note that on GNU systems, 841you don’t need to link with ‘libintl’ because the ‘gettext’ library 842functions are already contained in GNU libc. That is all you have to 843change. 844 845 Once the C sources have been modified, the ‘xgettext’ program is used 846to find and extract all translatable strings, and create a PO template 847file out of all these. This ‘PACKAGE.pot’ file contains all original 848program strings. It has sets of pointers to exactly where in C sources 849each string is used. All translations are set to empty. The letter ‘t’ 850in ‘.pot’ marks this as a Template PO file, not yet oriented towards any 851particular language. *Note xgettext Invocation::, for more details 852about how one calls the ‘xgettext’ program. If you are _really_ lazy, 853you might be interested at working a lot more right away, and preparing 854the whole distribution setup (*note Maintainers::). By doing so, you 855spare yourself typing the ‘xgettext’ command, as ‘make’ should now 856generate the proper things automatically for you! 857 858 The first time through, there is no ‘LANG.po’ yet, so the ‘msgmerge’ 859step may be skipped and replaced by a mere copy of ‘PACKAGE.pot’ to 860‘LANG.po’, where LANG represents the target language. See *note 861Creating:: for details. 862 863 Then comes the initial translation of messages. Translation in 864itself is a whole matter, still exclusively meant for humans, and whose 865complexity far overwhelms the level of this manual. Nevertheless, a few 866hints are given in some other chapter of this manual (*note 867Translators::). You will also find there indications about how to 868contact translating teams, or becoming part of them, for sharing your 869translating concerns with others who target the same native language. 870 871 While adding the translated messages into the ‘LANG.po’ PO file, if 872you are not using one of the dedicated PO file editors (*note 873Editing::), you are on your own for ensuring that your efforts fully 874respect the PO file format, and quoting conventions (*note PO Files::). 875This is surely not an impossible task, as this is the way many people 876have handled PO files around 1995. On the other hand, by using a PO 877file editor, most details of PO file format are taken care of for you, 878but you have to acquire some familiarity with PO file editor itself. 879 880 If some common translations have already been saved into a compendium 881PO file, translators may use PO mode for initializing untranslated 882entries from the compendium, and also save selected translations into 883the compendium, updating it (*note Compendium::). Compendium files are 884meant to be exchanged between members of a given translation team. 885 886 Programs, or packages of programs, are dynamic in nature: users write 887bug reports and suggestion for improvements, maintainers react by 888modifying programs in various ways. The fact that a package has already 889been internationalized should not make maintainers shy of adding new 890strings, or modifying strings already translated. They just do their 891job the best they can. For the Translation Project to work smoothly, it 892is important that maintainers do not carry translation concerns on their 893already loaded shoulders, and that translators be kept as free as 894possible of programming concerns. 895 896 The only concern maintainers should have is carefully marking new 897strings as translatable, when they should be, and do not otherwise worry 898about them being translated, as this will come in proper time. 899Consequently, when programs and their strings are adjusted in various 900ways by maintainers, and for matters usually unrelated to translation, 901‘xgettext’ would construct ‘PACKAGE.pot’ files which are evolving over 902time, so the translations carried by ‘LANG.po’ are slowly fading out of 903date. 904 905 It is important for translators (and even maintainers) to understand 906that package translation is a continuous process in the lifetime of a 907package, and not something which is done once and for all at the start. 908After an initial burst of translation activity for a given package, 909interventions are needed once in a while, because here and there, 910translated entries become obsolete, and new untranslated entries appear, 911needing translation. 912 913 The ‘msgmerge’ program has the purpose of refreshing an already 914existing ‘LANG.po’ file, by comparing it with a newer ‘PACKAGE.pot’ 915template file, extracted by ‘xgettext’ out of recent C sources. The 916refreshing operation adjusts all references to C source locations for 917strings, since these strings move as programs are modified. Also, 918‘msgmerge’ comments out as obsolete, in ‘LANG.po’, those already 919translated entries which are no longer used in the program sources 920(*note Obsolete Entries::). It finally discovers new strings and 921inserts them in the resulting PO file as untranslated entries (*note 922Untranslated Entries::). *Note msgmerge Invocation::, for more 923information about what ‘msgmerge’ really does. 924 925 Whatever route or means taken, the goal is to obtain an updated 926‘LANG.po’ file offering translations for all strings. 927 928 The temporal mobility, or fluidity of PO files, is an integral part 929of the translation game, and should be well understood, and accepted. 930People resisting it will have a hard time participating in the 931Translation Project, or will give a hard time to other participants! In 932particular, maintainers should relax and include all available official 933PO files in their distributions, even if these have not recently been 934updated, without exerting pressure on the translator teams to get the 935job done. The pressure should rather come from the community of users 936speaking a particular language, and maintainers should consider 937themselves fairly relieved of any concern about the adequacy of 938translation files. On the other hand, translators should reasonably try 939updating the PO files they are responsible for, while the package is 940undergoing pretest, prior to an official distribution. 941 942 Once the PO file is complete and dependable, the ‘msgfmt’ program is 943used for turning the PO file into a machine-oriented format, which may 944yield efficient retrieval of translations by the programs of the 945package, whenever needed at runtime (*note MO Files::). *Note msgfmt 946Invocation::, for more information about all modes of execution for the 947‘msgfmt’ program. 948 949 Finally, the modified and marked C sources are compiled and linked 950with the GNU ‘gettext’ library, usually through the operation of ‘make’, 951given a suitable ‘Makefile’ exists for the project, and the resulting 952executable is installed somewhere users will find it. The MO files 953themselves should also be properly installed. Given the appropriate 954environment variables are set (*note Setting the POSIX Locale::), the 955program should localize itself automatically, whenever it executes. 956 957 The remainder of this manual has the purpose of explaining in depth 958the various steps outlined above. 959 960 961File: gettext.info, Node: Users, Next: PO Files, Prev: Introduction, Up: Top 962 9632 The User’s View 964***************** 965 966 Nowadays, when users log into a computer, they usually find that all 967their programs show messages in their native language – at least for 968users of languages with an active free software community, like French 969or German; to a lesser extent for languages with a smaller participation 970in free software and the GNU project, like Hindi and Filipino. 971 972 How does this work? How can the user influence the language that is 973used by the programs? This chapter will answer it. 974 975* Menu: 976 977* System Installation:: Questions During Operating System Installation 978* Setting the GUI Locale:: How to Specify the Locale Used by GUI Programs 979* Setting the POSIX Locale:: How to Specify the Locale According to POSIX 980* Working in a Windows console:: Obtaining good output in a Windows console 981* Installing Localizations:: How to Install Additional Translations 982 983 984File: gettext.info, Node: System Installation, Next: Setting the GUI Locale, Up: Users 985 9862.1 Operating System Installation 987================================= 988 989 The default language is often already specified during operating 990system installation. When the operating system is installed, the 991installer typically asks for the language used for the installation 992process and, separately, for the language to use in the installed 993system. Some OS installers only ask for the language once. 994 995 This determines the system-wide default language for all users. But 996the installers often give the possibility to install extra localizations 997for additional languages. For example, the localizations of KDE (the K 998Desktop Environment) and OpenOffice.org are often bundled separately, as 999one installable package per language. 1000 1001 At this point it is good to consider the intended use of the machine: 1002If it is a machine designated for personal use, additional localizations 1003are probably not necessary. If, however, the machine is in use in an 1004organization or company that has international relationships, one can 1005consider the needs of guest users. If you have a guest from abroad, for 1006a week, what could be his preferred locales? It may be worth installing 1007these additional localizations ahead of time, since they cost only a bit 1008of disk space at this point. 1009 1010 The system-wide default language is the locale configuration that is 1011used when a new user account is created. But the user can have his own 1012locale configuration that is different from the one of the other users 1013of the same machine. He can specify it, typically after the first 1014login, as described in the next section. 1015 1016 1017File: gettext.info, Node: Setting the GUI Locale, Next: Setting the POSIX Locale, Prev: System Installation, Up: Users 1018 10192.2 Setting the Locale Used by GUI Programs 1020=========================================== 1021 1022 The immediately available programs in a user’s desktop come from a 1023group of programs called a “desktop environment”; it usually includes 1024the window manager, a web browser, a text editor, and more. The most 1025common free desktop environments are KDE, GNOME, and Xfce. 1026 1027 The locale used by GUI programs of the desktop environment can be 1028specified in a configuration screen called “control center”, “language 1029settings” or “country settings”. 1030 1031 Individual GUI programs that are not part of the desktop environment 1032can have their locale specified either in a settings panel, or through 1033environment variables. 1034 1035 For some programs, it is possible to specify the locale through 1036environment variables, possibly even to a different locale than the 1037desktop’s locale. This means, instead of starting a program through a 1038menu or from the file system, you can start it from the command-line, 1039after having set some environment variables. The environment variables 1040can be those specified in the next section (*note Setting the POSIX 1041Locale::); for some versions of KDE, however, the locale is specified 1042through a variable ‘KDE_LANG’, rather than ‘LANG’ or ‘LC_ALL’. 1043 1044 1045File: gettext.info, Node: Setting the POSIX Locale, Next: Working in a Windows console, Prev: Setting the GUI Locale, Up: Users 1046 10472.3 Setting the Locale through Environment Variables 1048==================================================== 1049 1050 As a user, if your language has been installed for this package, in 1051the simplest case, you only have to set the ‘LANG’ environment variable 1052to the appropriate ‘LL_CC’ combination. For example, let’s suppose that 1053you speak German and live in Germany. At the shell prompt, merely 1054execute ‘setenv LANG de_DE’ (in ‘csh’), ‘export LANG; LANG=de_DE’ (in 1055‘sh’) or ‘export LANG=de_DE’ (in ‘bash’). This can be done from your 1056‘.login’ or ‘.profile’ file, once and for all. 1057 1058* Menu: 1059 1060* Locale Names:: How a Locale Specification Looks Like 1061* Locale Environment Variables:: Which Environment Variable Specfies What 1062* The LANGUAGE variable:: How to Specify a Priority List of Languages 1063 1064 1065File: gettext.info, Node: Locale Names, Next: Locale Environment Variables, Up: Setting the POSIX Locale 1066 10672.3.1 Locale Names 1068------------------ 1069 1070 A locale name usually has the form ‘LL_CC’. Here ‘LL’ is an ISO 639 1071two-letter language code, and ‘CC’ is an ISO 3166 two-letter country 1072code. For example, for German in Germany, LL is ‘de’, and CC is ‘DE’. 1073You find a list of the language codes in appendix *note Language Codes:: 1074and a list of the country codes in appendix *note Country Codes::. 1075 1076 You might think that the country code specification is redundant. 1077But in fact, some languages have dialects in different countries. For 1078example, ‘de_AT’ is used for Austria, and ‘pt_BR’ for Brazil. The 1079country code serves to distinguish the dialects. 1080 1081 Many locale names have an extended syntax ‘LL_CC.ENCODING’ that also 1082specifies the character encoding. These are in use because between 2000 1083and 2005, most users have switched to locales in UTF-8 encoding. For 1084example, the German locale on glibc systems is nowadays ‘de_DE.UTF-8’. 1085The older name ‘de_DE’ still refers to the German locale as of 2000 that 1086stores characters in ISO-8859-1 encoding – a text encoding that cannot 1087even accommodate the Euro currency sign. 1088 1089 Some locale names use ‘LL_CC@VARIANT’ instead of ‘LL_CC’. The 1090‘@VARIANT’ can denote any kind of characteristics that is not already 1091implied by the language LL and the country CC. It can denote a 1092particular monetary unit. For example, on glibc systems, ‘de_DE@euro’ 1093denotes the locale that uses the Euro currency, in contrast to the older 1094locale ‘de_DE’ which implies the use of the currency before 2002. It 1095can also denote a dialect of the language, or the script used to write 1096text (for example, ‘sr_RS@latin’ uses the Latin script, whereas ‘sr_RS’ 1097uses the Cyrillic script to write Serbian), or the orthography rules, or 1098similar. 1099 1100 On other systems, some variations of this scheme are used, such as 1101‘LL’. You can get the list of locales supported by your system for your 1102language by running the command ‘locale -a | grep '^LL'’. 1103 1104 There is also a special locale, called ‘C’. When it is used, it 1105disables all localization: in this locale, all programs standardized by 1106POSIX use English messages and an unspecified character encoding (often 1107US-ASCII, but sometimes also ISO-8859-1 or UTF-8, depending on the 1108operating system). 1109 1110 1111File: gettext.info, Node: Locale Environment Variables, Next: The LANGUAGE variable, Prev: Locale Names, Up: Setting the POSIX Locale 1112 11132.3.2 Locale Environment Variables 1114---------------------------------- 1115 1116 A locale is composed of several _locale categories_, see *note 1117Aspects::. When a program looks up locale dependent values, it does 1118this according to the following environment variables, in priority 1119order: 1120 1121 1. ‘LANGUAGE’ 1122 2. ‘LC_ALL’ 1123 3. ‘LC_xxx’, according to selected locale category: ‘LC_CTYPE’, 1124 ‘LC_NUMERIC’, ‘LC_TIME’, ‘LC_COLLATE’, ‘LC_MONETARY’, 1125 ‘LC_MESSAGES’, ... 1126 4. ‘LANG’ 1127 1128 Variables whose value is set but is empty are ignored in this lookup. 1129 1130 ‘LANG’ is the normal environment variable for specifying a locale. 1131As a user, you normally set this variable (unless some of the other 1132variables have already been set by the system, in ‘/etc/profile’ or 1133similar initialization files). 1134 1135 ‘LC_CTYPE’, ‘LC_NUMERIC’, ‘LC_TIME’, ‘LC_COLLATE’, ‘LC_MONETARY’, 1136‘LC_MESSAGES’, and so on, are the environment variables meant to 1137override ‘LANG’ and affecting a single locale category only. For 1138example, assume you are a Swedish user in Spain, and you want your 1139programs to handle numbers and dates according to Spanish conventions, 1140and only the messages should be in Swedish. Then you could create a 1141locale named ‘sv_ES’ or ‘sv_ES.UTF-8’ by use of the ‘localedef’ program. 1142But it is simpler, and achieves the same effect, to set the ‘LANG’ 1143variable to ‘es_ES.UTF-8’ and the ‘LC_MESSAGES’ variable to 1144‘sv_SE.UTF-8’; these two locales come already preinstalled with the 1145operating system. 1146 1147 ‘LC_ALL’ is an environment variable that overrides all of these. It 1148is typically used in scripts that run particular programs. For example, 1149‘configure’ scripts generated by GNU autoconf use ‘LC_ALL’ to make sure 1150that the configuration tests don’t operate in locale dependent ways. 1151 1152 Some systems, unfortunately, set ‘LC_ALL’ in ‘/etc/profile’ or in 1153similar initialization files. As a user, you therefore have to unset 1154this variable if you want to set ‘LANG’ and optionally some of the other 1155‘LC_xxx’ variables. 1156 1157 The ‘LANGUAGE’ variable is described in the next subsection. 1158 1159 1160File: gettext.info, Node: The LANGUAGE variable, Prev: Locale Environment Variables, Up: Setting the POSIX Locale 1161 11622.3.3 Specifying a Priority List of Languages 1163--------------------------------------------- 1164 1165 Not all programs have translations for all languages. By default, an 1166English message is shown in place of a nonexistent translation. If you 1167understand other languages, you can set up a priority list of languages. 1168This is done through a different environment variable, called 1169‘LANGUAGE’. GNU ‘gettext’ gives preference to ‘LANGUAGE’ over ‘LC_ALL’ 1170and ‘LANG’ for the purpose of message handling, but you still need to 1171have ‘LANG’ (or ‘LC_ALL’) set to the primary language; this is required 1172by other parts of the system libraries. For example, some Swedish users 1173who would rather read translations in German than English for when 1174Swedish is not available, set ‘LANGUAGE’ to ‘sv:de’ while leaving ‘LANG’ 1175to ‘sv_SE’. 1176 1177 Special advice for Norwegian users: The language code for Norwegian 1178bokmål changed from ‘no’ to ‘nb’ recently (in 2003). During the 1179transition period, while some message catalogs for this language are 1180installed under ‘nb’ and some older ones under ‘no’, it is recommended 1181for Norwegian users to set ‘LANGUAGE’ to ‘nb:no’ so that both newer and 1182older translations are used. 1183 1184 In the ‘LANGUAGE’ environment variable, but not in the other 1185environment variables, ‘LL_CC’ combinations can be abbreviated as ‘LL’ 1186to denote the language’s main dialect. For example, ‘de’ is equivalent 1187to ‘de_DE’ (German as spoken in Germany), and ‘pt’ to ‘pt_PT’ 1188(Portuguese as spoken in Portugal) in this context. 1189 1190 Note: The variable ‘LANGUAGE’ is ignored if the locale is set to ‘C’. 1191In other words, you have to first enable localization, by setting ‘LANG’ 1192(or ‘LC_ALL’) to a value other than ‘C’, before you can use a language 1193priority list through the ‘LANGUAGE’ variable. 1194 1195 1196File: gettext.info, Node: Working in a Windows console, Next: Installing Localizations, Prev: Setting the POSIX Locale, Up: Users 1197 11982.4 Obtaining good output in a Windows console 1199============================================== 1200 1201 On Windows, consoles such as the one started by the ‘cmd.exe’ program 1202do input and output in an encoding, called “OEM code page”, that is 1203different from the encoding that text-mode programs usually use, called 1204“ANSI code page”. (Note: This problem does not exist for Cygwin 1205consoles; these consoles do input and output in the UTF-8 encoding.) As 1206a workaround, you may request that the programs produce output in this 1207“OEM” encoding. To do so, set the environment variable ‘OUTPUT_CHARSET’ 1208to the “OEM” encoding, through a command such as 1209 set OUTPUT_CHARSET=CP850 1210 Note: This has an effect only on strings looked up in message 1211catalogs; other categories of text are usually not affected by this 1212setting. Note also that this environment variable also affects output 1213sent to a file or to a pipe; output to a file is most often expected to 1214be in the “ANSI” or in the UTF-8 encoding. 1215 1216 Here are examples of the “ANSI” and “OEM” code pages: 1217 1218Territories ANSI encoding OEM encoding 1219 1220--------------------------------------------------------------------------- 1221Western Europe CP1252 CP850 1222Slavic countries (Latin 2) CP1250 CP852 1223Baltic countries CP1257 CP775 1224Russia CP1251 CP866 1225 1226 1227File: gettext.info, Node: Installing Localizations, Prev: Working in a Windows console, Up: Users 1228 12292.5 Installing Translations for Particular Programs 1230=================================================== 1231 1232 Languages are not equally well supported in all packages using GNU 1233‘gettext’, and more translations are added over time. Usually, you use 1234the translations that are shipped with the operating system or with 1235particular packages that you install afterwards. But you can also 1236install newer localizations directly. For doing this, you will need an 1237understanding where each localization file is stored on the file system. 1238 1239 For programs that participate in the Translation Project, you can 1240start looking for translations here: 1241<https://translationproject.org/team/index.html>. 1242 1243 For programs that are part of the KDE project, the starting point is: 1244<https://l10n.kde.org/>. 1245 1246 For programs that are part of the GNOME project, the starting point 1247is: <https://wiki.gnome.org/TranslationProject>. 1248 1249 For other programs, you may check whether the program’s source code 1250package contains some ‘LL.po’ files; often they are kept together in a 1251directory called ‘po/’. Each ‘LL.po’ file contains the message 1252translations for the language whose abbreviation of LL. 1253 1254 1255File: gettext.info, Node: PO Files, Next: Sources, Prev: Users, Up: Top 1256 12573 The Format of PO Files 1258************************ 1259 1260 The GNU ‘gettext’ toolset helps programmers and translators at 1261producing, updating and using translation files, mainly those PO files 1262which are textual, editable files. This chapter explains the format of 1263PO files. 1264 1265 A PO file is made up of many entries, each entry holding the relation 1266between an original untranslated string and its corresponding 1267translation. All entries in a given PO file usually pertain to a single 1268project, and all translations are expressed in a single target language. 1269One PO file “entry” has the following schematic structure: 1270 1271 WHITE-SPACE 1272 # TRANSLATOR-COMMENTS 1273 #. EXTRACTED-COMMENTS 1274 #: REFERENCE... 1275 #, FLAG... 1276 #| msgid PREVIOUS-UNTRANSLATED-STRING 1277 msgid UNTRANSLATED-STRING 1278 msgstr TRANSLATED-STRING 1279 1280 The general structure of a PO file should be well understood by the 1281translator. When using PO mode, very little has to be known about the 1282format details, as PO mode takes care of them for her. 1283 1284 A simple entry can look like this: 1285 1286 #: lib/error.c:116 1287 msgid "Unknown system error" 1288 msgstr "Error desconegut del sistema" 1289 1290 Entries begin with some optional white space. Usually, when 1291generated through GNU ‘gettext’ tools, there is exactly one blank line 1292between entries. Then comments follow, on lines all starting with the 1293character ‘#’. There are two kinds of comments: those which have some 1294white space immediately following the ‘#’ - the TRANSLATOR COMMENTS -, 1295which comments are created and maintained exclusively by the translator, 1296and those which have some non-white character just after the ‘#’ - the 1297AUTOMATIC COMMENTS -, which comments are created and maintained 1298automatically by GNU ‘gettext’ tools. Comment lines starting with ‘#.’ 1299contain comments given by the programmer, directed at the translator; 1300these comments are called EXTRACTED COMMENTS because the ‘xgettext’ 1301program extracts them from the program’s source code. Comment lines 1302starting with ‘#:’ contain references to the program’s source code. 1303Comment lines starting with ‘#,’ contain flags; more about these below. 1304Comment lines starting with ‘#|’ contain the previous untranslated 1305string for which the translator gave a translation. 1306 1307 All comments, of either kind, are optional. 1308 1309 After white space and comments, entries show two strings, namely 1310first the untranslated string as it appears in the original program 1311sources, and then, the translation of this string. The original string 1312is introduced by the keyword ‘msgid’, and the translation, by ‘msgstr’. 1313The two strings, untranslated and translated, are quoted in various ways 1314in the PO file, using ‘"’ delimiters and ‘\’ escapes, but the translator 1315does not really have to pay attention to the precise quoting format, as 1316PO mode fully takes care of quoting for her. 1317 1318 The ‘msgid’ strings, as well as automatic comments, are produced and 1319managed by other GNU ‘gettext’ tools, and PO mode does not provide means 1320for the translator to alter these. The most she can do is merely 1321deleting them, and only by deleting the whole entry. On the other hand, 1322the ‘msgstr’ string, as well as translator comments, are really meant 1323for the translator, and PO mode gives her the full control she needs. 1324 1325 The comment lines beginning with ‘#,’ are special because they are 1326not completely ignored by the programs as comments generally are. The 1327comma separated list of FLAGs is used by the ‘msgfmt’ program to give 1328the user some better diagnostic messages. Currently there are two forms 1329of flags defined: 1330 1331‘fuzzy’ 1332 This flag can be generated by the ‘msgmerge’ program or it can be 1333 inserted by the translator herself. It shows that the ‘msgstr’ 1334 string might not be a correct translation (anymore). Only the 1335 translator can judge if the translation requires further 1336 modification, or is acceptable as is. Once satisfied with the 1337 translation, she then removes this ‘fuzzy’ attribute. The 1338 ‘msgmerge’ program inserts this when it combined the ‘msgid’ and 1339 ‘msgstr’ entries after fuzzy search only. *Note Fuzzy Entries::. 1340 1341‘c-format’ 1342‘no-c-format’ 1343 These flags should not be added by a human. Instead only the 1344 ‘xgettext’ program adds them. In an automated PO file processing 1345 system as proposed here, the user’s changes would be thrown away 1346 again as soon as the ‘xgettext’ program generates a new template 1347 file. 1348 1349 The ‘c-format’ flag indicates that the untranslated string and the 1350 translation are supposed to be C format strings. The ‘no-c-format’ 1351 flag indicates that they are not C format strings, even though the 1352 untranslated string happens to look like a C format string (with 1353 ‘%’ directives). 1354 1355 When the ‘c-format’ flag is given for a string the ‘msgfmt’ program 1356 does some more tests to check the validity of the translation. 1357 *Note msgfmt Invocation::, *note c-format Flag:: and *note 1358 c-format::. 1359 1360‘objc-format’ 1361‘no-objc-format’ 1362 Likewise for Objective C, see *note objc-format::. 1363 1364‘python-format’ 1365‘no-python-format’ 1366 Likewise for Python, see *note python-format::. 1367 1368‘python-brace-format’ 1369‘no-python-brace-format’ 1370 Likewise for Python brace, see *note python-format::. 1371 1372‘java-format’ 1373‘no-java-format’ 1374 Likewise for Java ‘MessageFormat’ format strings, see *note 1375 java-format::. 1376 1377‘java-printf-format’ 1378‘no-java-printf-format’ 1379 Likewise for Java ‘printf’ format strings, see *note java-format::. 1380 1381‘csharp-format’ 1382‘no-csharp-format’ 1383 Likewise for C#, see *note csharp-format::. 1384 1385‘javascript-format’ 1386‘no-javascript-format’ 1387 Likewise for JavaScript, see *note javascript-format::. 1388 1389‘scheme-format’ 1390‘no-scheme-format’ 1391 Likewise for Scheme, see *note scheme-format::. 1392 1393‘lisp-format’ 1394‘no-lisp-format’ 1395 Likewise for Lisp, see *note lisp-format::. 1396 1397‘elisp-format’ 1398‘no-elisp-format’ 1399 Likewise for Emacs Lisp, see *note elisp-format::. 1400 1401‘librep-format’ 1402‘no-librep-format’ 1403 Likewise for librep, see *note librep-format::. 1404 1405‘ruby-format’ 1406‘no-ruby-format’ 1407 Likewise for Ruby, see *note ruby-format::. 1408 1409‘sh-format’ 1410‘no-sh-format’ 1411 Likewise for Shell, see *note sh-format::. 1412 1413‘awk-format’ 1414‘no-awk-format’ 1415 Likewise for awk, see *note awk-format::. 1416 1417‘lua-format’ 1418‘no-lua-format’ 1419 Likewise for Lua, see *note lua-format::. 1420 1421‘object-pascal-format’ 1422‘no-object-pascal-format’ 1423 Likewise for Object Pascal, see *note object-pascal-format::. 1424 1425‘smalltalk-format’ 1426‘no-smalltalk-format’ 1427 Likewise for Smalltalk, see *note smalltalk-format::. 1428 1429‘qt-format’ 1430‘no-qt-format’ 1431 Likewise for Qt, see *note qt-format::. 1432 1433‘qt-plural-format’ 1434‘no-qt-plural-format’ 1435 Likewise for Qt plural forms, see *note qt-plural-format::. 1436 1437‘kde-format’ 1438‘no-kde-format’ 1439 Likewise for KDE, see *note kde-format::. 1440 1441‘boost-format’ 1442‘no-boost-format’ 1443 Likewise for Boost, see *note boost-format::. 1444 1445‘tcl-format’ 1446‘no-tcl-format’ 1447 Likewise for Tcl, see *note tcl-format::. 1448 1449‘perl-format’ 1450‘no-perl-format’ 1451 Likewise for Perl, see *note perl-format::. 1452 1453‘perl-brace-format’ 1454‘no-perl-brace-format’ 1455 Likewise for Perl brace, see *note perl-format::. 1456 1457‘php-format’ 1458‘no-php-format’ 1459 Likewise for PHP, see *note php-format::. 1460 1461‘gcc-internal-format’ 1462‘no-gcc-internal-format’ 1463 Likewise for the GCC sources, see *note gcc-internal-format::. 1464 1465‘gfc-internal-format’ 1466‘no-gfc-internal-format’ 1467 Likewise for the GNU Fortran Compiler sources, see *note 1468 gfc-internal-format::. 1469 1470‘ycp-format’ 1471‘no-ycp-format’ 1472 Likewise for YCP, see *note ycp-format::. 1473 1474 It is also possible to have entries with a context specifier. They 1475look like this: 1476 1477 WHITE-SPACE 1478 # TRANSLATOR-COMMENTS 1479 #. EXTRACTED-COMMENTS 1480 #: REFERENCE... 1481 #, FLAG... 1482 #| msgctxt PREVIOUS-CONTEXT 1483 #| msgid PREVIOUS-UNTRANSLATED-STRING 1484 msgctxt CONTEXT 1485 msgid UNTRANSLATED-STRING 1486 msgstr TRANSLATED-STRING 1487 1488 The context serves to disambiguate messages with the same 1489UNTRANSLATED-STRING. It is possible to have several entries with the 1490same UNTRANSLATED-STRING in a PO file, provided that they each have a 1491different CONTEXT. Note that an empty CONTEXT string and an absent 1492‘msgctxt’ line do not mean the same thing. 1493 1494 A different kind of entries is used for translations which involve 1495plural forms. 1496 1497 WHITE-SPACE 1498 # TRANSLATOR-COMMENTS 1499 #. EXTRACTED-COMMENTS 1500 #: REFERENCE... 1501 #, FLAG... 1502 #| msgid PREVIOUS-UNTRANSLATED-STRING-SINGULAR 1503 #| msgid_plural PREVIOUS-UNTRANSLATED-STRING-PLURAL 1504 msgid UNTRANSLATED-STRING-SINGULAR 1505 msgid_plural UNTRANSLATED-STRING-PLURAL 1506 msgstr[0] TRANSLATED-STRING-CASE-0 1507 ... 1508 msgstr[N] TRANSLATED-STRING-CASE-N 1509 1510 Such an entry can look like this: 1511 1512 #: src/msgcmp.c:338 src/po-lex.c:699 1513 #, c-format 1514 msgid "found %d fatal error" 1515 msgid_plural "found %d fatal errors" 1516 msgstr[0] "s'ha trobat %d error fatal" 1517 msgstr[1] "s'han trobat %d errors fatals" 1518 1519 Here also, a ‘msgctxt’ context can be specified before ‘msgid’, like 1520above. 1521 1522 Here, additional kinds of flags can be used: 1523 1524‘range:’ 1525 This flag is followed by a range of non-negative numbers, using the 1526 syntax ‘range: MINIMUM-VALUE..MAXIMUM-VALUE’. It designates the 1527 possible values that the numeric parameter of the message can take. 1528 In some languages, translators may produce slightly better 1529 translations if they know that the value can only take on values 1530 between 0 and 10, for example. 1531 1532 The PREVIOUS-UNTRANSLATED-STRING is optionally inserted by the 1533‘msgmerge’ program, at the same time when it marks a message fuzzy. It 1534helps the translator to see which changes were done by the developers on 1535the UNTRANSLATED-STRING. 1536 1537 It happens that some lines, usually whitespace or comments, follow 1538the very last entry of a PO file. Such lines are not part of any entry, 1539and will be dropped when the PO file is processed by the tools, or may 1540disturb some PO file editors. 1541 1542 The remainder of this section may be safely skipped by those using a 1543PO file editor, yet it may be interesting for everybody to have a better 1544idea of the precise format of a PO file. On the other hand, those 1545wishing to modify PO files by hand should carefully continue reading on. 1546 1547 An empty UNTRANSLATED-STRING is reserved to contain the header entry 1548with the meta information (*note Header Entry::). This header entry 1549should be the first entry of the file. The empty UNTRANSLATED-STRING is 1550reserved for this purpose and must not be used anywhere else. 1551 1552 Each of UNTRANSLATED-STRING and TRANSLATED-STRING respects the C 1553syntax for a character string, including the surrounding quotes and 1554embedded backslashed escape sequences. When the time comes to write 1555multi-line strings, one should not use escaped newlines. Instead, a 1556closing quote should follow the last character on the line to be 1557continued, and an opening quote should resume the string at the 1558beginning of the following PO file line. For example: 1559 1560 msgid "" 1561 "Here is an example of how one might continue a very long string\n" 1562 "for the common case the string represents multi-line output.\n" 1563 1564In this example, the empty string is used on the first line, to allow 1565better alignment of the ‘H’ from the word ‘Here’ over the ‘f’ from the 1566word ‘for’. In this example, the ‘msgid’ keyword is followed by three 1567strings, which are meant to be concatenated. Concatenating the empty 1568string does not change the resulting overall string, but it is a way for 1569us to comply with the necessity of ‘msgid’ to be followed by a string on 1570the same line, while keeping the multi-line presentation left-justified, 1571as we find this to be a cleaner disposition. The empty string could 1572have been omitted, but only if the string starting with ‘Here’ was 1573promoted on the first line, right after ‘msgid’.(1) It was not really 1574necessary either to switch between the two last quoted strings 1575immediately after the newline ‘\n’, the switch could have occurred after 1576_any_ other character, we just did it this way because it is neater. 1577 1578 One should carefully distinguish between end of lines marked as ‘\n’ 1579_inside_ quotes, which are part of the represented string, and end of 1580lines in the PO file itself, outside string quotes, which have no 1581incidence on the represented string. 1582 1583 Outside strings, white lines and comments may be used freely. 1584Comments start at the beginning of a line with ‘#’ and extend until the 1585end of the PO file line. Comments written by translators should have 1586the initial ‘#’ immediately followed by some white space. If the ‘#’ is 1587not immediately followed by white space, this comment is most likely 1588generated and managed by specialized GNU tools, and might disappear or 1589be replaced unexpectedly when the PO file is given to ‘msgmerge’. 1590 1591 ---------- Footnotes ---------- 1592 1593 (1) This limitation is not imposed by GNU ‘gettext’, but is for 1594compatibility with the ‘msgfmt’ implementation on Solaris. 1595 1596 1597File: gettext.info, Node: Sources, Next: Template, Prev: PO Files, Up: Top 1598 15994 Preparing Program Sources 1600*************************** 1601 1602 For the programmer, changes to the C source code fall into three 1603categories. First, you have to make the localization functions known to 1604all modules needing message translation. Second, you should properly 1605trigger the operation of GNU ‘gettext’ when the program initializes, 1606usually from the ‘main’ function. Last, you should identify, adjust and 1607mark all constant strings in your program needing translation. 1608 1609* Menu: 1610 1611* Importing:: Importing the ‘gettext’ declaration 1612* Triggering:: Triggering ‘gettext’ Operations 1613* Preparing Strings:: Preparing Translatable Strings 1614* Mark Keywords:: How Marks Appear in Sources 1615* Marking:: Marking Translatable Strings 1616* c-format Flag:: Telling something about the following string 1617* Special cases:: Special Cases of Translatable Strings 1618* Bug Report Address:: Letting Users Report Translation Bugs 1619* Names:: Marking Proper Names for Translation 1620* Libraries:: Preparing Library Sources 1621 1622 1623File: gettext.info, Node: Importing, Next: Triggering, Up: Sources 1624 16254.1 Importing the ‘gettext’ declaration 1626======================================= 1627 1628 Presuming that your set of programs, or package, has been adjusted so 1629all needed GNU ‘gettext’ files are available, and your ‘Makefile’ files 1630are adjusted (*note Maintainers::), each C module having translated C 1631strings should contain the line: 1632 1633 #include <libintl.h> 1634 1635 Similarly, each C module containing ‘printf()’/‘fprintf()’/... calls 1636with a format string that could be a translated C string (even if the C 1637string comes from a different C module) should contain the line: 1638 1639 #include <libintl.h> 1640 1641 1642File: gettext.info, Node: Triggering, Next: Preparing Strings, Prev: Importing, Up: Sources 1643 16444.2 Triggering ‘gettext’ Operations 1645=================================== 1646 1647 The initialization of locale data should be done with more or less 1648the same code in every program, as demonstrated below: 1649 1650 int 1651 main (int argc, char *argv[]) 1652 { 1653 ... 1654 setlocale (LC_ALL, ""); 1655 bindtextdomain (PACKAGE, LOCALEDIR); 1656 textdomain (PACKAGE); 1657 ... 1658 } 1659 1660 PACKAGE and LOCALEDIR should be provided either by ‘config.h’ or by 1661the Makefile. For now consult the ‘gettext’ or ‘hello’ sources for more 1662information. 1663 1664 The use of ‘LC_ALL’ might not be appropriate for you. ‘LC_ALL’ 1665includes all locale categories and especially ‘LC_CTYPE’. This latter 1666category is responsible for determining character classes with the 1667‘isalnum’ etc. functions from ‘ctype.h’ which could especially for 1668programs, which process some kind of input language, be wrong. For 1669example this would mean that a source code using the ç (c-cedilla 1670character) is runnable in France but not in the U.S. 1671 1672 Some systems also have problems with parsing numbers using the 1673‘scanf’ functions if an other but the ‘LC_ALL’ locale category is used. 1674The standards say that additional formats but the one known in the ‘"C"’ 1675locale might be recognized. But some systems seem to reject numbers in 1676the ‘"C"’ locale format. In some situation, it might also be a problem 1677with the notation itself which makes it impossible to recognize whether 1678the number is in the ‘"C"’ locale or the local format. This can happen 1679if thousands separator characters are used. Some locales define this 1680character according to the national conventions to ‘'.'’ which is the 1681same character used in the ‘"C"’ locale to denote the decimal point. 1682 1683 So it is sometimes necessary to replace the ‘LC_ALL’ line in the code 1684above by a sequence of ‘setlocale’ lines 1685 1686 { 1687 ... 1688 setlocale (LC_CTYPE, ""); 1689 setlocale (LC_MESSAGES, ""); 1690 ... 1691 } 1692 1693On all POSIX conformant systems the locale categories ‘LC_CTYPE’, 1694‘LC_MESSAGES’, ‘LC_COLLATE’, ‘LC_MONETARY’, ‘LC_NUMERIC’, and ‘LC_TIME’ 1695are available. On some systems which are only ISO C compliant, 1696‘LC_MESSAGES’ is missing, but a substitute for it is defined in GNU 1697gettext’s ‘<libintl.h>’ and in GNU gnulib’s ‘<locale.h>’. 1698 1699 Note that changing the ‘LC_CTYPE’ also affects the functions declared 1700in the ‘<ctype.h>’ standard header and some functions declared in the 1701‘<string.h>’ and ‘<stdlib.h>’ standard headers. If this is not 1702desirable in your application (for example in a compiler’s parser), you 1703can use a set of substitute functions which hardwire the C locale, such 1704as found in the modules ‘c-ctype’, ‘c-strcase’, ‘c-strcasestr’, 1705‘c-strtod’, ‘c-strtold’ in the GNU gnulib source distribution. 1706 1707 It is also possible to switch the locale forth and back between the 1708environment dependent locale and the C locale, but this approach is 1709normally avoided because a ‘setlocale’ call is expensive, because it is 1710tedious to determine the places where a locale switch is needed in a 1711large program’s source, and because switching a locale is not 1712multithread-safe. 1713 1714 1715File: gettext.info, Node: Preparing Strings, Next: Mark Keywords, Prev: Triggering, Up: Sources 1716 17174.3 Preparing Translatable Strings 1718================================== 1719 1720 Before strings can be marked for translations, they sometimes need to 1721be adjusted. Usually preparing a string for translation is done right 1722before marking it, during the marking phase which is described in the 1723next sections. What you have to keep in mind while doing that is the 1724following. 1725 1726 • Decent English style. 1727 1728 • Entire sentences. 1729 1730 • Split at paragraphs. 1731 1732 • Use format strings instead of string concatenation. 1733 1734 • Use placeholders in format strings instead of embedded URLs. 1735 1736 • Avoid unusual markup and unusual control characters. 1737 1738Let’s look at some examples of these guidelines. 1739 1740Decent English style 1741-------------------- 1742 1743 Translatable strings should be in good English style. If slang 1744language with abbreviations and shortcuts is used, often translators 1745will not understand the message and will produce very inappropriate 1746translations. 1747 1748 "%s: is parameter\n" 1749 1750This is nearly untranslatable: Is the displayed item _a_ parameter or 1751_the_ parameter? 1752 1753 "No match" 1754 1755The ambiguity in this message makes it unintelligible: Is the program 1756attempting to set something on fire? Does it mean "The given object 1757does not match the template"? Does it mean "The template does not fit 1758for any of the objects"? 1759 1760 In both cases, adding more words to the message will help both the 1761translator and the English speaking user. 1762 1763Entire sentences 1764---------------- 1765 1766 Translatable strings should be entire sentences. It is often not 1767possible to translate single verbs or adjectives in a substitutable way. 1768 1769 printf ("File %s is %s protected", filename, rw ? "write" : "read"); 1770 1771Most translators will not look at the source and will thus only see the 1772string ‘"File %s is %s protected"’, which is unintelligible. Change 1773this to 1774 1775 printf (rw ? "File %s is write protected" : "File %s is read protected", 1776 filename); 1777 1778This way the translator will not only understand the message, she will 1779also be able to find the appropriate grammatical construction. A French 1780translator for example translates "write protected" like "protected 1781against writing". 1782 1783 Entire sentences are also important because in many languages, the 1784declination of some word in a sentence depends on the gender or the 1785number (singular/plural) of another part of the sentence. There are 1786usually more interdependencies between words than in English. The 1787consequence is that asking a translator to translate two half-sentences 1788and then combining these two half-sentences through dumb string 1789concatenation will not work, for many languages, even though it would 1790work for English. That’s why translators need to handle entire 1791sentences. 1792 1793 Often sentences don’t fit into a single line. If a sentence is 1794output using two subsequent ‘printf’ statements, like this 1795 1796 printf ("Locale charset \"%s\" is different from\n", lcharset); 1797 printf ("input file charset \"%s\".\n", fcharset); 1798 1799the translator would have to translate two half sentences, but nothing 1800in the POT file would tell her that the two half sentences belong 1801together. It is necessary to merge the two ‘printf’ statements so that 1802the translator can handle the entire sentence at once and decide at 1803which place to insert a line break in the translation (if at all): 1804 1805 printf ("Locale charset \"%s\" is different from\n\ 1806 input file charset \"%s\".\n", lcharset, fcharset); 1807 1808 You may now ask: how about two or more adjacent sentences? Like in 1809this case: 1810 1811 puts ("Apollo 13 scenario: Stack overflow handling failed."); 1812 puts ("On the next stack overflow we will crash!!!"); 1813 1814Should these two statements merged into a single one? I would recommend 1815to merge them if the two sentences are related to each other, because 1816then it makes it easier for the translator to understand and translate 1817both. On the other hand, if one of the two messages is a stereotypic 1818one, occurring in other places as well, you will do a favour to the 1819translator by not merging the two. (Identical messages occurring in 1820several places are combined by xgettext, so the translator has to handle 1821them once only.) 1822 1823Split at paragraphs 1824------------------- 1825 1826 Translatable strings should be limited to one paragraph; don’t let a 1827single message be longer than ten lines. The reason is that when the 1828translatable string changes, the translator is faced with the task of 1829updating the entire translated string. Maybe only a single word will 1830have changed in the English string, but the translator doesn’t see that 1831(with the current translation tools), therefore she has to proofread the 1832entire message. 1833 1834 Many GNU programs have a ‘--help’ output that extends over several 1835screen pages. It is a courtesy towards the translators to split such a 1836message into several ones of five to ten lines each. While doing that, 1837you can also attempt to split the documented options into groups, such 1838as the input options, the output options, and the informative output 1839options. This will help every user to find the option he is looking 1840for. 1841 1842No string concatenation 1843----------------------- 1844 1845 Hardcoded string concatenation is sometimes used to construct English 1846strings: 1847 1848 strcpy (s, "Replace "); 1849 strcat (s, object1); 1850 strcat (s, " with "); 1851 strcat (s, object2); 1852 strcat (s, "?"); 1853 1854In order to present to the translator only entire sentences, and also 1855because in some languages the translator might want to swap the order of 1856‘object1’ and ‘object2’, it is necessary to change this to use a format 1857string: 1858 1859 sprintf (s, "Replace %s with %s?", object1, object2); 1860 1861 A similar case is compile time concatenation of strings. The ISO C 186299 include file ‘<inttypes.h>’ contains a macro ‘PRId64’ that can be 1863used as a formatting directive for outputting an ‘int64_t’ integer 1864through ‘printf’. It expands to a constant string, usually "d" or "ld" 1865or "lld" or something like this, depending on the platform. Assume you 1866have code like 1867 1868 printf ("The amount is %0" PRId64 "\n", number); 1869 1870The ‘gettext’ tools and library have special support for these 1871‘<inttypes.h>’ macros. You can therefore simply write 1872 1873 printf (gettext ("The amount is %0" PRId64 "\n"), number); 1874 1875The PO file will contain the string "The amount is %0<PRId64>\n". The 1876translators will provide a translation containing "%0<PRId64>" as well, 1877and at runtime the ‘gettext’ function’s result will contain the 1878appropriate constant string, "d" or "ld" or "lld". 1879 1880 This works only for the predefined ‘<inttypes.h>’ macros. If you 1881have defined your own similar macros, let’s say ‘MYPRId64’, that are not 1882known to ‘xgettext’, the solution for this problem is to change the code 1883like this: 1884 1885 char buf1[100]; 1886 sprintf (buf1, "%0" MYPRId64, number); 1887 printf (gettext ("The amount is %s\n"), buf1); 1888 1889 This means, you put the platform dependent code in one statement, and 1890the internationalization code in a different statement. Note that a 1891buffer length of 100 is safe, because all available hardware integer 1892types are limited to 128 bits, and to print a 128 bit integer one needs 1893at most 54 characters, regardless whether in decimal, octal or 1894hexadecimal. 1895 1896 All this applies to other programming languages as well. For 1897example, in Java and C#, string concatenation is very frequently used, 1898because it is a compiler built-in operator. Like in C, in Java, you 1899would change 1900 1901 System.out.println("Replace "+object1+" with "+object2+"?"); 1902 1903into a statement involving a format string: 1904 1905 System.out.println( 1906 MessageFormat.format("Replace {0} with {1}?", 1907 new Object[] { object1, object2 })); 1908 1909Similarly, in C#, you would change 1910 1911 Console.WriteLine("Replace "+object1+" with "+object2+"?"); 1912 1913into a statement involving a format string: 1914 1915 Console.WriteLine( 1916 String.Format("Replace {0} with {1}?", object1, object2)); 1917 1918No embedded URLs 1919---------------- 1920 1921 It is good to not embed URLs in translatable strings, for several 1922reasons: 1923 • It avoids possible mistakes during copy and paste. 1924 • Translators cannot translate the URLs or, by mistake, use the URLs 1925 from other packages that are present in their compendium. 1926 • When the URLs change, translators don’t need to revisit the 1927 translation of the string. 1928 1929 The same holds for email addresses. 1930 1931 So, you would change 1932 1933 fputs (_("GNU GPL version 3 <https://gnu.org/licenses/gpl.html>\n"), 1934 stream); 1935 1936to 1937 1938 fprintf (stream, _("GNU GPL version 3 <%s>\n"), 1939 "https://gnu.org/licenses/gpl.html"); 1940 1941No unusual markup 1942----------------- 1943 1944 Unusual markup or control characters should not be used in 1945translatable strings. Translators will likely not understand the 1946particular meaning of the markup or control characters. 1947 1948 For example, if you have a convention that ‘|’ delimits the left-hand 1949and right-hand part of some GUI elements, translators will often not 1950understand it without specific comments. It might be better to have the 1951translator translate the left-hand and right-hand part separately. 1952 1953 Another example is the ‘argp’ convention to use a single ‘\v’ 1954(vertical tab) control character to delimit two sections inside a 1955string. This is flawed. Some translators may convert it to a simple 1956newline, some to blank lines. With some PO file editors it may not be 1957easy to even enter a vertical tab control character. So, you cannot be 1958sure that the translation will contain a ‘\v’ character, at the 1959corresponding position. The solution is, again, to let the translator 1960translate two separate strings and combine at run-time the two 1961translated strings with the ‘\v’ required by the convention. 1962 1963 HTML markup, however, is common enough that it’s probably ok to use 1964in translatable strings. But please bear in mind that the GNU gettext 1965tools don’t verify that the translations are well-formed HTML. 1966 1967 1968File: gettext.info, Node: Mark Keywords, Next: Marking, Prev: Preparing Strings, Up: Sources 1969 19704.4 How Marks Appear in Sources 1971=============================== 1972 1973 All strings requiring translation should be marked in the C sources. 1974Marking is done in such a way that each translatable string appears to 1975be the sole argument of some function or preprocessor macro. There are 1976only a few such possible functions or macros meant for translation, and 1977their names are said to be marking keywords. The marking is attached to 1978strings themselves, rather than to what we do with them. This approach 1979has more uses. A blatant example is an error message produced by 1980formatting. The format string needs translation, as well as some 1981strings inserted through some ‘%s’ specification in the format, while 1982the result from ‘sprintf’ may have so many different instances that it 1983is impractical to list them all in some ‘error_string_out()’ routine, 1984say. 1985 1986 This marking operation has two goals. The first goal of marking is 1987for triggering the retrieval of the translation, at run time. The 1988keyword is possibly resolved into a routine able to dynamically return 1989the proper translation, as far as possible or wanted, for the argument 1990string. Most localizable strings are found in executable positions, 1991that is, attached to variables or given as parameters to functions. But 1992this is not universal usage, and some translatable strings appear in 1993structured initializations. *Note Special cases::. 1994 1995 The second goal of the marking operation is to help ‘xgettext’ at 1996properly extracting all translatable strings when it scans a set of 1997program sources and produces PO file templates. 1998 1999 The canonical keyword for marking translatable strings is ‘gettext’, 2000it gave its name to the whole GNU ‘gettext’ package. For packages 2001making only light use of the ‘gettext’ keyword, macro or function, it is 2002easily used _as is_. However, for packages using the ‘gettext’ 2003interface more heavily, it is usually more convenient to give the main 2004keyword a shorter, less obtrusive name. Indeed, the keyword might 2005appear on a lot of strings all over the package, and programmers usually 2006do not want nor need their program sources to remind them forcefully, 2007all the time, that they are internationalized. Further, a long keyword 2008has the disadvantage of using more horizontal space, forcing more 2009indentation work on sources for those trying to keep them within 79 or 201080 columns. 2011 2012 Many packages use ‘_’ (a simple underline) as a keyword, and write 2013‘_("Translatable string")’ instead of ‘gettext ("Translatable string")’. 2014Further, the coding rule, from GNU standards, wanting that there is a 2015space between the keyword and the opening parenthesis is relaxed, in 2016practice, for this particular usage. So, the textual overhead per 2017translatable string is reduced to only three characters: the underline 2018and the two parentheses. However, even if GNU ‘gettext’ uses this 2019convention internally, it does not offer it officially. The real, 2020genuine keyword is truly ‘gettext’ indeed. It is fairly easy for those 2021wanting to use ‘_’ instead of ‘gettext’ to declare: 2022 2023 #include <libintl.h> 2024 #define _(String) gettext (String) 2025 2026instead of merely using ‘#include <libintl.h>’. 2027 2028 The marking keywords ‘gettext’ and ‘_’ take the translatable string 2029as sole argument. It is also possible to define marking functions that 2030take it at another argument position. It is even possible to make the 2031marked argument position depend on the total number of arguments of the 2032function call; this is useful in C++. All this is achieved using 2033‘xgettext’’s ‘--keyword’ option. How to pass such an option to 2034‘xgettext’, assuming that ‘gettextize’ is used, is described in *note 2035po/Makevars:: and *note AM_XGETTEXT_OPTION::. 2036 2037 Note also that long strings can be split across lines, into multiple 2038adjacent string tokens. Automatic string concatenation is performed at 2039compile time according to ISO C and ISO C++; ‘xgettext’ also supports 2040this syntax. 2041 2042 Later on, the maintenance is relatively easy. If, as a programmer, 2043you add or modify a string, you will have to ask yourself if the new or 2044altered string requires translation, and include it within ‘_()’ if you 2045think it should be translated. For example, ‘"%s"’ is an example of 2046string _not_ requiring translation. But ‘"%s: %d"’ _does_ require 2047translation, because in French, unlike in English, it’s customary to put 2048a space before a colon. 2049 2050 2051File: gettext.info, Node: Marking, Next: c-format Flag, Prev: Mark Keywords, Up: Sources 2052 20534.5 Marking Translatable Strings 2054================================ 2055 2056 In PO mode, one set of features is meant more for the programmer than 2057for the translator, and allows him to interactively mark which strings, 2058in a set of program sources, are translatable, and which are not. Even 2059if it is a fairly easy job for a programmer to find and mark such 2060strings by other means, using any editor of his choice, PO mode makes 2061this work more comfortable. Further, this gives translators who feel a 2062little like programmers, or programmers who feel a little like 2063translators, a tool letting them work at marking translatable strings in 2064the program sources, while simultaneously producing a set of translation 2065in some language, for the package being internationalized. 2066 2067 The set of program sources, targeted by the PO mode commands describe 2068here, should have an Emacs tags table constructed for your project, 2069prior to using these PO file commands. This is easy to do. In any 2070shell window, change the directory to the root of your project, then 2071execute a command resembling: 2072 2073 etags src/*.[hc] lib/*.[hc] 2074 2075presuming here you want to process all ‘.h’ and ‘.c’ files from the 2076‘src/’ and ‘lib/’ directories. This command will explore all said files 2077and create a ‘TAGS’ file in your root directory, somewhat summarizing 2078the contents using a special file format Emacs can understand. 2079 2080 For packages following the GNU coding standards, there is a make goal 2081‘tags’ or ‘TAGS’ which constructs the tag files in all directories and 2082for all files containing source code. 2083 2084 Once your ‘TAGS’ file is ready, the following commands assist the 2085programmer at marking translatable strings in his set of sources. But 2086these commands are necessarily driven from within a PO file window, and 2087it is likely that you do not even have such a PO file yet. This is not 2088a problem at all, as you may safely open a new, empty PO file, mainly 2089for using these commands. This empty PO file will slowly fill in while 2090you mark strings as translatable in your program sources. 2091 2092‘,’ 2093 Search through program sources for a string which looks like a 2094 candidate for translation (‘po-tags-search’). 2095 2096‘M-,’ 2097 Mark the last string found with ‘_()’ (‘po-mark-translatable’). 2098 2099‘M-.’ 2100 Mark the last string found with a keyword taken from a set of 2101 possible keywords. This command with a prefix allows some 2102 management of these keywords (‘po-select-mark-and-mark’). 2103 2104 The ‘,’ (‘po-tags-search’) command searches for the next occurrence 2105of a string which looks like a possible candidate for translation, and 2106displays the program source in another Emacs window, positioned in such 2107a way that the string is near the top of this other window. If the 2108string is too big to fit whole in this window, it is positioned so only 2109its end is shown. In any case, the cursor is left in the PO file 2110window. If the shown string would be better presented differently in 2111different native languages, you may mark it using ‘M-,’ or ‘M-.’. 2112Otherwise, you might rather ignore it and skip to the next string by 2113merely repeating the ‘,’ command. 2114 2115 A string is a good candidate for translation if it contains a 2116sequence of three or more letters. A string containing at most two 2117letters in a row will be considered as a candidate if it has more 2118letters than non-letters. The command disregards strings containing no 2119letters, or isolated letters only. It also disregards strings within 2120comments, or strings already marked with some keyword PO mode knows (see 2121below). 2122 2123 If you have never told Emacs about some ‘TAGS’ file to use, the 2124command will request that you specify one from the minibuffer, the first 2125time you use the command. You may later change your ‘TAGS’ file by 2126using the regular Emacs command ‘M-x visit-tags-table’, which will ask 2127you to name the precise ‘TAGS’ file you want to use. *Note Tag Tables: 2128(emacs)Tags. 2129 2130 Each time you use the ‘,’ command, the search resumes from where it 2131was left by the previous search, and goes through all program sources, 2132obeying the ‘TAGS’ file, until all sources have been processed. 2133However, by giving a prefix argument to the command (‘C-u ,’), you may 2134request that the search be restarted all over again from the first 2135program source; but in this case, strings that you recently marked as 2136translatable will be automatically skipped. 2137 2138 Using this ‘,’ command does not prevent using of other regular Emacs 2139tags commands. For example, regular ‘tags-search’ or 2140‘tags-query-replace’ commands may be used without disrupting the 2141independent ‘,’ search sequence. However, as implemented, the _initial_ 2142‘,’ command (or the ‘,’ command is used with a prefix) might also 2143reinitialize the regular Emacs tags searching to the first tags file, 2144this reinitialization might be considered spurious. 2145 2146 The ‘M-,’ (‘po-mark-translatable’) command will mark the recently 2147found string with the ‘_’ keyword. The ‘M-.’ 2148(‘po-select-mark-and-mark’) command will request that you type one 2149keyword from the minibuffer and use that keyword for marking the string. 2150Both commands will automatically create a new PO file untranslated entry 2151for the string being marked, and make it the current entry (making it 2152easy for you to immediately proceed to its translation, if you feel like 2153doing it right away). It is possible that the modifications made to the 2154program source by ‘M-,’ or ‘M-.’ render some source line longer than 80 2155columns, forcing you to break and re-indent this line differently. You 2156may use the ‘O’ command from PO mode, or any other window changing 2157command from Emacs, to break out into the program source window, and do 2158any needed adjustments. You will have to use some regular Emacs command 2159to return the cursor to the PO file window, if you want command ‘,’ for 2160the next string, say. 2161 2162 The ‘M-.’ command has a few built-in speedups, so you do not have to 2163explicitly type all keywords all the time. The first such speedup is 2164that you are presented with a _preferred_ keyword, which you may accept 2165by merely typing ‘<RET>’ at the prompt. The second speedup is that you 2166may type any non-ambiguous prefix of the keyword you really mean, and 2167the command will complete it automatically for you. This also means 2168that PO mode has to _know_ all your possible keywords, and that it will 2169not accept mistyped keywords. 2170 2171 If you reply ‘?’ to the keyword request, the command gives a list of 2172all known keywords, from which you may choose. When the command is 2173prefixed by an argument (‘C-u M-.’), it inhibits updating any program 2174source or PO file buffer, and does some simple keyword management 2175instead. In this case, the command asks for a keyword, written in full, 2176which becomes a new allowed keyword for later ‘M-.’ commands. Moreover, 2177this new keyword automatically becomes the _preferred_ keyword for later 2178commands. By typing an already known keyword in response to ‘C-u M-.’, 2179one merely changes the _preferred_ keyword and does nothing more. 2180 2181 All keywords known for ‘M-.’ are recognized by the ‘,’ command when 2182scanning for strings, and strings already marked by any of those known 2183keywords are automatically skipped. If many PO files are opened 2184simultaneously, each one has its own independent set of known keywords. 2185There is no provision in PO mode, currently, for deleting a known 2186keyword, you have to quit the file (maybe using ‘q’) and reopen it 2187afresh. When a PO file is newly brought up in an Emacs window, only 2188‘gettext’ and ‘_’ are known as keywords, and ‘gettext’ is preferred for 2189the ‘M-.’ command. In fact, this is not useful to prefer ‘_’, as this 2190one is already built in the ‘M-,’ command. 2191 2192 2193File: gettext.info, Node: c-format Flag, Next: Special cases, Prev: Marking, Up: Sources 2194 21954.6 Special Comments preceding Keywords 2196======================================= 2197 2198 In C programs strings are often used within calls of functions from 2199the ‘printf’ family. The special thing about these format strings is 2200that they can contain format specifiers introduced with ‘%’. Assume we 2201have the code 2202 2203 printf (gettext ("String `%s' has %d characters\n"), s, strlen (s)); 2204 2205A possible German translation for the above string might be: 2206 2207 "%d Zeichen lang ist die Zeichenkette `%s'" 2208 2209 A C programmer, even if he cannot speak German, will recognize that 2210there is something wrong here. The order of the two format specifiers 2211is changed but of course the arguments in the ‘printf’ don’t have. This 2212will most probably lead to problems because now the length of the string 2213is regarded as the address. 2214 2215 To prevent errors at runtime caused by translations, the ‘msgfmt’ 2216tool can check statically whether the arguments in the original and the 2217translation string match in type and number. If this is not the case 2218and the ‘-c’ option has been passed to ‘msgfmt’, ‘msgfmt’ will give an 2219error and refuse to produce a MO file. Thus consistent use of ‘msgfmt 2220-c’ will catch the error, so that it cannot cause problems at runtime. 2221 2222If the word order in the above German translation would be correct one 2223would have to write 2224 2225 "%2$d Zeichen lang ist die Zeichenkette `%1$s'" 2226 2227The routines in ‘msgfmt’ know about this special notation. 2228 2229 Because not all strings in a program will be format strings, it is 2230not useful for ‘msgfmt’ to test all the strings in the ‘.po’ file. This 2231might cause problems because the string might contain what looks like a 2232format specifier, but the string is not used in ‘printf’. 2233 2234 Therefore ‘xgettext’ adds a special tag to those messages it thinks 2235might be a format string. There is no absolute rule for this, only a 2236heuristic. In the ‘.po’ file the entry is marked using the ‘c-format’ 2237flag in the ‘#,’ comment line (*note PO Files::). 2238 2239 The careful reader now might say that this again can cause problems. 2240The heuristic might guess it wrong. This is true and therefore 2241‘xgettext’ knows about a special kind of comment which lets the 2242programmer take over the decision. If in the same line as or the 2243immediately preceding line to the ‘gettext’ keyword the ‘xgettext’ 2244program finds a comment containing the words ‘xgettext:c-format’, it 2245will mark the string in any case with the ‘c-format’ flag. This kind of 2246comment should be used when ‘xgettext’ does not recognize the string as 2247a format string but it really is one and it should be tested. Please 2248note that when the comment is in the same line as the ‘gettext’ keyword, 2249it must be before the string to be translated. 2250 2251 This situation happens quite often. The ‘printf’ function is often 2252called with strings which do not contain a format specifier. Of course 2253one would normally use ‘fputs’ but it does happen. In this case 2254‘xgettext’ does not recognize this as a format string but what happens 2255if the translation introduces a valid format specifier? The ‘printf’ 2256function will try to access one of the parameters but none exists 2257because the original code does not pass any parameters. 2258 2259 ‘xgettext’ of course could make a wrong decision the other way round, 2260i.e. a string marked as a format string actually is not a format string. 2261In this case the ‘msgfmt’ might give too many warnings and would prevent 2262translating the ‘.po’ file. The method to prevent this wrong decision 2263is similar to the one used above, only the comment to use must contain 2264the string ‘xgettext:no-c-format’. 2265 2266 If a string is marked with ‘c-format’ and this is not correct the 2267user can find out who is responsible for the decision. See *note 2268xgettext Invocation:: to see how the ‘--debug’ option can be used for 2269solving this problem. 2270 2271 2272File: gettext.info, Node: Special cases, Next: Bug Report Address, Prev: c-format Flag, Up: Sources 2273 22744.7 Special Cases of Translatable Strings 2275========================================= 2276 2277 The attentive reader might now point out that it is not always 2278possible to mark translatable string with ‘gettext’ or something like 2279this. Consider the following case: 2280 2281 { 2282 static const char *messages[] = { 2283 "some very meaningful message", 2284 "and another one" 2285 }; 2286 const char *string; 2287 ... 2288 string 2289 = index > 1 ? "a default message" : messages[index]; 2290 2291 fputs (string); 2292 ... 2293 } 2294 2295 While it is no problem to mark the string ‘"a default message"’ it is 2296not possible to mark the string initializers for ‘messages’. What is to 2297be done? We have to fulfill two tasks. First we have to mark the 2298strings so that the ‘xgettext’ program (*note xgettext Invocation::) can 2299find them, and second we have to translate the string at runtime before 2300printing them. 2301 2302 The first task can be fulfilled by creating a new keyword, which 2303names a no-op. For the second we have to mark all access points to a 2304string from the array. So one solution can look like this: 2305 2306 #define gettext_noop(String) String 2307 2308 { 2309 static const char *messages[] = { 2310 gettext_noop ("some very meaningful message"), 2311 gettext_noop ("and another one") 2312 }; 2313 const char *string; 2314 ... 2315 string 2316 = index > 1 ? gettext ("a default message") : gettext (messages[index]); 2317 2318 fputs (string); 2319 ... 2320 } 2321 2322 Please convince yourself that the string which is written by ‘fputs’ 2323is translated in any case. How to get ‘xgettext’ know the additional 2324keyword ‘gettext_noop’ is explained in *note xgettext Invocation::. 2325 2326 The above is of course not the only solution. You could also come 2327along with the following one: 2328 2329 #define gettext_noop(String) String 2330 2331 { 2332 static const char *messages[] = { 2333 gettext_noop ("some very meaningful message"), 2334 gettext_noop ("and another one") 2335 }; 2336 const char *string; 2337 ... 2338 string 2339 = index > 1 ? gettext_noop ("a default message") : messages[index]; 2340 2341 fputs (gettext (string)); 2342 ... 2343 } 2344 2345 But this has a drawback. The programmer has to take care that he 2346uses ‘gettext_noop’ for the string ‘"a default message"’. A use of 2347‘gettext’ could have in rare cases unpredictable results. 2348 2349 One advantage is that you need not make control flow analysis to make 2350sure the output is really translated in any case. But this analysis is 2351generally not very difficult. If it should be in any situation you can 2352use this second method in this situation. 2353 2354 2355File: gettext.info, Node: Bug Report Address, Next: Names, Prev: Special cases, Up: Sources 2356 23574.8 Letting Users Report Translation Bugs 2358========================================= 2359 2360 Code sometimes has bugs, but translations sometimes have bugs too. 2361The users need to be able to report them. Reporting translation bugs to 2362the programmer or maintainer of a package is not very useful, since the 2363maintainer must never change a translation, except on behalf of the 2364translator. Hence the translation bugs must be reported to the 2365translators. 2366 2367 Here is a way to organize this so that the maintainer does not need 2368to forward translation bug reports, nor even keep a list of the 2369addresses of the translators or their translation teams. 2370 2371 Every program has a place where is shows the bug report address. For 2372GNU programs, it is the code which handles the “–help” option, typically 2373in a function called “usage”. In this place, instruct the translator to 2374add her own bug reporting address. For example, if that code has a 2375statement 2376 2377 printf (_("Report bugs to <%s>.\n"), PACKAGE_BUGREPORT); 2378 2379 you can add some translator instructions like this: 2380 2381 /* TRANSLATORS: The placeholder indicates the bug-reporting address 2382 for this package. Please add _another line_ saying 2383 "Report translation bugs to <...>\n" with the address for translation 2384 bugs (typically your translation team's web or email address). */ 2385 printf (_("Report bugs to <%s>.\n"), PACKAGE_BUGREPORT); 2386 2387 These will be extracted by ‘xgettext’, leading to a .pot file that 2388contains this: 2389 2390 #. TRANSLATORS: The placeholder indicates the bug-reporting address 2391 #. for this package. Please add _another line_ saying 2392 #. "Report translation bugs to <...>\n" with the address for translation 2393 #. bugs (typically your translation team's web or email address). 2394 #: src/hello.c:178 2395 #, c-format 2396 msgid "Report bugs to <%s>.\n" 2397 msgstr "" 2398 2399 2400File: gettext.info, Node: Names, Next: Libraries, Prev: Bug Report Address, Up: Sources 2401 24024.9 Marking Proper Names for Translation 2403======================================== 2404 2405 Should names of persons, cities, locations etc. be marked for 2406translation or not? People who only know languages that can be written 2407with Latin letters (English, Spanish, French, German, etc.) are tempted 2408to say “no”, because names usually do not change when transported 2409between these languages. However, in general when translating from one 2410script to another, names are translated too, usually phonetically or by 2411transliteration. For example, Russian or Greek names are converted to 2412the Latin alphabet when being translated to English, and English or 2413French names are converted to the Katakana script when being translated 2414to Japanese. This is necessary because the speakers of the target 2415language in general cannot read the script the name is originally 2416written in. 2417 2418 As a programmer, you should therefore make sure that names are marked 2419for translation, with a special comment telling the translators that it 2420is a proper name and how to pronounce it. In its simple form, it looks 2421like this: 2422 2423 printf (_("Written by %s.\n"), 2424 /* TRANSLATORS: This is a proper name. See the gettext 2425 manual, section Names. Note this is actually a non-ASCII 2426 name: The first name is (with Unicode escapes) 2427 "Fran\u00e7ois" or (with HTML entities) "François". 2428 Pronunciation is like "fraa-swa pee-nar". */ 2429 _("Francois Pinard")); 2430 2431The GNU gnulib library offers a module ‘propername’ 2432(<https://www.gnu.org/software/gnulib/MODULES.html#module=propername>) 2433which takes care to automatically append the original name, in 2434parentheses, to the translated name. For names that cannot be written 2435in ASCII, it also frees the translator from the task of entering the 2436appropriate non-ASCII characters if no script change is needed. In this 2437more comfortable form, it looks like this: 2438 2439 printf (_("Written by %s and %s.\n"), 2440 proper_name ("Ulrich Drepper"), 2441 /* TRANSLATORS: This is a proper name. See the gettext 2442 manual, section Names. Note this is actually a non-ASCII 2443 name: The first name is (with Unicode escapes) 2444 "Fran\u00e7ois" or (with HTML entities) "François". 2445 Pronunciation is like "fraa-swa pee-nar". */ 2446 proper_name_utf8 ("Francois Pinard", "Fran\303\247ois Pinard")); 2447 2448You can also write the original name directly in Unicode (rather than 2449with Unicode escapes or HTML entities) and denote the pronunciation 2450using the International Phonetic Alphabet (see 2451<https://en.wikipedia.org/wiki/International_Phonetic_Alphabet>). 2452 2453 As a translator, you should use some care when translating names, 2454because it is frustrating if people see their names mutilated or 2455distorted. 2456 2457 If your language uses the Latin script, all you need to do is to 2458reproduce the name as perfectly as you can within the usual character 2459set of your language. In this particular case, this means to provide a 2460translation containing the c-cedilla character. If your language uses a 2461different script and the people speaking it don’t usually read Latin 2462words, it means transliteration. If the programmer used the simple 2463case, you should still give, in parentheses, the original writing of the 2464name – for the sake of the people that do read the Latin script. If the 2465programmer used the ‘propername’ module mentioned above, you don’t need 2466to give the original writing of the name in parentheses, because the 2467program will already do so. Here is an example, using Greek as the 2468target script: 2469 2470 #. This is a proper name. See the gettext 2471 #. manual, section Names. Note this is actually a non-ASCII 2472 #. name: The first name is (with Unicode escapes) 2473 #. "Fran\u00e7ois" or (with HTML entities) "François". 2474 #. Pronunciation is like "fraa-swa pee-nar". 2475 msgid "Francois Pinard" 2476 msgstr "\phi\rho\alpha\sigma\omicron\alpha \pi\iota\nu\alpha\rho" 2477 " (Francois Pinard)" 2478 2479 Because translation of names is such a sensitive domain, it is a good 2480idea to test your translation before submitting it. 2481 2482 2483File: gettext.info, Node: Libraries, Prev: Names, Up: Sources 2484 24854.10 Preparing Library Sources 2486============================== 2487 2488 When you are preparing a library, not a program, for the use of 2489‘gettext’, only a few details are different. Here we assume that the 2490library has a translation domain and a POT file of its own. (If it uses 2491the translation domain and POT file of the main program, then the 2492previous sections apply without changes.) 2493 2494 1. The library code doesn’t call ‘setlocale (LC_ALL, "")’. It’s the 2495 responsibility of the main program to set the locale. The 2496 library’s documentation should mention this fact, so that 2497 developers of programs using the library are aware of it. 2498 2499 2. The library code doesn’t call ‘textdomain (PACKAGE)’, because it 2500 would interfere with the text domain set by the main program. 2501 2502 3. The initialization code for a program was 2503 2504 setlocale (LC_ALL, ""); 2505 bindtextdomain (PACKAGE, LOCALEDIR); 2506 textdomain (PACKAGE); 2507 2508 For a library it is reduced to 2509 2510 bindtextdomain (PACKAGE, LOCALEDIR); 2511 2512 If your library’s API doesn’t already have an initialization 2513 function, you need to create one, containing at least the 2514 ‘bindtextdomain’ invocation. However, you usually don’t need to 2515 export and document this initialization function: It is sufficient 2516 that all entry points of the library call the initialization 2517 function if it hasn’t been called before. The typical idiom used 2518 to achieve this is a static boolean variable that indicates whether 2519 the initialization function has been called. Like this: 2520 2521 static bool libfoo_initialized; 2522 2523 static void 2524 libfoo_initialize (void) 2525 { 2526 bindtextdomain (PACKAGE, LOCALEDIR); 2527 libfoo_initialized = true; 2528 } 2529 2530 /* This function is part of the exported API. */ 2531 struct foo * 2532 create_foo (...) 2533 { 2534 /* Must ensure the initialization is performed. */ 2535 if (!libfoo_initialized) 2536 libfoo_initialize (); 2537 ... 2538 } 2539 2540 /* This function is part of the exported API. The argument must be 2541 non-NULL and have been created through create_foo(). */ 2542 int 2543 foo_refcount (struct foo *argument) 2544 { 2545 /* No need to invoke the initialization function here, because 2546 create_foo() must already have been called before. */ 2547 ... 2548 } 2549 2550 4. The usual declaration of the ‘_’ macro in each source file was 2551 2552 #include <libintl.h> 2553 #define _(String) gettext (String) 2554 2555 for a program. For a library, which has its own translation 2556 domain, it reads like this: 2557 2558 #include <libintl.h> 2559 #define _(String) dgettext (PACKAGE, String) 2560 2561 In other words, ‘dgettext’ is used instead of ‘gettext’. 2562 Similarly, the ‘dngettext’ function should be used in place of the 2563 ‘ngettext’ function. 2564 2565 2566File: gettext.info, Node: Template, Next: Creating, Prev: Sources, Up: Top 2567 25685 Making the PO Template File 2569***************************** 2570 2571 After preparing the sources, the programmer creates a PO template 2572file. This section explains how to use ‘xgettext’ for this purpose. 2573 2574 ‘xgettext’ creates a file named ‘DOMAINNAME.po’. You should then 2575rename it to ‘DOMAINNAME.pot’. (Why doesn’t ‘xgettext’ create it under 2576the name ‘DOMAINNAME.pot’ right away? The answer is: for historical 2577reasons. When ‘xgettext’ was specified, the distinction between a PO 2578file and PO file template was fuzzy, and the suffix ‘.pot’ wasn’t in use 2579at that time.) 2580 2581* Menu: 2582 2583* xgettext Invocation:: Invoking the ‘xgettext’ Program 2584 2585 2586File: gettext.info, Node: xgettext Invocation, Up: Template 2587 25885.1 Invoking the ‘xgettext’ Program 2589=================================== 2590 2591 xgettext [OPTION] [INPUTFILE] ... 2592 2593 The ‘xgettext’ program extracts translatable strings from given input 2594files. 2595 25965.1.1 Input file location 2597------------------------- 2598 2599‘INPUTFILE ...’ 2600 Input files. 2601 2602‘-f FILE’ 2603‘--files-from=FILE’ 2604 Read the names of the input files from FILE instead of getting them 2605 from the command line. 2606 2607‘-D DIRECTORY’ 2608‘--directory=DIRECTORY’ 2609 Add DIRECTORY to the list of directories. Source files are 2610 searched relative to this list of directories. The resulting ‘.po’ 2611 file will be written relative to the current directory, though. 2612 2613 If INPUTFILE is ‘-’, standard input is read. 2614 26155.1.2 Output file location 2616-------------------------- 2617 2618‘-d NAME’ 2619‘--default-domain=NAME’ 2620 Use ‘NAME.po’ for output (instead of ‘messages.po’). 2621 2622‘-o FILE’ 2623‘--output=FILE’ 2624 Write output to specified file (instead of ‘NAME.po’ or 2625 ‘messages.po’). 2626 2627‘-p DIR’ 2628‘--output-dir=DIR’ 2629 Output files will be placed in directory DIR. 2630 2631 If the output FILE is ‘-’ or ‘/dev/stdout’, the output is written to 2632standard output. 2633 26345.1.3 Choice of input file language 2635----------------------------------- 2636 2637‘-L NAME’ 2638‘--language=NAME’ 2639 Specifies the language of the input files. The supported languages 2640 are ‘C’, ‘C++’, ‘ObjectiveC’, ‘PO’, ‘Shell’, ‘Python’, ‘Lisp’, 2641 ‘EmacsLisp’, ‘librep’, ‘Scheme’, ‘Smalltalk’, ‘Java’, 2642 ‘JavaProperties’, ‘C#’, ‘awk’, ‘YCP’, ‘Tcl’, ‘Perl’, ‘PHP’, ‘Ruby’, 2643 ‘GCC-source’, ‘NXStringTable’, ‘RST’, ‘RSJ’, ‘Glade’, ‘Lua’, 2644 ‘JavaScript’, ‘Vala’, ‘GSettings’, ‘Desktop’. 2645 2646‘-C’ 2647‘--c++’ 2648 This is a shorthand for ‘--language=C++’. 2649 2650 By default the language is guessed depending on the input file name 2651extension. 2652 26535.1.4 Input file interpretation 2654------------------------------- 2655 2656‘--from-code=NAME’ 2657 Specifies the encoding of the input files. This option is needed 2658 only if some untranslated message strings or their corresponding 2659 comments contain non-ASCII characters. Note that Tcl and Glade 2660 input files are always assumed to be in UTF-8, regardless of this 2661 option. 2662 2663 By default the input files are assumed to be in ASCII. 2664 26655.1.5 Operation mode 2666-------------------- 2667 2668‘-j’ 2669‘--join-existing’ 2670 Join messages with existing file. 2671 2672‘-x FILE’ 2673‘--exclude-file=FILE’ 2674 Entries from FILE are not extracted. FILE should be a PO or POT 2675 file. 2676 2677‘-c[TAG]’ 2678‘--add-comments[=TAG]’ 2679 Place comment blocks starting with TAG and preceding keyword lines 2680 in the output file. Without a TAG, the option means to put _all_ 2681 comment blocks preceding keyword lines in the output file. 2682 2683 Note that comment blocks supposed to be extracted must be adjacent 2684 to keyword lines. For example, in the following C source code: 2685 2686 /* This is the first comment. */ 2687 gettext ("foo"); 2688 2689 /* This is the second comment: not extracted */ 2690 gettext ( 2691 "bar"); 2692 2693 gettext ( 2694 /* This is the third comment. */ 2695 "baz"); 2696 2697 The second comment line will not be extracted, because there is one 2698 blank line between the comment line and the keyword. 2699 2700‘--check[=CHECK]’ 2701 Perform a syntax check on msgid and msgid_plural. The supported 2702 checks are: 2703 2704 ‘ellipsis-unicode’ 2705 Prefer Unicode ellipsis character over ASCII ‘...’ 2706 2707 ‘space-ellipsis’ 2708 Prohibit whitespace before an ellipsis character 2709 2710 ‘quote-unicode’ 2711 Prefer Unicode quotation marks over ASCII ‘"'`’ 2712 2713 ‘bullet-unicode’ 2714 Prefer Unicode bullet character over ASCII ‘*’ or ‘-’ 2715 2716 The option has an effect on all input files. To enable or disable 2717 checks for a certain string, you can mark it with an ‘xgettext:’ 2718 special comment in the source file. For example, if you specify 2719 the ‘--check=space-ellipsis’ option, but want to suppress the check 2720 on a particular string, add the following comment: 2721 2722 /* xgettext: no-space-ellipsis-check */ 2723 gettext ("We really want a space before ellipsis here ..."); 2724 2725 The ‘xgettext:’ comment can be followed by flags separated with a 2726 comma. The possible flags are of the form ‘[no-]NAME-check’, where 2727 NAME is the name of a valid syntax check. If a flag is prefixed by 2728 ‘no-’, the meaning is negated. 2729 2730 Some tests apply the checks to each sentence within the msgid, 2731 rather than the whole string. xgettext detects the end of sentence 2732 by performing a pattern match, which usually looks for a period 2733 followed by a certain number of spaces. The number is specified 2734 with the ‘--sentence-end’ option. 2735 2736‘--sentence-end[=TYPE]’ 2737 The supported values are: 2738 2739 ‘single-space’ 2740 Expect at least one whitespace after a period 2741 2742 ‘double-space’ 2743 Expect at least two whitespaces after a period 2744 27455.1.6 Language specific options 2746------------------------------- 2747 2748‘-a’ 2749‘--extract-all’ 2750 Extract all strings. 2751 2752 This option has an effect with most languages, namely C, C++, 2753 ObjectiveC, Shell, Python, Lisp, EmacsLisp, librep, Java, C#, awk, 2754 Tcl, Perl, PHP, GCC-source, Glade, Lua, JavaScript, Vala, 2755 GSettings. 2756 2757‘-k[KEYWORDSPEC]’ 2758‘--keyword[=KEYWORDSPEC]’ 2759 Specify KEYWORDSPEC as an additional keyword to be looked for. 2760 Without a KEYWORDSPEC, the option means to not use default 2761 keywords. 2762 2763 If KEYWORDSPEC is a C identifier ID, ‘xgettext’ looks for strings 2764 in the first argument of each call to the function or macro ID. If 2765 KEYWORDSPEC is of the form ‘ID:ARGNUM’, ‘xgettext’ looks for 2766 strings in the ARGNUMth argument of the call. If KEYWORDSPEC is of 2767 the form ‘ID:ARGNUM1,ARGNUM2’, ‘xgettext’ looks for strings in the 2768 ARGNUM1st argument and in the ARGNUM2nd argument of the call, and 2769 treats them as singular/plural variants for a message with plural 2770 handling. Also, if KEYWORDSPEC is of the form 2771 ‘ID:CONTEXTARGNUMc,ARGNUM’ or ‘ID:ARGNUM,CONTEXTARGNUMc’, 2772 ‘xgettext’ treats strings in the CONTEXTARGNUMth argument as a 2773 context specifier. And, as a special-purpose support for GNOME, if 2774 KEYWORDSPEC is of the form ‘ID:ARGNUMg’, ‘xgettext’ recognizes the 2775 ARGNUMth argument as a string with context, using the GNOME ‘glib’ 2776 syntax ‘"msgctxt|msgid"’. 2777 Furthermore, if KEYWORDSPEC is of the form ‘ID:...,TOTALNUMARGSt’, 2778 ‘xgettext’ recognizes this argument specification only if the 2779 number of actual arguments is equal to TOTALNUMARGS. This is 2780 useful for disambiguating overloaded function calls in C++. 2781 Finally, if KEYWORDSPEC is of the form ‘ID:ARGNUM...,"XCOMMENT"’, 2782 ‘xgettext’, when extracting a message from the specified argument 2783 strings, adds an extracted comment XCOMMENT to the message. Note 2784 that when used through a normal shell command line, the 2785 double-quotes around the XCOMMENT need to be escaped. 2786 2787 This option has an effect with most languages, namely C, C++, 2788 ObjectiveC, Shell, Python, Lisp, EmacsLisp, librep, Java, C#, awk, 2789 Tcl, Perl, PHP, GCC-source, Glade, Lua, JavaScript, Vala, 2790 GSettings, Desktop. 2791 2792 The default keyword specifications, which are always looked for if 2793 not explicitly disabled, are language dependent. They are: 2794 2795 • For C, C++, and GCC-source: ‘gettext’, ‘dgettext:2’, 2796 ‘dcgettext:2’, ‘ngettext:1,2’, ‘dngettext:2,3’, 2797 ‘dcngettext:2,3’, ‘gettext_noop’, and ‘pgettext:1c,2’, 2798 ‘dpgettext:2c,3’, ‘dcpgettext:2c,3’, ‘npgettext:1c,2,3’, 2799 ‘dnpgettext:2c,3,4’, ‘dcnpgettext:2c,3,4’. 2800 2801 • For Objective C: Like for C, and also ‘NSLocalizedString’, 2802 ‘_’, ‘NSLocalizedStaticString’, ‘__’. 2803 2804 • For Shell scripts: ‘gettext’, ‘ngettext:1,2’, ‘eval_gettext’, 2805 ‘eval_ngettext:1,2’, ‘eval_pgettext:1c,2’, 2806 ‘eval_npgettext:1c,2,3’. 2807 2808 • For Python: ‘gettext’, ‘ugettext’, ‘dgettext:2’, 2809 ‘ngettext:1,2’, ‘ungettext:1,2’, ‘dngettext:2,3’, ‘_’. 2810 2811 • For Lisp: ‘gettext’, ‘ngettext:1,2’, ‘gettext-noop’. 2812 2813 • For EmacsLisp: ‘_’. 2814 2815 • For librep: ‘_’. 2816 2817 • For Scheme: ‘gettext’, ‘ngettext:1,2’, ‘gettext-noop’. 2818 2819 • For Java: ‘GettextResource.gettext:2’, 2820 ‘GettextResource.ngettext:2,3’, 2821 ‘GettextResource.pgettext:2c,3’, 2822 ‘GettextResource.npgettext:2c,3,4’, ‘gettext’, ‘ngettext:1,2’, 2823 ‘pgettext:1c,2’, ‘npgettext:1c,2,3’, ‘getString’. 2824 2825 • For C#: ‘GetString’, ‘GetPluralString:1,2’, 2826 ‘GetParticularString:1c,2’, 2827 ‘GetParticularPluralString:1c,2,3’. 2828 2829 • For awk: ‘dcgettext’, ‘dcngettext:1,2’. 2830 2831 • For Tcl: ‘::msgcat::mc’. 2832 2833 • For Perl: ‘gettext’, ‘%gettext’, ‘$gettext’, ‘dgettext:2’, 2834 ‘dcgettext:2’, ‘ngettext:1,2’, ‘dngettext:2,3’, 2835 ‘dcngettext:2,3’, ‘gettext_noop’. 2836 2837 • For PHP: ‘_’, ‘gettext’, ‘dgettext:2’, ‘dcgettext:2’, 2838 ‘ngettext:1,2’, ‘dngettext:2,3’, ‘dcngettext:2,3’. 2839 2840 • For Glade 1: ‘label’, ‘title’, ‘text’, ‘format’, ‘copyright’, 2841 ‘comments’, ‘preview_text’, ‘tooltip’. 2842 2843 • For Lua: ‘_’, ‘gettext.gettext’, ‘gettext.dgettext:2’, 2844 ‘gettext.dcgettext:2’, ‘gettext.ngettext:1,2’, 2845 ‘gettext.dngettext:2,3’, ‘gettext.dcngettext:2,3’. 2846 2847 • For JavaScript: ‘_’, ‘gettext’, ‘dgettext:2’, ‘dcgettext:2’, 2848 ‘ngettext:1,2’, ‘dngettext:2,3’, ‘pgettext:1c,2’, 2849 ‘dpgettext:2c,3’. 2850 2851 • For Vala: ‘_’, ‘Q_’, ‘N_’, ‘NC_’, ‘dgettext:2’, ‘dcgettext:2’, 2852 ‘ngettext:1,2’, ‘dngettext:2,3’, ‘dpgettext:2c,3’, 2853 ‘dpgettext2:2c,3’. 2854 2855 • For Desktop: ‘Name’, ‘GenericName’, ‘Comment’, ‘Keywords’. 2856 2857 To disable the default keyword specifications, the option ‘-k’ or 2858 ‘--keyword’ or ‘--keyword=’, without a KEYWORDSPEC, can be used. 2859 2860‘--flag=WORD:ARG:FLAG’ 2861 Specifies additional flags for strings occurring as part of the 2862 ARGth argument of the function WORD. The possible flags are the 2863 possible format string indicators, such as ‘c-format’, and their 2864 negations, such as ‘no-c-format’, possibly prefixed with ‘pass-’. 2865 The meaning of ‘--flag=FUNCTION:ARG:LANG-format’ is that in 2866 language LANG, the specified FUNCTION expects as ARGth argument a 2867 format string. (For those of you familiar with GCC function 2868 attributes, ‘--flag=FUNCTION:ARG:c-format’ is roughly equivalent to 2869 the declaration ‘__attribute__ ((__format__ (__printf__, ARG, 2870 ...)))’ attached to FUNCTION in a C source file.) For example, if 2871 you use the ‘error’ function from GNU libc, you can specify its 2872 behaviour through ‘--flag=error:3:c-format’. The effect of this 2873 specification is that ‘xgettext’ will mark as format strings all 2874 ‘gettext’ invocations that occur as ARGth argument of FUNCTION. 2875 This is useful when such strings contain no format string 2876 directives: together with the checks done by ‘msgfmt -c’ it will 2877 ensure that translators cannot accidentally use format string 2878 directives that would lead to a crash at runtime. 2879 The meaning of ‘--flag=FUNCTION:ARG:pass-LANG-format’ is that in 2880 language LANG, if the FUNCTION call occurs in a position that must 2881 yield a format string, then its ARGth argument must yield a format 2882 string of the same type as well. (If you know GCC function 2883 attributes, the ‘--flag=FUNCTION:ARG:pass-c-format’ option is 2884 roughly equivalent to the declaration ‘__attribute__ 2885 ((__format_arg__ (ARG)))’ attached to FUNCTION in a C source file.) 2886 For example, if you use the ‘_’ shortcut for the ‘gettext’ 2887 function, you should use ‘--flag=_:1:pass-c-format’. The effect of 2888 this specification is that ‘xgettext’ will propagate a format 2889 string requirement for a ‘_("string")’ call to its first argument, 2890 the literal ‘"string"’, and thus mark it as a format string. This 2891 is useful when such strings contain no format string directives: 2892 together with the checks done by ‘msgfmt -c’ it will ensure that 2893 translators cannot accidentally use format string directives that 2894 would lead to a crash at runtime. 2895 This option has an effect with most languages, namely C, C++, 2896 ObjectiveC, Shell, Python, Lisp, EmacsLisp, librep, Scheme, Java, 2897 C#, awk, YCP, Tcl, Perl, PHP, GCC-source, Lua, JavaScript, Vala. 2898 2899‘-T’ 2900‘--trigraphs’ 2901 Understand ANSI C trigraphs for input. 2902 This option has an effect only with the languages C, C++, 2903 ObjectiveC. 2904 2905‘--qt’ 2906 Recognize Qt format strings. 2907 This option has an effect only with the language C++. 2908 2909‘--kde’ 2910 Recognize KDE 4 format strings. 2911 This option has an effect only with the language C++. 2912 2913‘--boost’ 2914 Recognize Boost format strings. 2915 This option has an effect only with the language C++. 2916 2917‘--debug’ 2918 Use the flags ‘c-format’ and ‘possible-c-format’ to show who was 2919 responsible for marking a message as a format string. The latter 2920 form is used if the ‘xgettext’ program decided, the former form is 2921 used if the programmer prescribed it. 2922 2923 By default only the ‘c-format’ form is used. The translator should 2924 not have to care about these details. 2925 2926 This implementation of ‘xgettext’ is able to process a few awkward 2927cases, like strings in preprocessor macros, ANSI concatenation of 2928adjacent strings, and escaped end of lines for continued strings. 2929 29305.1.7 Output details 2931-------------------- 2932 2933‘--color’ 2934‘--color=WHEN’ 2935 Specify whether or when to use colors and other text attributes. 2936 See *note The --color option:: for details. 2937 2938‘--style=STYLE_FILE’ 2939 Specify the CSS style rule file to use for ‘--color’. See *note 2940 The --style option:: for details. 2941 2942‘--force-po’ 2943 Always write an output file even if no message is defined. 2944 2945‘-i’ 2946‘--indent’ 2947 Write the .po file using indented style. 2948 2949‘--no-location’ 2950 Do not write ‘#: FILENAME:LINE’ lines. Note that using this option 2951 makes it harder for technically skilled translators to understand 2952 each message’s context. 2953 2954‘-n’ 2955‘--add-location=TYPE’ 2956 Generate ‘#: FILENAME:LINE’ lines (default). 2957 2958 The optional TYPE can be either ‘full’, ‘file’, or ‘never’. If it 2959 is not given or ‘full’, it generates the lines with both file name 2960 and line number. If it is ‘file’, the line number part is omitted. 2961 If it is ‘never’, it completely suppresses the lines (same as 2962 ‘--no-location’). 2963 2964‘--strict’ 2965 Write out a strict Uniforum conforming PO file. Note that this 2966 Uniforum format should be avoided because it doesn’t support the 2967 GNU extensions. 2968 2969‘--properties-output’ 2970 Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note 2971 that this file format doesn’t support plural forms and silently 2972 drops obsolete messages. 2973 2974‘--stringtable-output’ 2975 Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ 2976 syntax. Note that this file format doesn’t support plural forms. 2977 2978‘--its=FILE’ 2979 Use ITS rules defined in FILE. Note that this is only effective 2980 with XML files. 2981 2982‘--itstool’ 2983 Write out comments recognized by itstool (<http://itstool.org>). 2984 Note that this is only effective with XML files. 2985 2986‘-w NUMBER’ 2987‘--width=NUMBER’ 2988 Set the output page width. Long strings in the output files will 2989 be split across multiple lines in order to ensure that each line’s 2990 width (= number of screen columns) is less or equal to the given 2991 NUMBER. 2992 2993‘--no-wrap’ 2994 Do not break long message lines. Message lines whose width exceeds 2995 the output page width will not be split into several lines. Only 2996 file reference lines which are wider than the output page width 2997 will be split. 2998 2999‘-s’ 3000‘--sort-output’ 3001 Generate sorted output. Note that using this option makes it much 3002 harder for the translator to understand each message’s context. 3003 3004‘-F’ 3005‘--sort-by-file’ 3006 Sort output by file location. 3007 3008‘--omit-header’ 3009 Don’t write header with ‘msgid ""’ entry. 3010 3011 This is useful for testing purposes because it eliminates a source 3012 of variance for generated ‘.gmo’ files. With ‘--omit-header’, two 3013 invocations of ‘xgettext’ on the same files with the same options 3014 at different times are guaranteed to produce the same results. 3015 3016 Note that using this option will lead to an error if the resulting 3017 file would not entirely be in ASCII. 3018 3019‘--copyright-holder=STRING’ 3020 Set the copyright holder in the output. STRING should be the 3021 copyright holder of the surrounding package. (Note that the msgstr 3022 strings, extracted from the package’s sources, belong to the 3023 copyright holder of the package.) Translators are expected to 3024 transfer or disclaim the copyright for their translations, so that 3025 package maintainers can distribute them without legal risk. If 3026 STRING is empty, the output files are marked as being in the public 3027 domain; in this case, the translators are expected to disclaim 3028 their copyright, again so that package maintainers can distribute 3029 them without legal risk. 3030 3031 The default value for STRING is the Free Software Foundation, Inc., 3032 simply because ‘xgettext’ was first used in the GNU project. 3033 3034‘--foreign-user’ 3035 Omit FSF copyright in output. This option is equivalent to 3036 ‘--copyright-holder=''’. It can be useful for packages outside the 3037 GNU project that want their translations to be in the public 3038 domain. 3039 3040‘--package-name=PACKAGE’ 3041 Set the package name in the header of the output. 3042 3043‘--package-version=VERSION’ 3044 Set the package version in the header of the output. This option 3045 has an effect only if the ‘--package-name’ option is also used. 3046 3047‘--msgid-bugs-address=EMAIL@ADDRESS’ 3048 Set the reporting address for msgid bugs. This is the email 3049 address or URL to which the translators shall report bugs in the 3050 untranslated strings: 3051 3052 - Strings which are not entire sentences; see the maintainer 3053 guidelines in *note Preparing Strings::. 3054 - Strings which use unclear terms or require additional context 3055 to be understood. 3056 - Strings which make invalid assumptions about notation of date, 3057 time or money. 3058 - Pluralisation problems. 3059 - Incorrect English spelling. 3060 - Incorrect formatting. 3061 3062 It can be your email address, or a mailing list address where 3063 translators can write to without being subscribed, or the URL of a 3064 web page through which the translators can contact you. 3065 3066 The default value is empty, which means that translators will be 3067 clueless! Don’t forget to specify this option. 3068 3069‘-m[STRING]’ 3070‘--msgstr-prefix[=STRING]’ 3071 Use STRING (or "" if not specified) as prefix for msgstr values. 3072 3073‘-M[STRING]’ 3074‘--msgstr-suffix[=STRING]’ 3075 Use STRING (or "" if not specified) as suffix for msgstr values. 3076 30775.1.8 Informative output 3078------------------------ 3079 3080‘-h’ 3081‘--help’ 3082 Display this help and exit. 3083 3084‘-V’ 3085‘--version’ 3086 Output version information and exit. 3087 3088‘-v’ 3089‘--verbose’ 3090 Increase verbosity level. 3091 3092 3093File: gettext.info, Node: Creating, Next: Updating, Prev: Template, Up: Top 3094 30956 Creating a New PO File 3096************************ 3097 3098 When starting a new translation, the translator creates a file called 3099‘LANG.po’, as a copy of the ‘PACKAGE.pot’ template file with 3100modifications in the initial comments (at the beginning of the file) and 3101in the header entry (the first entry, near the beginning of the file). 3102 3103 The easiest way to do so is by use of the ‘msginit’ program. For 3104example: 3105 3106 $ cd PACKAGE-VERSION 3107 $ cd po 3108 $ msginit 3109 3110 The alternative way is to do the copy and modifications by hand. To 3111do so, the translator copies ‘PACKAGE.pot’ to ‘LANG.po’. Then she 3112modifies the initial comments and the header entry of this file. 3113 3114* Menu: 3115 3116* msginit Invocation:: Invoking the ‘msginit’ Program 3117* Header Entry:: Filling in the Header Entry 3118 3119 3120File: gettext.info, Node: msginit Invocation, Next: Header Entry, Up: Creating 3121 31226.1 Invoking the ‘msginit’ Program 3123================================== 3124 3125 msginit [OPTION] 3126 3127 The ‘msginit’ program creates a new PO file, initializing the meta 3128information with values from the user’s environment. 3129 3130 Here are more details. The following header fields of a PO file are 3131automatically filled, when possible. 3132 3133‘Project-Id-Version’ 3134 The value is guessed from the ‘configure’ script or any other files 3135 in the current directory. 3136 3137‘PO-Revision-Date’ 3138 The value is taken from the ‘PO-Creation-Data’ in the input POT 3139 file, or the current date is used. 3140 3141‘Last-Translator’ 3142 The value is taken from user’s password file entry and the mailer 3143 configuration files. 3144 3145‘Language-Team, Language’ 3146 These values are set according to the current locale and the 3147 predefined list of translation teams. 3148 3149‘MIME-Version, Content-Type, Content-Transfer-Encoding’ 3150 These values are set according to the content of the POT file and 3151 the current locale. If the POT file contains charset=UTF-8, it 3152 means that the POT file contains non-ASCII characters, and we keep 3153 the UTF-8 encoding. Otherwise, when the POT file is plain ASCII, 3154 we use the locale’s encoding. 3155 3156‘Plural-Forms’ 3157 The value is first looked up from the embedded table. 3158 3159 As an experimental feature, you can instruct ‘msginit’ to use the 3160 information from Unicode CLDR, by setting the ‘GETTEXTCLDRDIR’ 3161 environment variable. The program will look for a file named 3162 ‘common/supplemental/plurals.xml’ under that directory. You can 3163 get the CLDR data from <http://cldr.unicode.org/>. 3164 31656.1.1 Input file location 3166------------------------- 3167 3168‘-i INPUTFILE’ 3169‘--input=INPUTFILE’ 3170 Input POT file. 3171 3172 If no INPUTFILE is given, the current directory is searched for the 3173POT file. If it is ‘-’, standard input is read. 3174 31756.1.2 Output file location 3176-------------------------- 3177 3178‘-o FILE’ 3179‘--output-file=FILE’ 3180 Write output to specified PO file. 3181 3182 If no output file is given, it depends on the ‘--locale’ option or 3183the user’s locale setting. If it is ‘-’, the results are written to 3184standard output. 3185 31866.1.3 Input file syntax 3187----------------------- 3188 3189‘-P’ 3190‘--properties-input’ 3191 Assume the input file is a Java ResourceBundle in Java 3192 ‘.properties’ syntax, not in PO file syntax. 3193 3194‘--stringtable-input’ 3195 Assume the input file is a NeXTstep/GNUstep localized resource file 3196 in ‘.strings’ syntax, not in PO file syntax. 3197 31986.1.4 Output details 3199-------------------- 3200 3201‘-l LL_CC[.ENCODING]’ 3202‘--locale=LL_CC[.ENCODING]’ 3203 Set target locale. LL should be a language code, and CC should be 3204 a country code. The optional part .ENCODING specifies the encoding 3205 of the locale; most often this part is ‘.UTF-8’. The command 3206 ‘locale -a’ can be used to output a list of all installed locales. 3207 The default is the user’s locale setting. 3208 3209‘--no-translator’ 3210 Declares that the PO file will not have a human translator and is 3211 instead automatically generated. 3212 3213‘--color’ 3214‘--color=WHEN’ 3215 Specify whether or when to use colors and other text attributes. 3216 See *note The --color option:: for details. 3217 3218‘--style=STYLE_FILE’ 3219 Specify the CSS style rule file to use for ‘--color’. See *note 3220 The --style option:: for details. 3221 3222‘-p’ 3223‘--properties-output’ 3224 Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note 3225 that this file format doesn’t support plural forms and silently 3226 drops obsolete messages. 3227 3228‘--stringtable-output’ 3229 Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ 3230 syntax. Note that this file format doesn’t support plural forms. 3231 3232‘-w NUMBER’ 3233‘--width=NUMBER’ 3234 Set the output page width. Long strings in the output files will 3235 be split across multiple lines in order to ensure that each line’s 3236 width (= number of screen columns) is less or equal to the given 3237 NUMBER. 3238 3239‘--no-wrap’ 3240 Do not break long message lines. Message lines whose width exceeds 3241 the output page width will not be split into several lines. Only 3242 file reference lines which are wider than the output page width 3243 will be split. 3244 32456.1.5 Informative output 3246------------------------ 3247 3248‘-h’ 3249‘--help’ 3250 Display this help and exit. 3251 3252‘-V’ 3253‘--version’ 3254 Output version information and exit. 3255 3256 3257File: gettext.info, Node: Header Entry, Prev: msginit Invocation, Up: Creating 3258 32596.2 Filling in the Header Entry 3260=============================== 3261 3262 The initial comments "SOME DESCRIPTIVE TITLE", "YEAR" and "FIRST 3263AUTHOR <EMAIL@ADDRESS>, YEAR" ought to be replaced by sensible 3264information. This can be done in any text editor; if Emacs is used and 3265it switched to PO mode automatically (because it has recognized the 3266file’s suffix), you can disable it by typing ‘M-x fundamental-mode’. 3267 3268 Modifying the header entry can already be done using PO mode: in 3269Emacs, type ‘M-x po-mode RET’ and then ‘RET’ again to start editing the 3270entry. You should fill in the following fields. 3271 3272Project-Id-Version 3273 This is the name and version of the package. Fill it in if it has 3274 not already been filled in by ‘xgettext’. 3275 3276Report-Msgid-Bugs-To 3277 This has already been filled in by ‘xgettext’. It contains an 3278 email address or URL where you can report bugs in the untranslated 3279 strings: 3280 3281 - Strings which are not entire sentences, see the maintainer 3282 guidelines in *note Preparing Strings::. 3283 - Strings which use unclear terms or require additional context 3284 to be understood. 3285 - Strings which make invalid assumptions about notation of date, 3286 time or money. 3287 - Pluralisation problems. 3288 - Incorrect English spelling. 3289 - Incorrect formatting. 3290 3291POT-Creation-Date 3292 This has already been filled in by ‘xgettext’. 3293 3294PO-Revision-Date 3295 You don’t need to fill this in. It will be filled by the PO file 3296 editor when you save the file. 3297 3298Last-Translator 3299 Fill in your name and email address (without double quotes). 3300 3301Language-Team 3302 Fill in the English name of the language, and the email address or 3303 homepage URL of the language team you are part of. 3304 3305 Before starting a translation, it is a good idea to get in touch 3306 with your translation team, not only to make sure you don’t do 3307 duplicated work, but also to coordinate difficult linguistic 3308 issues. 3309 3310 In the Free Translation Project, each translation team has its own 3311 mailing list. The up-to-date list of teams can be found at the 3312 Free Translation Project’s homepage, 3313 <https://translationproject.org/>, in the "Teams" area. 3314 3315Language 3316 Fill in the language code of the language. This can be in one of 3317 three forms: 3318 3319 - ‘LL’, an ISO 639 two-letter language code (lowercase). See 3320 *note Language Codes:: for the list of codes. 3321 3322 - ‘LL_CC’, where ‘LL’ is an ISO 639 two-letter language code 3323 (lowercase) and ‘CC’ is an ISO 3166 two-letter country code 3324 (uppercase). The country code specification is not redundant: 3325 Some languages have dialects in different countries. For 3326 example, ‘de_AT’ is used for Austria, and ‘pt_BR’ for Brazil. 3327 The country code serves to distinguish the dialects. See 3328 *note Language Codes:: and *note Country Codes:: for the lists 3329 of codes. 3330 3331 - ‘LL_CC@VARIANT’, where ‘LL’ is an ISO 639 two-letter language 3332 code (lowercase), ‘CC’ is an ISO 3166 two-letter country code 3333 (uppercase), and ‘VARIANT’ is a variant designator. The 3334 variant designator (lowercase) can be a script designator, 3335 such as ‘latin’ or ‘cyrillic’. 3336 3337 The naming convention ‘LL_CC’ is also the way locales are named on 3338 systems based on GNU libc. But there are three important 3339 differences: 3340 3341 • In this PO file field, but not in locale names, ‘LL_CC’ 3342 combinations denoting a language’s main dialect are 3343 abbreviated as ‘LL’. For example, ‘de’ is equivalent to 3344 ‘de_DE’ (German as spoken in Germany), and ‘pt’ to ‘pt_PT’ 3345 (Portuguese as spoken in Portugal) in this context. 3346 3347 • In this PO file field, suffixes like ‘.ENCODING’ are not used. 3348 3349 • In this PO file field, variant designators that are not 3350 relevant to message translation, such as ‘@euro’, are not 3351 used. 3352 3353 So, if your locale name is ‘de_DE.UTF-8’, the language 3354 specification in PO files is just ‘de’. 3355 3356Content-Type 3357 Replace ‘CHARSET’ with the character encoding used for your 3358 language, in your locale, or UTF-8. This field is needed for 3359 correct operation of the ‘msgmerge’ and ‘msgfmt’ programs, as well 3360 as for users whose locale’s character encoding differs from yours 3361 (see *note Charset conversion::). 3362 3363 You get the character encoding of your locale by running the shell 3364 command ‘locale charmap’. If the result is ‘C’ or 3365 ‘ANSI_X3.4-1968’, which is equivalent to ‘ASCII’ (= ‘US-ASCII’), it 3366 means that your locale is not correctly configured. In this case, 3367 ask your translation team which charset to use. ‘ASCII’ is not 3368 usable for any language except Latin. 3369 3370 Because the PO files must be portable to operating systems with 3371 less advanced internationalization facilities, the character 3372 encodings that can be used are limited to those supported by both 3373 GNU ‘libc’ and GNU ‘libiconv’. These are: ‘ASCII’, ‘ISO-8859-1’, 3374 ‘ISO-8859-2’, ‘ISO-8859-3’, ‘ISO-8859-4’, ‘ISO-8859-5’, 3375 ‘ISO-8859-6’, ‘ISO-8859-7’, ‘ISO-8859-8’, ‘ISO-8859-9’, 3376 ‘ISO-8859-13’, ‘ISO-8859-14’, ‘ISO-8859-15’, ‘KOI8-R’, ‘KOI8-U’, 3377 ‘KOI8-T’, ‘CP850’, ‘CP866’, ‘CP874’, ‘CP932’, ‘CP949’, ‘CP950’, 3378 ‘CP1250’, ‘CP1251’, ‘CP1252’, ‘CP1253’, ‘CP1254’, ‘CP1255’, 3379 ‘CP1256’, ‘CP1257’, ‘GB2312’, ‘EUC-JP’, ‘EUC-KR’, ‘EUC-TW’, ‘BIG5’, 3380 ‘BIG5-HKSCS’, ‘GBK’, ‘GB18030’, ‘SHIFT_JIS’, ‘JOHAB’, ‘TIS-620’, 3381 ‘VISCII’, ‘GEORGIAN-PS’, ‘UTF-8’. 3382 3383 In the GNU system, the following encodings are frequently used for 3384 the corresponding languages. 3385 3386 • ‘ISO-8859-1’ for Afrikaans, Albanian, Basque, Breton, Catalan, 3387 Cornish, Danish, Dutch, English, Estonian, Faroese, Finnish, 3388 French, Galician, German, Greenlandic, Icelandic, Indonesian, 3389 Irish, Italian, Malay, Manx, Norwegian, Occitan, Portuguese, 3390 Spanish, Swedish, Tagalog, Uzbek, Walloon, 3391 • ‘ISO-8859-2’ for Bosnian, Croatian, Czech, Hungarian, Polish, 3392 Romanian, Serbian, Slovak, Slovenian, 3393 • ‘ISO-8859-3’ for Maltese, 3394 • ‘ISO-8859-5’ for Macedonian, Serbian, 3395 • ‘ISO-8859-6’ for Arabic, 3396 • ‘ISO-8859-7’ for Greek, 3397 • ‘ISO-8859-8’ for Hebrew, 3398 • ‘ISO-8859-9’ for Turkish, 3399 • ‘ISO-8859-13’ for Latvian, Lithuanian, Maori, 3400 • ‘ISO-8859-14’ for Welsh, 3401 • ‘ISO-8859-15’ for Basque, Catalan, Dutch, English, Finnish, 3402 French, Galician, German, Irish, Italian, Portuguese, Spanish, 3403 Swedish, Walloon, 3404 • ‘KOI8-R’ for Russian, 3405 • ‘KOI8-U’ for Ukrainian, 3406 • ‘KOI8-T’ for Tajik, 3407 • ‘CP1251’ for Bulgarian, Belarusian, 3408 • ‘GB2312’, ‘GBK’, ‘GB18030’ for simplified writing of Chinese, 3409 • ‘BIG5’, ‘BIG5-HKSCS’ for traditional writing of Chinese, 3410 • ‘EUC-JP’ for Japanese, 3411 • ‘EUC-KR’ for Korean, 3412 • ‘TIS-620’ for Thai, 3413 • ‘GEORGIAN-PS’ for Georgian, 3414 • ‘UTF-8’ for any language, including those listed above. 3415 3416 When single quote characters or double quote characters are used in 3417 translations for your language, and your locale’s encoding is one 3418 of the ISO-8859-* charsets, it is best if you create your PO files 3419 in UTF-8 encoding, instead of your locale’s encoding. This is 3420 because in UTF-8 the real quote characters can be represented 3421 (single quote characters: U+2018, U+2019, double quote characters: 3422 U+201C, U+201D), whereas none of ISO-8859-* charsets has them all. 3423 Users in UTF-8 locales will see the real quote characters, whereas 3424 users in ISO-8859-* locales will see the vertical apostrophe and 3425 the vertical double quote instead (because that’s what the 3426 character set conversion will transliterate them to). 3427 3428 To enter such quote characters under X11, you can change your 3429 keyboard mapping using the ‘xmodmap’ program. The X11 names of the 3430 quote characters are "leftsinglequotemark", "rightsinglequotemark", 3431 "leftdoublequotemark", "rightdoublequotemark", 3432 "singlelowquotemark", "doublelowquotemark". 3433 3434 Note that only recent versions of GNU Emacs support the UTF-8 3435 encoding: Emacs 20 with Mule-UCS, and Emacs 21. As of January 3436 2001, XEmacs doesn’t support the UTF-8 encoding. 3437 3438 The character encoding name can be written in either upper or lower 3439 case. Usually upper case is preferred. 3440 3441Content-Transfer-Encoding 3442 Set this to ‘8bit’. 3443 3444Plural-Forms 3445 This field is optional. It is only needed if the PO file has 3446 plural forms. You can find them by searching for the 3447 ‘msgid_plural’ keyword. The format of the plural forms field is 3448 described in *note Plural forms:: and *note Translating plural 3449 forms::. 3450 3451 3452File: gettext.info, Node: Updating, Next: Editing, Prev: Creating, Up: Top 3453 34547 Updating Existing PO Files 3455**************************** 3456 3457* Menu: 3458 3459* msgmerge Invocation:: Invoking the ‘msgmerge’ Program 3460 3461 3462File: gettext.info, Node: msgmerge Invocation, Up: Updating 3463 34647.1 Invoking the ‘msgmerge’ Program 3465=================================== 3466 3467 msgmerge [OPTION] DEF.po REF.pot 3468 3469 The ‘msgmerge’ program merges two Uniforum style .po files together. 3470The DEF.po file is an existing PO file with translations which will be 3471taken over to the newly created file as long as they still match; 3472comments will be preserved, but extracted comments and file positions 3473will be discarded. The REF.pot file is the last created PO file with 3474up-to-date source references but old translations, or a PO Template file 3475(generally created by ‘xgettext’); any translations or comments in the 3476file will be discarded, however dot comments and file positions will be 3477preserved. Where an exact match cannot be found, fuzzy matching is used 3478to produce better results. 3479 34807.1.1 Input file location 3481------------------------- 3482 3483‘DEF.po’ 3484 Translations referring to old sources. 3485 3486‘REF.pot’ 3487 References to the new sources. 3488 3489‘-D DIRECTORY’ 3490‘--directory=DIRECTORY’ 3491 Add DIRECTORY to the list of directories. Source files are 3492 searched relative to this list of directories. The resulting ‘.po’ 3493 file will be written relative to the current directory, though. 3494 3495‘-C FILE’ 3496‘--compendium=FILE’ 3497 Specify an additional library of message translations. *Note 3498 Compendium::. This option may be specified more than once. 3499 35007.1.2 Operation mode 3501-------------------- 3502 3503‘-U’ 3504‘--update’ 3505 Update DEF.po. Do nothing if DEF.po is already up to date. 3506 35077.1.3 Output file location 3508-------------------------- 3509 3510‘-o FILE’ 3511‘--output-file=FILE’ 3512 Write output to specified file. 3513 3514 The results are written to standard output if no output file is 3515specified or if it is ‘-’. 3516 35177.1.4 Output file location in update mode 3518----------------------------------------- 3519 3520 The result is written back to DEF.po. 3521 3522‘--backup=CONTROL’ 3523 Make a backup of DEF.po 3524 3525‘--suffix=SUFFIX’ 3526 Override the usual backup suffix. 3527 3528 The version control method may be selected via the ‘--backup’ option 3529or through the ‘VERSION_CONTROL’ environment variable. Here are the 3530values: 3531 3532‘none’ 3533‘off’ 3534 Never make backups (even if ‘--backup’ is given). 3535 3536‘numbered’ 3537‘t’ 3538 Make numbered backups. 3539 3540‘existing’ 3541‘nil’ 3542 Make numbered backups if numbered backups for this file already 3543 exist, otherwise make simple backups. 3544 3545‘simple’ 3546‘never’ 3547 Always make simple backups. 3548 3549 The backup suffix is ‘~’, unless set with ‘--suffix’ or the 3550‘SIMPLE_BACKUP_SUFFIX’ environment variable. 3551 35527.1.5 Operation modifiers 3553------------------------- 3554 3555‘-m’ 3556‘--multi-domain’ 3557 Apply REF.pot to each of the domains in DEF.po. 3558 3559‘--for-msgfmt’ 3560 Produce a PO file meant for ‘msgfmt’ only, not for a translator. 3561 This option omits untranslated messages, fuzzy messages (except the 3562 header entry), and obsolete messages from the output. Also, it 3563 omits translator comments and ‘#: FILENAME:LINE’ lines from the 3564 output. In particular, this option implies ‘--no-fuzzy-matching’. 3565 3566‘-N’ 3567‘--no-fuzzy-matching’ 3568 Do not use fuzzy matching when an exact match is not found. This 3569 may speed up the operation considerably. 3570 3571‘--previous’ 3572 Keep the previous msgids of translated messages, marked with ‘#|’, 3573 when adding the fuzzy marker to such messages. 3574 35757.1.6 Input file syntax 3576----------------------- 3577 3578‘-P’ 3579‘--properties-input’ 3580 Assume the input files are Java ResourceBundles in Java 3581 ‘.properties’ syntax, not in PO file syntax. 3582 3583‘--stringtable-input’ 3584 Assume the input files are NeXTstep/GNUstep localized resource 3585 files in ‘.strings’ syntax, not in PO file syntax. 3586 35877.1.7 Output details 3588-------------------- 3589 3590‘--lang=CATALOGNAME’ 3591 Specify the ‘Language’ field to be used in the header entry. See 3592 *note Header Entry:: for the meaning of this field. Note: The 3593 ‘Language-Team’ and ‘Plural-Forms’ fields are left unchanged. If 3594 this option is not specified, the ‘Language’ field is inferred, as 3595 best as possible, from the ‘Language-Team’ field. 3596 3597‘--color’ 3598‘--color=WHEN’ 3599 Specify whether or when to use colors and other text attributes. 3600 See *note The --color option:: for details. 3601 3602‘--style=STYLE_FILE’ 3603 Specify the CSS style rule file to use for ‘--color’. See *note 3604 The --style option:: for details. 3605 3606‘--force-po’ 3607 Always write an output file even if it contains no message. 3608 3609‘-i’ 3610‘--indent’ 3611 Write the .po file using indented style. 3612 3613‘--no-location’ 3614 Do not write ‘#: FILENAME:LINE’ lines. 3615 3616‘-n’ 3617‘--add-location=TYPE’ 3618 Generate ‘#: FILENAME:LINE’ lines (default). 3619 3620 The optional TYPE can be either ‘full’, ‘file’, or ‘never’. If it 3621 is not given or ‘full’, it generates the lines with both file name 3622 and line number. If it is ‘file’, the line number part is omitted. 3623 If it is ‘never’, it completely suppresses the lines (same as 3624 ‘--no-location’). 3625 3626‘--strict’ 3627 Write out a strict Uniforum conforming PO file. Note that this 3628 Uniforum format should be avoided because it doesn’t support the 3629 GNU extensions. 3630 3631‘-p’ 3632‘--properties-output’ 3633 Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note 3634 that this file format doesn’t support plural forms and silently 3635 drops obsolete messages. 3636 3637‘--stringtable-output’ 3638 Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ 3639 syntax. Note that this file format doesn’t support plural forms. 3640 3641‘-w NUMBER’ 3642‘--width=NUMBER’ 3643 Set the output page width. Long strings in the output files will 3644 be split across multiple lines in order to ensure that each line’s 3645 width (= number of screen columns) is less or equal to the given 3646 NUMBER. 3647 3648‘--no-wrap’ 3649 Do not break long message lines. Message lines whose width exceeds 3650 the output page width will not be split into several lines. Only 3651 file reference lines which are wider than the output page width 3652 will be split. 3653 3654‘-s’ 3655‘--sort-output’ 3656 Generate sorted output. Note that using this option makes it much 3657 harder for the translator to understand each message’s context. 3658 3659‘-F’ 3660‘--sort-by-file’ 3661 Sort output by file location. 3662 36637.1.8 Informative output 3664------------------------ 3665 3666‘-h’ 3667‘--help’ 3668 Display this help and exit. 3669 3670‘-V’ 3671‘--version’ 3672 Output version information and exit. 3673 3674‘-v’ 3675‘--verbose’ 3676 Increase verbosity level. 3677 3678‘-q’ 3679‘--quiet’ 3680‘--silent’ 3681 Suppress progress indicators. 3682 3683 3684File: gettext.info, Node: Editing, Next: Manipulating, Prev: Updating, Up: Top 3685 36868 Editing PO Files 3687****************** 3688 3689* Menu: 3690 3691* KBabel:: KDE’s PO File Editor 3692* Gtranslator:: GNOME’s PO File Editor 3693* PO Mode:: Emacs’s PO File Editor 3694* Compendium:: Using Translation Compendia 3695 3696 3697File: gettext.info, Node: KBabel, Next: Gtranslator, Up: Editing 3698 36998.1 KDE’s PO File Editor 3700======================== 3701 3702 3703File: gettext.info, Node: Gtranslator, Next: PO Mode, Prev: KBabel, Up: Editing 3704 37058.2 GNOME’s PO File Editor 3706========================== 3707 3708 3709File: gettext.info, Node: PO Mode, Next: Compendium, Prev: Gtranslator, Up: Editing 3710 37118.3 Emacs’s PO File Editor 3712========================== 3713 3714 For those of you being the lucky users of Emacs, PO mode has been 3715specifically created for providing a cozy environment for editing or 3716modifying PO files. While editing a PO file, PO mode allows for the 3717easy browsing of auxiliary and compendium PO files, as well as for 3718following references into the set of C program sources from which PO 3719files have been derived. It has a few special features, among which are 3720the interactive marking of program strings as translatable, and the 3721validation of PO files with easy repositioning to PO file lines showing 3722errors. 3723 3724 For the beginning, besides main PO mode commands (*note Main PO 3725Commands::), you should know how to move between entries (*note Entry 3726Positioning::), and how to handle untranslated entries (*note 3727Untranslated Entries::). 3728 3729* Menu: 3730 3731* Installation:: Completing GNU ‘gettext’ Installation 3732* Main PO Commands:: Main Commands 3733* Entry Positioning:: Entry Positioning 3734* Normalizing:: Normalizing Strings in Entries 3735* Translated Entries:: Translated Entries 3736* Fuzzy Entries:: Fuzzy Entries 3737* Untranslated Entries:: Untranslated Entries 3738* Obsolete Entries:: Obsolete Entries 3739* Modifying Translations:: Modifying Translations 3740* Modifying Comments:: Modifying Comments 3741* Subedit:: Mode for Editing Translations 3742* C Sources Context:: C Sources Context 3743* Auxiliary:: Consulting Auxiliary PO Files 3744 3745 3746File: gettext.info, Node: Installation, Next: Main PO Commands, Up: PO Mode 3747 37488.3.1 Completing GNU ‘gettext’ Installation 3749------------------------------------------- 3750 3751 Once you have received, unpacked, configured and compiled the GNU 3752‘gettext’ distribution, the ‘make install’ command puts in place the 3753programs ‘xgettext’, ‘msgfmt’, ‘gettext’, and ‘msgmerge’, as well as 3754their available message catalogs. To top off a comfortable 3755installation, you might also want to make the PO mode available to your 3756Emacs users. 3757 3758 During the installation of the PO mode, you might want to modify your 3759file ‘.emacs’, once and for all, so it contains a few lines looking 3760like: 3761 3762 (setq auto-mode-alist 3763 (cons '("\\.po\\'\\|\\.po\\." . po-mode) auto-mode-alist)) 3764 (autoload 'po-mode "po-mode" "Major mode for translators to edit PO files" t) 3765 3766 Later, whenever you edit some ‘.po’ file, or any file having the 3767string ‘.po.’ within its name, Emacs loads ‘po-mode.elc’ (or 3768‘po-mode.el’) as needed, and automatically activates PO mode commands 3769for the associated buffer. The string _PO_ appears in the mode line for 3770any buffer for which PO mode is active. Many PO files may be active at 3771once in a single Emacs session. 3772 3773 If you are using Emacs version 20 or newer, and have already 3774installed the appropriate international fonts on your system, you may 3775also tell Emacs how to determine automatically the coding system of 3776every PO file. This will often (but not always) cause the necessary 3777fonts to be loaded and used for displaying the translations on your 3778Emacs screen. For this to happen, add the lines: 3779 3780 (modify-coding-system-alist 'file "\\.po\\'\\|\\.po\\." 3781 'po-find-file-coding-system) 3782 (autoload 'po-find-file-coding-system "po-mode") 3783 3784to your ‘.emacs’ file. If, with this, you still see boxes instead of 3785international characters, try a different font set (via Shift Mouse 3786button 1). 3787 3788 3789File: gettext.info, Node: Main PO Commands, Next: Entry Positioning, Prev: Installation, Up: PO Mode 3790 37918.3.2 Main PO mode Commands 3792--------------------------- 3793 3794 After setting up Emacs with something similar to the lines in *note 3795Installation::, PO mode is activated for a window when Emacs finds a PO 3796file in that window. This puts the window read-only and establishes a 3797po-mode-map, which is a genuine Emacs mode, in a way that is not derived 3798from text mode in any way. Functions found on ‘po-mode-hook’, if any, 3799will be executed. 3800 3801 When PO mode is active in a window, the letters ‘PO’ appear in the 3802mode line for that window. The mode line also displays how many entries 3803of each kind are held in the PO file. For example, the string 3804‘132t+3f+10u+2o’ would tell the translator that the PO mode contains 132 3805translated entries (*note Translated Entries::, 3 fuzzy entries (*note 3806Fuzzy Entries::), 10 untranslated entries (*note Untranslated Entries::) 3807and 2 obsolete entries (*note Obsolete Entries::). Zero-coefficients 3808items are not shown. So, in this example, if the fuzzy entries were 3809unfuzzied, the untranslated entries were translated and the obsolete 3810entries were deleted, the mode line would merely display ‘145t’ for the 3811counters. 3812 3813 The main PO commands are those which do not fit into the other 3814categories of subsequent sections. These allow for quitting PO mode or 3815for managing windows in special ways. 3816 3817‘_’ 3818 Undo last modification to the PO file (‘po-undo’). 3819 3820‘Q’ 3821 Quit processing and save the PO file (‘po-quit’). 3822 3823‘q’ 3824 Quit processing, possibly after confirmation 3825 (‘po-confirm-and-quit’). 3826 3827‘0’ 3828 Temporary leave the PO file window (‘po-other-window’). 3829 3830‘?’ 3831‘h’ 3832 Show help about PO mode (‘po-help’). 3833 3834‘=’ 3835 Give some PO file statistics (‘po-statistics’). 3836 3837‘V’ 3838 Batch validate the format of the whole PO file (‘po-validate’). 3839 3840 The command ‘_’ (‘po-undo’) interfaces to the Emacs _undo_ facility. 3841*Note Undoing Changes: (emacs)Undo. Each time ‘_’ is typed, 3842modifications which the translator did to the PO file are undone a 3843little more. For the purpose of undoing, each PO mode command is 3844atomic. This is especially true for the ‘<RET>’ command: the whole 3845edition made by using a single use of this command is undone at once, 3846even if the edition itself implied several actions. However, while in 3847the editing window, one can undo the edition work quite parsimoniously. 3848 3849 The commands ‘Q’ (‘po-quit’) and ‘q’ (‘po-confirm-and-quit’) are used 3850when the translator is done with the PO file. The former is a bit less 3851verbose than the latter. If the file has been modified, it is saved to 3852disk first. In both cases, and prior to all this, the commands check if 3853any untranslated messages remain in the PO file and, if so, the 3854translator is asked if she really wants to leave off working with this 3855PO file. This is the preferred way of getting rid of an Emacs PO file 3856buffer. Merely killing it through the usual command ‘C-x k’ 3857(‘kill-buffer’) is not the tidiest way to proceed. 3858 3859 The command ‘0’ (‘po-other-window’) is another, softer way, to leave 3860PO mode, temporarily. It just moves the cursor to some other Emacs 3861window, and pops one if necessary. For example, if the translator just 3862got PO mode to show some source context in some other, she might 3863discover some apparent bug in the program source that needs correction. 3864This command allows the translator to change sex, become a programmer, 3865and have the cursor right into the window containing the program she (or 3866rather _he_) wants to modify. By later getting the cursor back in the 3867PO file window, or by asking Emacs to edit this file once again, PO mode 3868is then recovered. 3869 3870 The command ‘h’ (‘po-help’) displays a summary of all available PO 3871mode commands. The translator should then type any character to resume 3872normal PO mode operations. The command ‘?’ has the same effect as ‘h’. 3873 3874 The command ‘=’ (‘po-statistics’) computes the total number of 3875entries in the PO file, the ordinal of the current entry (counted from 38761), the number of untranslated entries, the number of obsolete entries, 3877and displays all these numbers. 3878 3879 The command ‘V’ (‘po-validate’) launches ‘msgfmt’ in checking and 3880verbose mode over the current PO file. This command first offers to 3881save the current PO file on disk. The ‘msgfmt’ tool, from GNU 3882‘gettext’, has the purpose of creating a MO file out of a PO file, and 3883PO mode uses the features of this program for checking the overall 3884format of a PO file, as well as all individual entries. 3885 3886 The program ‘msgfmt’ runs asynchronously with Emacs, so the 3887translator regains control immediately while her PO file is being 3888studied. Error output is collected in the Emacs ‘*compilation*’ buffer, 3889displayed in another window. The regular Emacs command ‘C-x`’ 3890(‘next-error’), as well as other usual compile commands, allow the 3891translator to reposition quickly to the offending parts of the PO file. 3892Once the cursor is on the line in error, the translator may decide on 3893any PO mode action which would help correcting the error. 3894 3895 3896File: gettext.info, Node: Entry Positioning, Next: Normalizing, Prev: Main PO Commands, Up: PO Mode 3897 38988.3.3 Entry Positioning 3899----------------------- 3900 3901 The cursor in a PO file window is almost always part of an entry. 3902The only exceptions are the special case when the cursor is after the 3903last entry in the file, or when the PO file is empty. The entry where 3904the cursor is found to be is said to be the current entry. Many PO mode 3905commands operate on the current entry, so moving the cursor does more 3906than allowing the translator to browse the PO file, this also selects on 3907which entry commands operate. 3908 3909 Some PO mode commands alter the position of the cursor in a 3910specialized way. A few of those special purpose positioning are 3911described here, the others are described in following sections (for a 3912complete list try ‘C-h m’): 3913 3914‘.’ 3915 Redisplay the current entry (‘po-current-entry’). 3916 3917‘n’ 3918 Select the entry after the current one (‘po-next-entry’). 3919 3920‘p’ 3921 Select the entry before the current one (‘po-previous-entry’). 3922 3923‘<’ 3924 Select the first entry in the PO file (‘po-first-entry’). 3925 3926‘>’ 3927 Select the last entry in the PO file (‘po-last-entry’). 3928 3929‘m’ 3930 Record the location of the current entry for later use 3931 (‘po-push-location’). 3932 3933‘r’ 3934 Return to a previously saved entry location (‘po-pop-location’). 3935 3936‘x’ 3937 Exchange the current entry location with the previously saved one 3938 (‘po-exchange-location’). 3939 3940 Any Emacs command able to reposition the cursor may be used to select 3941the current entry in PO mode, including commands which move by 3942characters, lines, paragraphs, screens or pages, and search commands. 3943However, there is a kind of standard way to display the current entry in 3944PO mode, which usual Emacs commands moving the cursor do not especially 3945try to enforce. The command ‘.’ (‘po-current-entry’) has the sole 3946purpose of redisplaying the current entry properly, after the current 3947entry has been changed by means external to PO mode, or the Emacs screen 3948otherwise altered. 3949 3950 It is yet to be decided if PO mode helps the translator, or otherwise 3951irritates her, by forcing a rigid window disposition while she is doing 3952her work. We originally had quite precise ideas about how windows 3953should behave, but on the other hand, anyone used to Emacs is often 3954happy to keep full control. Maybe a fixed window disposition might be 3955offered as a PO mode option that the translator might activate or 3956deactivate at will, so it could be offered on an experimental basis. If 3957nobody feels a real need for using it, or a compulsion for writing it, 3958we should drop this whole idea. The incentive for doing it should come 3959from translators rather than programmers, as opinions from an 3960experienced translator are surely more worth to me than opinions from 3961programmers _thinking_ about how _others_ should do translation. 3962 3963 The commands ‘n’ (‘po-next-entry’) and ‘p’ (‘po-previous-entry’) move 3964the cursor the entry following, or preceding, the current one. If ‘n’ 3965is given while the cursor is on the last entry of the PO file, or if ‘p’ 3966is given while the cursor is on the first entry, no move is done. 3967 3968 The commands ‘<’ (‘po-first-entry’) and ‘>’ (‘po-last-entry’) move 3969the cursor to the first entry, or last entry, of the PO file. When the 3970cursor is located past the last entry in a PO file, most PO mode 3971commands will return an error saying ‘After last entry’. Moreover, the 3972commands ‘<’ and ‘>’ have the special property of being able to work 3973even when the cursor is not into some PO file entry, and one may use 3974them for nicely correcting this situation. But even these commands will 3975fail on a truly empty PO file. There are development plans for the PO 3976mode for it to interactively fill an empty PO file from sources. *Note 3977Marking::. 3978 3979 The translator may decide, before working at the translation of a 3980particular entry, that she needs to browse the remainder of the PO file, 3981maybe for finding the terminology or phraseology used in related 3982entries. She can of course use the standard Emacs idioms for saving the 3983current cursor location in some register, and use that register for 3984getting back, or else, use the location ring. 3985 3986 PO mode offers another approach, by which cursor locations may be 3987saved onto a special stack. The command ‘m’ (‘po-push-location’) merely 3988adds the location of current entry to the stack, pushing the already 3989saved locations under the new one. The command ‘r’ (‘po-pop-location’) 3990consumes the top stack element and repositions the cursor to the entry 3991associated with that top element. This position is then lost, for the 3992next ‘r’ will move the cursor to the previously saved location, and so 3993on until no locations remain on the stack. 3994 3995 If the translator wants the position to be kept on the location 3996stack, maybe for taking a look at the entry associated with the top 3997element, then go elsewhere with the intent of getting back later, she 3998ought to use ‘m’ immediately after ‘r’. 3999 4000 The command ‘x’ (‘po-exchange-location’) simultaneously repositions 4001the cursor to the entry associated with the top element of the stack of 4002saved locations, and replaces that top element with the location of the 4003current entry before the move. Consequently, repeating the ‘x’ command 4004toggles alternatively between two entries. For achieving this, the 4005translator will position the cursor on the first entry, use ‘m’, then 4006position to the second entry, and merely use ‘x’ for making the switch. 4007 4008 4009File: gettext.info, Node: Normalizing, Next: Translated Entries, Prev: Entry Positioning, Up: PO Mode 4010 40118.3.4 Normalizing Strings in Entries 4012------------------------------------ 4013 4014 There are many different ways for encoding a particular string into a 4015PO file entry, because there are so many different ways to split and 4016quote multi-line strings, and even, to represent special characters by 4017backslashed escaped sequences. Some features of PO mode rely on the 4018ability for PO mode to scan an already existing PO file for a particular 4019string encoded into the ‘msgid’ field of some entry. Even if PO mode 4020has internally all the built-in machinery for implementing this 4021recognition easily, doing it fast is technically difficult. To 4022facilitate a solution to this efficiency problem, we decided on a 4023canonical representation for strings. 4024 4025 A conventional representation of strings in a PO file is currently 4026under discussion, and PO mode experiments with a canonical 4027representation. Having both ‘xgettext’ and PO mode converging towards a 4028uniform way of representing equivalent strings would be useful, as the 4029internal normalization needed by PO mode could be automatically 4030satisfied when using ‘xgettext’ from GNU ‘gettext’. An explicit PO mode 4031normalization should then be only necessary for PO files imported from 4032elsewhere, or for when the convention itself evolves. 4033 4034 So, for achieving normalization of at least the strings of a given PO 4035file needing a canonical representation, the following PO mode command 4036is available: 4037 4038‘M-x po-normalize’ 4039 Tidy the whole PO file by making entries more uniform. 4040 4041 The special command ‘M-x po-normalize’, which has no associated keys, 4042revises all entries, ensuring that strings of both original and 4043translated entries use uniform internal quoting in the PO file. It also 4044removes any crumb after the last entry. This command may be useful for 4045PO files freshly imported from elsewhere, or if we ever improve on the 4046canonical quoting format we use. This canonical format is not only 4047meant for getting cleaner PO files, but also for greatly speeding up 4048‘msgid’ string lookup for some other PO mode commands. 4049 4050 ‘M-x po-normalize’ presently makes three passes over the entries. 4051The first implements heuristics for converting PO files for GNU 4052‘gettext’ 0.6 and earlier, in which ‘msgid’ and ‘msgstr’ fields were 4053using K&R style C string syntax for multi-line strings. These 4054heuristics may fail for comments not related to obsolete entries and 4055ending with a backslash; they also depend on subsequent passes for 4056finalizing the proper commenting of continued lines for obsolete 4057entries. This first pass might disappear once all oldish PO files would 4058have been adjusted. The second and third pass normalize all ‘msgid’ and 4059‘msgstr’ strings respectively. They also clean out those trailing 4060backslashes used by XView’s ‘msgfmt’ for continued lines. 4061 4062 Having such an explicit normalizing command allows for importing PO 4063files from other sources, but also eases the evolution of the current 4064convention, evolution driven mostly by aesthetic concerns, as of now. 4065It is easy to make suggested adjustments at a later time, as the 4066normalizing command and eventually, other GNU ‘gettext’ tools should 4067greatly automate conformance. A description of the canonical string 4068format is given below, for the particular benefit of those not having 4069Emacs handy, and who would nevertheless want to handcraft their PO files 4070in nice ways. 4071 4072 Right now, in PO mode, strings are single line or multi-line. A 4073string goes multi-line if and only if it has _embedded_ newlines, that 4074is, if it matches ‘[^\n]\n+[^\n]’. So, we would have: 4075 4076 msgstr "\n\nHello, world!\n\n\n" 4077 4078 but, replacing the space by a newline, this becomes: 4079 4080 msgstr "" 4081 "\n" 4082 "\n" 4083 "Hello,\n" 4084 "world!\n" 4085 "\n" 4086 "\n" 4087 4088 We are deliberately using a caricatural example, here, to make the 4089point clearer. Usually, multi-lines are not that bad looking. It is 4090probable that we will implement the following suggestion. We might lump 4091together all initial newlines into the empty string, and also all 4092newlines introducing empty lines (that is, for N > 1, the N-1’th last 4093newlines would go together on a separate string), so making the previous 4094example appear: 4095 4096 msgstr "\n\n" 4097 "Hello,\n" 4098 "world!\n" 4099 "\n\n" 4100 4101 There are a few yet undecided little points about string 4102normalization, to be documented in this manual, once these questions 4103settle. 4104 4105 4106File: gettext.info, Node: Translated Entries, Next: Fuzzy Entries, Prev: Normalizing, Up: PO Mode 4107 41088.3.5 Translated Entries 4109------------------------ 4110 4111 Each PO file entry for which the ‘msgstr’ field has been filled with 4112a translation, and which is not marked as fuzzy (*note Fuzzy Entries::), 4113is said to be a “translated” entry. Only translated entries will later 4114be compiled by GNU ‘msgfmt’ and become usable in programs. Other entry 4115types will be excluded; translation will not occur for them. 4116 4117 Some commands are more specifically related to translated entry 4118processing. 4119 4120‘t’ 4121 Find the next translated entry (‘po-next-translated-entry’). 4122 4123‘T’ 4124 Find the previous translated entry 4125 (‘po-previous-translated-entry’). 4126 4127 The commands ‘t’ (‘po-next-translated-entry’) and ‘T’ 4128(‘po-previous-translated-entry’) move forwards or backwards, chasing for 4129an translated entry. If none is found, the search is extended and wraps 4130around in the PO file buffer. 4131 4132 Translated entries usually result from the translator having edited 4133in a translation for them, *note Modifying Translations::. However, if 4134the variable ‘po-auto-fuzzy-on-edit’ is not ‘nil’, the entry having 4135received a new translation first becomes a fuzzy entry, which ought to 4136be later unfuzzied before becoming an official, genuine translated 4137entry. *Note Fuzzy Entries::. 4138 4139 4140File: gettext.info, Node: Fuzzy Entries, Next: Untranslated Entries, Prev: Translated Entries, Up: PO Mode 4141 41428.3.6 Fuzzy Entries 4143------------------- 4144 4145 Each PO file entry may have a set of “attributes”, which are 4146qualities given a name and explicitly associated with the translation, 4147using a special system comment. One of these attributes has the name 4148‘fuzzy’, and entries having this attribute are said to have a fuzzy 4149translation. They are called fuzzy entries, for short. 4150 4151 Fuzzy entries, even if they account for translated entries for most 4152other purposes, usually call for revision by the translator. Those may 4153be produced by applying the program ‘msgmerge’ to update an older 4154translated PO files according to a new PO template file, when this tool 4155hypothesises that some new ‘msgid’ has been modified only slightly out 4156of an older one, and chooses to pair what it thinks to be the old 4157translation for the new modified entry. The slight alteration in the 4158original string (the ‘msgid’ string) should often be reflected in the 4159translated string, and this requires the intervention of the translator. 4160For this reason, ‘msgmerge’ might mark some entries as being fuzzy. 4161 4162 Also, the translator may decide herself to mark an entry as fuzzy for 4163her own convenience, when she wants to remember that the entry has to be 4164later revisited. So, some commands are more specifically related to 4165fuzzy entry processing. 4166 4167‘f’ 4168 Find the next fuzzy entry (‘po-next-fuzzy-entry’). 4169 4170‘F’ 4171 Find the previous fuzzy entry (‘po-previous-fuzzy-entry’). 4172 4173‘<TAB>’ 4174 Remove the fuzzy attribute of the current entry (‘po-unfuzzy’). 4175 4176 The commands ‘f’ (‘po-next-fuzzy-entry’) and ‘F’ 4177(‘po-previous-fuzzy-entry’) move forwards or backwards, chasing for a 4178fuzzy entry. If none is found, the search is extended and wraps around 4179in the PO file buffer. 4180 4181 The command ‘<TAB>’ (‘po-unfuzzy’) removes the fuzzy attribute 4182associated with an entry, usually leaving it translated. Further, if 4183the variable ‘po-auto-select-on-unfuzzy’ has not the ‘nil’ value, the 4184‘<TAB>’ command will automatically chase for another interesting entry 4185to work on. The initial value of ‘po-auto-select-on-unfuzzy’ is ‘nil’. 4186 4187 The initial value of ‘po-auto-fuzzy-on-edit’ is ‘nil’. However, if 4188the variable ‘po-auto-fuzzy-on-edit’ is set to ‘t’, any entry edited 4189through the ‘<RET>’ command is marked fuzzy, as a way to ensure some 4190kind of double check, later. In this case, the usual paradigm is that 4191an entry becomes fuzzy (if not already) whenever the translator modifies 4192it. If she is satisfied with the translation, she then uses ‘<TAB>’ to 4193pick another entry to work on, clearing the fuzzy attribute on the same 4194blow. If she is not satisfied yet, she merely uses ‘<SPC>’ to chase 4195another entry, leaving the entry fuzzy. 4196 4197 The translator may also use the ‘<DEL>’ command (‘po-fade-out-entry’) 4198over any translated entry to mark it as being fuzzy, when she wants to 4199easily leave a trace she wants to later return working at this entry. 4200 4201 Also, when time comes to quit working on a PO file buffer with the 4202‘q’ command, the translator is asked for confirmation, if fuzzy string 4203still exists. 4204 4205 4206File: gettext.info, Node: Untranslated Entries, Next: Obsolete Entries, Prev: Fuzzy Entries, Up: PO Mode 4207 42088.3.7 Untranslated Entries 4209-------------------------- 4210 4211 When ‘xgettext’ originally creates a PO file, unless told otherwise, 4212it initializes the ‘msgid’ field with the untranslated string, and 4213leaves the ‘msgstr’ string to be empty. Such entries, having an empty 4214translation, are said to be “untranslated” entries. Later, when the 4215programmer slightly modifies some string right in the program, this 4216change is later reflected in the PO file by the appearance of a new 4217untranslated entry for the modified string. 4218 4219 The usual commands moving from entry to entry consider untranslated 4220entries on the same level as active entries. Untranslated entries are 4221easily recognizable by the fact they end with ‘msgstr ""’. 4222 4223 The work of the translator might be (quite naively) seen as the 4224process of seeking for an untranslated entry, editing a translation for 4225it, and repeating these actions until no untranslated entries remain. 4226Some commands are more specifically related to untranslated entry 4227processing. 4228 4229‘u’ 4230 Find the next untranslated entry (‘po-next-untranslated-entry’). 4231 4232‘U’ 4233 Find the previous untranslated entry 4234 (‘po-previous-untransted-entry’). 4235 4236‘k’ 4237 Turn the current entry into an untranslated one (‘po-kill-msgstr’). 4238 4239 The commands ‘u’ (‘po-next-untranslated-entry’) and ‘U’ 4240(‘po-previous-untransted-entry’) move forwards or backwards, chasing for 4241an untranslated entry. If none is found, the search is extended and 4242wraps around in the PO file buffer. 4243 4244 An entry can be turned back into an untranslated entry by merely 4245emptying its translation, using the command ‘k’ (‘po-kill-msgstr’). 4246*Note Modifying Translations::. 4247 4248 Also, when time comes to quit working on a PO file buffer with the 4249‘q’ command, the translator is asked for confirmation, if some 4250untranslated string still exists. 4251 4252 4253File: gettext.info, Node: Obsolete Entries, Next: Modifying Translations, Prev: Untranslated Entries, Up: PO Mode 4254 42558.3.8 Obsolete Entries 4256---------------------- 4257 4258 By “obsolete” PO file entries, we mean those entries which are 4259commented out, usually by ‘msgmerge’ when it found that the translation 4260is not needed anymore by the package being localized. 4261 4262 The usual commands moving from entry to entry consider obsolete 4263entries on the same level as active entries. Obsolete entries are 4264easily recognizable by the fact that all their lines start with ‘#’, 4265even those lines containing ‘msgid’ or ‘msgstr’. 4266 4267 Commands exist for emptying the translation or reinitializing it to 4268the original untranslated string. Commands interfacing with the kill 4269ring may force some previously saved text into the translation. The 4270user may interactively edit the translation. All these commands may 4271apply to obsolete entries, carefully leaving the entry obsolete after 4272the fact. 4273 4274 Moreover, some commands are more specifically related to obsolete 4275entry processing. 4276 4277‘o’ 4278 Find the next obsolete entry (‘po-next-obsolete-entry’). 4279 4280‘O’ 4281 Find the previous obsolete entry (‘po-previous-obsolete-entry’). 4282 4283‘<DEL>’ 4284 Make an active entry obsolete, or zap out an obsolete entry 4285 (‘po-fade-out-entry’). 4286 4287 The commands ‘o’ (‘po-next-obsolete-entry’) and ‘O’ 4288(‘po-previous-obsolete-entry’) move forwards or backwards, chasing for 4289an obsolete entry. If none is found, the search is extended and wraps 4290around in the PO file buffer. 4291 4292 PO mode does not provide ways for un-commenting an obsolete entry and 4293making it active, because this would reintroduce an original 4294untranslated string which does not correspond to any marked string in 4295the program sources. This goes with the philosophy of never introducing 4296useless ‘msgid’ values. 4297 4298 However, it is possible to comment out an active entry, so making it 4299obsolete. GNU ‘gettext’ utilities will later react to the disappearance 4300of a translation by using the untranslated string. The command ‘<DEL>’ 4301(‘po-fade-out-entry’) pushes the current entry a little further towards 4302annihilation. If the entry is active (it is a translated entry), then 4303it is first made fuzzy. If it is already fuzzy, then the entry is 4304merely commented out, with confirmation. If the entry is already 4305obsolete, then it is completely deleted from the PO file. It is easy to 4306recycle the translation so deleted into some other PO file entry, 4307usually one which is untranslated. *Note Modifying Translations::. 4308 4309 Here is a quite interesting problem to solve for later development of 4310PO mode, for those nights you are not sleepy. The idea would be that PO 4311mode might become bright enough, one of these days, to make good guesses 4312at retrieving the most probable candidate, among all obsolete entries, 4313for initializing the translation of a newly appeared string. I think it 4314might be a quite hard problem to do this algorithmically, as we have to 4315develop good and efficient measures of string similarity. Right now, PO 4316mode completely lets the decision to the translator, when the time comes 4317to find the adequate obsolete translation, it merely tries to provide 4318handy tools for helping her to do so. 4319 4320 4321File: gettext.info, Node: Modifying Translations, Next: Modifying Comments, Prev: Obsolete Entries, Up: PO Mode 4322 43238.3.9 Modifying Translations 4324---------------------------- 4325 4326 PO mode prevents direct modification of the PO file, by the usual 4327means Emacs gives for altering a buffer’s contents. By doing so, it 4328pretends helping the translator to avoid little clerical errors about 4329the overall file format, or the proper quoting of strings, as those 4330errors would be easily made. Other kinds of errors are still possible, 4331but some may be caught and diagnosed by the batch validation process, 4332which the translator may always trigger by the ‘V’ command. For all 4333other errors, the translator has to rely on her own judgment, and also 4334on the linguistic reports submitted to her by the users of the 4335translated package, having the same mother tongue. 4336 4337 When the time comes to create a translation, correct an error 4338diagnosed mechanically or reported by a user, the translators have to 4339resort to using the following commands for modifying the translations. 4340 4341‘<RET>’ 4342 Interactively edit the translation (‘po-edit-msgstr’). 4343 4344‘<LFD>’ 4345‘C-j’ 4346 Reinitialize the translation with the original, untranslated string 4347 (‘po-msgid-to-msgstr’). 4348 4349‘k’ 4350 Save the translation on the kill ring, and delete it 4351 (‘po-kill-msgstr’). 4352 4353‘w’ 4354 Save the translation on the kill ring, without deleting it 4355 (‘po-kill-ring-save-msgstr’). 4356 4357‘y’ 4358 Replace the translation, taking the new from the kill ring 4359 (‘po-yank-msgstr’). 4360 4361 The command ‘<RET>’ (‘po-edit-msgstr’) opens a new Emacs window meant 4362to edit in a new translation, or to modify an already existing 4363translation. The new window contains a copy of the translation taken 4364from the current PO file entry, all ready for edition, expunged of all 4365quoting marks, fully modifiable and with the complete extent of Emacs 4366modifying commands. When the translator is done with her modifications, 4367she may use ‘C-c C-c’ to close the subedit window with the automatically 4368requoted results, or ‘C-c C-k’ to abort her modifications. *Note 4369Subedit::, for more information. 4370 4371 The command ‘<LFD>’ (‘po-msgid-to-msgstr’) initializes, or 4372reinitializes the translation with the original string. This command is 4373normally used when the translator wants to redo a fresh translation of 4374the original string, disregarding any previous work. 4375 4376 It is possible to arrange so, whenever editing an untranslated entry, 4377the ‘<LFD>’ command be automatically executed. If you set 4378‘po-auto-edit-with-msgid’ to ‘t’, the translation gets initialised with 4379the original string, in case none exists already. The default value for 4380‘po-auto-edit-with-msgid’ is ‘nil’. 4381 4382 In fact, whether it is best to start a translation with an empty 4383string, or rather with a copy of the original string, is a matter of 4384taste or habit. Sometimes, the source language and the target language 4385are so different that is simply best to start writing on an empty page. 4386At other times, the source and target languages are so close that it 4387would be a waste to retype a number of words already being written in 4388the original string. A translator may also like having the original 4389string right under her eyes, as she will progressively overwrite the 4390original text with the translation, even if this requires some extra 4391editing work to get rid of the original. 4392 4393 The command ‘k’ (‘po-kill-msgstr’) merely empties the translation 4394string, so turning the entry into an untranslated one. But while doing 4395so, its previous contents is put apart in a special place, known as the 4396kill ring. The command ‘w’ (‘po-kill-ring-save-msgstr’) has also the 4397effect of taking a copy of the translation onto the kill ring, but it 4398otherwise leaves the entry alone, and does _not_ remove the translation 4399from the entry. Both commands use exactly the Emacs kill ring, which is 4400shared between buffers, and which is well known already to Emacs lovers. 4401 4402 The translator may use ‘k’ or ‘w’ many times in the course of her 4403work, as the kill ring may hold several saved translations. From the 4404kill ring, strings may later be reinserted in various Emacs buffers. In 4405particular, the kill ring may be used for moving translation strings 4406between different entries of a single PO file buffer, or if the 4407translator is handling many such buffers at once, even between PO files. 4408 4409 To facilitate exchanges with buffers which are not in PO mode, the 4410translation string put on the kill ring by the ‘k’ command is fully 4411unquoted before being saved: external quotes are removed, multi-line 4412strings are concatenated, and backslash escaped sequences are turned 4413into their corresponding characters. In the special case of obsolete 4414entries, the translation is also uncommented prior to saving. 4415 4416 The command ‘y’ (‘po-yank-msgstr’) completely replaces the 4417translation of the current entry by a string taken from the kill ring. 4418Following Emacs terminology, we then say that the replacement string is 4419“yanked” into the PO file buffer. *Note (emacs)Yanking::. The first 4420time ‘y’ is used, the translation receives the value of the most recent 4421addition to the kill ring. If ‘y’ is typed once again, immediately, 4422without intervening keystrokes, the translation just inserted is taken 4423away and replaced by the second most recent addition to the kill ring. 4424By repeating ‘y’ many times in a row, the translator may travel along 4425the kill ring for saved strings, until she finds the string she really 4426wanted. 4427 4428 When a string is yanked into a PO file entry, it is fully and 4429automatically requoted for complying with the format PO files should 4430have. Further, if the entry is obsolete, PO mode then appropriately 4431push the inserted string inside comments. Once again, translators 4432should not burden themselves with quoting considerations besides, of 4433course, the necessity of the translated string itself respective to the 4434program using it. 4435 4436 Note that ‘k’ or ‘w’ are not the only commands pushing strings on the 4437kill ring, as almost any PO mode command replacing translation strings 4438(or the translator comments) automatically saves the old string on the 4439kill ring. The main exceptions to this general rule are the yanking 4440commands themselves. 4441 4442 To better illustrate the operation of killing and yanking, let’s use 4443an actual example, taken from a common situation. When the programmer 4444slightly modifies some string right in the program, his change is later 4445reflected in the PO file by the appearance of a new untranslated entry 4446for the modified string, and the fact that the entry translating the 4447original or unmodified string becomes obsolete. In many cases, the 4448translator might spare herself some work by retrieving the unmodified 4449translation from the obsolete entry, then initializing the untranslated 4450entry ‘msgstr’ field with this retrieved translation. Once this done, 4451the obsolete entry is not wanted anymore, and may be safely deleted. 4452 4453 When the translator finds an untranslated entry and suspects that a 4454slight variant of the translation exists, she immediately uses ‘m’ to 4455mark the current entry location, then starts chasing obsolete entries 4456with ‘o’, hoping to find some translation corresponding to the 4457unmodified string. Once found, she uses the ‘<DEL>’ command for 4458deleting the obsolete entry, knowing that ‘<DEL>’ also _kills_ the 4459translation, that is, pushes the translation on the kill ring. Then, 4460‘r’ returns to the initial untranslated entry, and ‘y’ then _yanks_ the 4461saved translation right into the ‘msgstr’ field. The translator is then 4462free to use ‘<RET>’ for fine tuning the translation contents, and maybe 4463to later use ‘u’, then ‘m’ again, for going on with the next 4464untranslated string. 4465 4466 When some sequence of keys has to be typed over and over again, the 4467translator may find it useful to become better acquainted with the Emacs 4468capability of learning these sequences and playing them back under 4469request. *Note (emacs)Keyboard Macros::. 4470 4471 4472File: gettext.info, Node: Modifying Comments, Next: Subedit, Prev: Modifying Translations, Up: PO Mode 4473 44748.3.10 Modifying Comments 4475------------------------- 4476 4477 Any translation work done seriously will raise many linguistic 4478difficulties, for which decisions have to be made, and the choices 4479further documented. These documents may be saved within the PO file in 4480form of translator comments, which the translator is free to create, 4481delete, or modify at will. These comments may be useful to herself when 4482she returns to this PO file after a while. 4483 4484 Comments not having whitespace after the initial ‘#’, for example, 4485those beginning with ‘#.’ or ‘#:’, are _not_ translator comments, they 4486are exclusively created by other ‘gettext’ tools. So, the commands 4487below will never alter such system added comments, they are not meant 4488for the translator to modify. *Note PO Files::. 4489 4490 The following commands are somewhat similar to those modifying 4491translations, so the general indications given for those apply here. 4492*Note Modifying Translations::. 4493 4494‘#’ 4495 Interactively edit the translator comments (‘po-edit-comment’). 4496 4497‘K’ 4498 Save the translator comments on the kill ring, and delete it 4499 (‘po-kill-comment’). 4500 4501‘W’ 4502 Save the translator comments on the kill ring, without deleting it 4503 (‘po-kill-ring-save-comment’). 4504 4505‘Y’ 4506 Replace the translator comments, taking the new from the kill ring 4507 (‘po-yank-comment’). 4508 4509 These commands parallel PO mode commands for modifying the 4510translation strings, and behave much the same way as they do, except 4511that they handle this part of PO file comments meant for translator 4512usage, rather than the translation strings. So, if the descriptions 4513given below are slightly succinct, it is because the full details have 4514already been given. *Note Modifying Translations::. 4515 4516 The command ‘#’ (‘po-edit-comment’) opens a new Emacs window 4517containing a copy of the translator comments on the current PO file 4518entry. If there are no such comments, PO mode understands that the 4519translator wants to add a comment to the entry, and she is presented 4520with an empty screen. Comment marks (‘#’) and the space following them 4521are automatically removed before edition, and reinstated after. For 4522translator comments pertaining to obsolete entries, the uncommenting and 4523recommenting operations are done twice. Once in the editing window, the 4524keys ‘C-c C-c’ allow the translator to tell she is finished with editing 4525the comment. *Note Subedit::, for further details. 4526 4527 Functions found on ‘po-subedit-mode-hook’, if any, are executed after 4528the string has been inserted in the edit buffer. 4529 4530 The command ‘K’ (‘po-kill-comment’) gets rid of all translator 4531comments, while saving those comments on the kill ring. The command ‘W’ 4532(‘po-kill-ring-save-comment’) takes a copy of the translator comments on 4533the kill ring, but leaves them undisturbed in the current entry. The 4534command ‘Y’ (‘po-yank-comment’) completely replaces the translator 4535comments by a string taken at the front of the kill ring. When this 4536command is immediately repeated, the comments just inserted are 4537withdrawn, and replaced by other strings taken along the kill ring. 4538 4539 On the kill ring, all strings have the same nature. There is no 4540distinction between _translation_ strings and _translator comments_ 4541strings. So, for example, let’s presume the translator has just 4542finished editing a translation, and wants to create a new translator 4543comment to document why the previous translation was not good, just to 4544remember what was the problem. Foreseeing that she will do that in her 4545documentation, the translator may want to quote the previous translation 4546in her translator comments. To do so, she may initialize the translator 4547comments with the previous translation, still at the head of the kill 4548ring. Because editing already pushed the previous translation on the 4549kill ring, she merely has to type ‘M-w’ prior to ‘#’, and the previous 4550translation will be right there, all ready for being introduced by some 4551explanatory text. 4552 4553 On the other hand, presume there are some translator comments already 4554and that the translator wants to add to those comments, instead of 4555wholly replacing them. Then, she should edit the comment right away 4556with ‘#’. Once inside the editing window, she can use the regular Emacs 4557commands ‘C-y’ (‘yank’) and ‘M-y’ (‘yank-pop’) to get the previous 4558translation where she likes. 4559 4560 4561File: gettext.info, Node: Subedit, Next: C Sources Context, Prev: Modifying Comments, Up: PO Mode 4562 45638.3.11 Details of Sub Edition 4564----------------------------- 4565 4566 The PO subedit minor mode has a few peculiarities worth being 4567described in fuller detail. It installs a few commands over the usual 4568editing set of Emacs, which are described below. 4569 4570‘C-c C-c’ 4571 Complete edition (‘po-subedit-exit’). 4572 4573‘C-c C-k’ 4574 Abort edition (‘po-subedit-abort’). 4575 4576‘C-c C-a’ 4577 Consult auxiliary PO files (‘po-subedit-cycle-auxiliary’). 4578 4579 The window’s contents represents a translation for a given message, 4580or a translator comment. The translator may modify this window to her 4581heart’s content. Once this is done, the command ‘C-c C-c’ 4582(‘po-subedit-exit’) may be used to return the edited translation into 4583the PO file, replacing the original translation, even if it moved out of 4584sight or if buffers were switched. 4585 4586 If the translator becomes unsatisfied with her translation or 4587comment, to the extent she prefers keeping what was existent prior to 4588the ‘<RET>’ or ‘#’ command, she may use the command ‘C-c C-k’ 4589(‘po-subedit-abort’) to merely get rid of edition, while preserving the 4590original translation or comment. Another way would be for her to exit 4591normally with ‘C-c C-c’, then type ‘U’ once for undoing the whole effect 4592of last edition. 4593 4594 The command ‘C-c C-a’ (‘po-subedit-cycle-auxiliary’) allows for 4595glancing through translations already achieved in other languages, 4596directly while editing the current translation. This may be quite 4597convenient when the translator is fluent at many languages, but of 4598course, only makes sense when such completed auxiliary PO files are 4599already available to her (*note Auxiliary::). 4600 4601 Functions found on ‘po-subedit-mode-hook’, if any, are executed after 4602the string has been inserted in the edit buffer. 4603 4604 While editing her translation, the translator should pay attention to 4605not inserting unwanted ‘<RET>’ (newline) characters at the end of the 4606translated string if those are not meant to be there, or to removing 4607such characters when they are required. Since these characters are not 4608visible in the editing buffer, they are easily introduced by mistake. 4609To help her, ‘<RET>’ automatically puts the character ‘<’ at the end of 4610the string being edited, but this ‘<’ is not really part of the string. 4611On exiting the editing window with ‘C-c C-c’, PO mode automatically 4612removes such ‘<’ and all whitespace added after it. If the translator 4613adds characters after the terminating ‘<’, it looses its delimiting 4614property and integrally becomes part of the string. If she removes the 4615delimiting ‘<’, then the edited string is taken _as is_, with all 4616trailing newlines, even if invisible. Also, if the translated string 4617ought to end itself with a genuine ‘<’, then the delimiting ‘<’ may not 4618be removed; so the string should appear, in the editing window, as 4619ending with two ‘<’ in a row. 4620 4621 When a translation (or a comment) is being edited, the translator may 4622move the cursor back into the PO file buffer and freely move to other 4623entries, browsing at will. If, with an edition pending, the translator 4624wanders in the PO file buffer, she may decide to start modifying another 4625entry. Each entry being edited has its own subedit buffer. It is 4626possible to simultaneously edit the translation _and_ the comment of a 4627single entry, or to edit entries in different PO files, all at once. 4628Typing ‘<RET>’ on a field already being edited merely resumes that 4629particular edit. Yet, the translator should better be comfortable at 4630handling many Emacs windows! 4631 4632 Pending subedits may be completed or aborted in any order, regardless 4633of how or when they were started. When many subedits are pending and 4634the translator asks for quitting the PO file (with the ‘q’ command), 4635subedits are automatically resumed one at a time, so she may decide for 4636each of them. 4637 4638 4639File: gettext.info, Node: C Sources Context, Next: Auxiliary, Prev: Subedit, Up: PO Mode 4640 46418.3.12 C Sources Context 4642------------------------ 4643 4644 PO mode is particularly powerful when used with PO files created 4645through GNU ‘gettext’ utilities, as those utilities insert special 4646comments in the PO files they generate. Some of these special comments 4647relate the PO file entry to exactly where the untranslated string 4648appears in the program sources. 4649 4650 When the translator gets to an untranslated entry, she is fairly 4651often faced with an original string which is not as informative as it 4652normally should be, being succinct, cryptic, or otherwise ambiguous. 4653Before choosing how to translate the string, she needs to understand 4654better what the string really means and how tight the translation has to 4655be. Most of the time, when problems arise, the only way left to make 4656her judgment is looking at the true program sources from where this 4657string originated, searching for surrounding comments the programmer 4658might have put in there, and looking around for helping clues of _any_ 4659kind. 4660 4661 Surely, when looking at program sources, the translator will receive 4662more help if she is a fluent programmer. However, even if she is not 4663versed in programming and feels a little lost in C code, the translator 4664should not be shy at taking a look, once in a while. It is most 4665probable that she will still be able to find some of the hints she 4666needs. She will learn quickly to not feel uncomfortable in program 4667code, paying more attention to programmer’s comments, variable and 4668function names (if he dared choosing them well), and overall 4669organization, than to the program code itself. 4670 4671 The following commands are meant to help the translator at getting 4672program source context for a PO file entry. 4673 4674‘s’ 4675 Resume the display of a program source context, or cycle through 4676 them (‘po-cycle-source-reference’). 4677 4678‘M-s’ 4679 Display of a program source context selected by menu 4680 (‘po-select-source-reference’). 4681 4682‘S’ 4683 Add a directory to the search path for source files 4684 (‘po-consider-source-path’). 4685 4686‘M-S’ 4687 Delete a directory from the search path for source files 4688 (‘po-ignore-source-path’). 4689 4690 The commands ‘s’ (‘po-cycle-source-reference’) and ‘M-s’ 4691(‘po-select-source-reference’) both open another window displaying some 4692source program file, and already positioned in such a way that it shows 4693an actual use of the string to be translated. By doing so, the command 4694gives source program context for the string. But if the entry has no 4695source context references, or if all references are unresolved along the 4696search path for program sources, then the command diagnoses this as an 4697error. 4698 4699 Even if ‘s’ (or ‘M-s’) opens a new window, the cursor stays in the PO 4700file window. If the translator really wants to get into the program 4701source window, she ought to do it explicitly, maybe by using command 4702‘O’. 4703 4704 When ‘s’ is typed for the first time, or for a PO file entry which is 4705different of the last one used for getting source context, then the 4706command reacts by giving the first context available for this entry, if 4707any. If some context has already been recently displayed for the 4708current PO file entry, and the translator wandered off to do other 4709things, typing ‘s’ again will merely resume, in another window, the 4710context last displayed. In particular, if the translator moved the 4711cursor away from the context in the source file, the command will bring 4712the cursor back to the context. By using ‘s’ many times in a row, with 4713no other commands intervening, PO mode will cycle to the next available 4714contexts for this particular entry, getting back to the first context 4715once the last has been shown. 4716 4717 The command ‘M-s’ behaves differently. Instead of cycling through 4718references, it lets the translator choose a particular reference among 4719many, and displays that reference. It is best used with completion, if 4720the translator types ‘<TAB>’ immediately after ‘M-s’, in response to the 4721question, she will be offered a menu of all possible references, as a 4722reminder of which are the acceptable answers. This command is useful 4723only where there are really many contexts available for a single string 4724to translate. 4725 4726 Program source files are usually found relative to where the PO file 4727stands. As a special provision, when this fails, the file is also 4728looked for, but relative to the directory immediately above it. Those 4729two cases take proper care of most PO files. However, it might happen 4730that a PO file has been moved, or is edited in a different place than 4731its normal location. When this happens, the translator should tell PO 4732mode in which directory normally sits the genuine PO file. Many such 4733directories may be specified, and all together, they constitute what is 4734called the “search path” for program sources. The command ‘S’ 4735(‘po-consider-source-path’) is used to interactively enter a new 4736directory at the front of the search path, and the command ‘M-S’ 4737(‘po-ignore-source-path’) is used to select, with completion, one of the 4738directories she does not want anymore on the search path. 4739 4740 4741File: gettext.info, Node: Auxiliary, Prev: C Sources Context, Up: PO Mode 4742 47438.3.13 Consulting Auxiliary PO Files 4744------------------------------------ 4745 4746 PO mode is able to help the knowledgeable translator, being fluent in 4747many languages, at taking advantage of translations already achieved in 4748other languages she just happens to know. It provides these other 4749language translations as additional context for her own work. Moreover, 4750it has features to ease the production of translations for many 4751languages at once, for translators preferring to work in this way. 4752 4753 An “auxiliary” PO file is an existing PO file meant for the same 4754package the translator is working on, but targeted to a different mother 4755tongue language. Commands exist for declaring and handling auxiliary PO 4756files, and also for showing contexts for the entry under work. 4757 4758 Here are the auxiliary file commands available in PO mode. 4759 4760‘a’ 4761 Seek auxiliary files for another translation for the same entry 4762 (‘po-cycle-auxiliary’). 4763 4764‘C-c C-a’ 4765 Switch to a particular auxiliary file (‘po-select-auxiliary’). 4766 4767‘A’ 4768 Declare this PO file as an auxiliary file 4769 (‘po-consider-as-auxiliary’). 4770 4771‘M-A’ 4772 Remove this PO file from the list of auxiliary files 4773 (‘po-ignore-as-auxiliary’). 4774 4775 Command ‘A’ (‘po-consider-as-auxiliary’) adds the current PO file to 4776the list of auxiliary files, while command ‘M-A’ 4777(‘po-ignore-as-auxiliary’ just removes it. 4778 4779 The command ‘a’ (‘po-cycle-auxiliary’) seeks all auxiliary PO files, 4780round-robin, searching for a translated entry in some other language 4781having an ‘msgid’ field identical as the one for the current entry. The 4782found PO file, if any, takes the place of the current PO file in the 4783display (its window gets on top). Before doing so, the current PO file 4784is also made into an auxiliary file, if not already. So, ‘a’ in this 4785newly displayed PO file will seek another PO file, and so on, so 4786repeating ‘a’ will eventually yield back the original PO file. 4787 4788 The command ‘C-c C-a’ (‘po-select-auxiliary’) asks the translator for 4789her choice of a particular auxiliary file, with completion, and then 4790switches to that selected PO file. The command also checks if the 4791selected file has an ‘msgid’ field identical as the one for the current 4792entry, and if yes, this entry becomes current. Otherwise, the cursor of 4793the selected file is left undisturbed. 4794 4795 For all this to work fully, auxiliary PO files will have to be 4796normalized, in that way that ‘msgid’ fields should be written _exactly_ 4797the same way. It is possible to write ‘msgid’ fields in various ways 4798for representing the same string, different writing would break the 4799proper behaviour of the auxiliary file commands of PO mode. This is not 4800expected to be much a problem in practice, as most existing PO files 4801have their ‘msgid’ entries written by the same GNU ‘gettext’ tools. 4802 4803 However, PO files initially created by PO mode itself, while marking 4804strings in source files, are normalised differently. So are PO files 4805resulting of the ‘M-x normalize’ command. Until these discrepancies 4806between PO mode and other GNU ‘gettext’ tools get fully resolved, the 4807translator should stay aware of normalisation issues. 4808 4809 4810File: gettext.info, Node: Compendium, Prev: PO Mode, Up: Editing 4811 48128.4 Using Translation Compendia 4813=============================== 4814 4815 A “compendium” is a special PO file containing a set of translations 4816recurring in many different packages. The translator can use gettext 4817tools to build a new compendium, to add entries to her compendium, and 4818to initialize untranslated entries, or to update already translated 4819entries, from translations kept in the compendium. 4820 4821* Menu: 4822 4823* Creating Compendia:: Merging translations for later use 4824* Using Compendia:: Using older translations if they fit 4825 4826 4827File: gettext.info, Node: Creating Compendia, Next: Using Compendia, Up: Compendium 4828 48298.4.1 Creating Compendia 4830------------------------ 4831 4832 Basically every PO file consisting of translated entries only can be 4833declared as a valid compendium. Often the translator wants to have 4834special compendia; let’s consider two cases: ‘concatenating PO files’ 4835and ‘extracting a message subset from a PO file’. 4836 48378.4.1.1 Concatenate PO Files 4838............................ 4839 4840 To concatenate several valid PO files into one compendium file you 4841can use ‘msgcomm’ or ‘msgcat’ (the latter preferred): 4842 4843 msgcat -o compendium.po file1.po file2.po 4844 4845 By default, ‘msgcat’ will accumulate divergent translations for the 4846same string. Those occurrences will be marked as ‘fuzzy’ and highly 4847visible decorated; calling ‘msgcat’ on ‘file1.po’: 4848 4849 #: src/hello.c:200 4850 #, c-format 4851 msgid "Report bugs to <%s>.\n" 4852 msgstr "Comunicar `bugs' a <%s>.\n" 4853 4854and ‘file2.po’: 4855 4856 #: src/bye.c:100 4857 #, c-format 4858 msgid "Report bugs to <%s>.\n" 4859 msgstr "Comunicar \"bugs\" a <%s>.\n" 4860 4861will result in: 4862 4863 #: src/hello.c:200 src/bye.c:100 4864 #, fuzzy, c-format 4865 msgid "Report bugs to <%s>.\n" 4866 msgstr "" 4867 "#-#-#-#-# file1.po #-#-#-#-#\n" 4868 "Comunicar `bugs' a <%s>.\n" 4869 "#-#-#-#-# file2.po #-#-#-#-#\n" 4870 "Comunicar \"bugs\" a <%s>.\n" 4871 4872The translator will have to resolve this “conflict” manually; she has to 4873decide whether the first or the second version is appropriate (or 4874provide a new translation), to delete the “marker lines”, and finally to 4875remove the ‘fuzzy’ mark. 4876 4877 If the translator knows in advance the first found translation of a 4878message is always the best translation she can make use to the 4879‘--use-first’ switch: 4880 4881 msgcat --use-first -o compendium.po file1.po file2.po 4882 4883 A good compendium file must not contain ‘fuzzy’ or untranslated 4884entries. If input files are “dirty” you must preprocess the input files 4885or postprocess the result using ‘msgattrib --translated --no-fuzzy’. 4886 48878.4.1.2 Extract a Message Subset from a PO File 4888............................................... 4889 4890 Nobody wants to translate the same messages again and again; thus you 4891may wish to have a compendium file containing ‘getopt.c’ messages. 4892 4893 To extract a message subset (e.g., all ‘getopt.c’ messages) from an 4894existing PO file into one compendium file you can use ‘msggrep’: 4895 4896 msggrep --location src/getopt.c -o compendium.po file.po 4897 4898 4899File: gettext.info, Node: Using Compendia, Prev: Creating Compendia, Up: Compendium 4900 49018.4.2 Using Compendia 4902--------------------- 4903 4904 You can use a compendium file to initialize a translation from 4905scratch or to update an already existing translation. 4906 49078.4.2.1 Initialize a New Translation File 4908......................................... 4909 4910 Since a PO file with translations does not exist the translator can 4911merely use ‘/dev/null’ to fake the “old” translation file. 4912 4913 msgmerge --compendium compendium.po -o file.po /dev/null file.pot 4914 49158.4.2.2 Update an Existing Translation File 4916........................................... 4917 4918 Concatenate the compendium file(s) and the existing PO, merge the 4919result with the POT file and remove the obsolete entries (optional, here 4920done using ‘msgattrib’): 4921 4922 msgcat --use-first -o update.po compendium1.po compendium2.po file.po 4923 msgmerge update.po file.pot | msgattrib --no-obsolete > file.po 4924 4925 4926File: gettext.info, Node: Manipulating, Next: Binaries, Prev: Editing, Up: Top 4927 49289 Manipulating PO Files 4929*********************** 4930 4931 Sometimes it is necessary to manipulate PO files in a way that is 4932better performed automatically than by hand. GNU ‘gettext’ includes a 4933complete set of tools for this purpose. 4934 4935 When merging two packages into a single package, the resulting POT 4936file will be the concatenation of the two packages’ POT files. Thus the 4937maintainer must concatenate the two existing package translations into a 4938single translation catalog, for each language. This is best performed 4939using ‘msgcat’. It is then the translators’ duty to deal with any 4940possible conflicts that arose during the merge. 4941 4942 When a translator takes over the translation job from another 4943translator, but she uses a different character encoding in her locale, 4944she will convert the catalog to her character encoding. This is best 4945done through the ‘msgconv’ program. 4946 4947 When a maintainer takes a source file with tagged messages from 4948another package, he should also take the existing translations for this 4949source file (and not let the translators do the same job twice). One 4950way to do this is through ‘msggrep’, another is to create a POT file for 4951that source file and use ‘msgmerge’. 4952 4953 When a translator wants to adjust some translation catalog for a 4954special dialect or orthography — for example, German as written in 4955Switzerland versus German as written in Germany — she needs to apply 4956some text processing to every message in the catalog. The tool for 4957doing this is ‘msgfilter’. 4958 4959 Another use of ‘msgfilter’ is to produce approximately the POT file 4960for which a given PO file was made. This can be done through a filter 4961command like ‘msgfilter sed -e d | sed -e '/^# /d'’. Note that the 4962original POT file may have had different comments and different plural 4963message counts, that’s why it’s better to use the original POT file if 4964available. 4965 4966 When a translator wants to check her translations, for example 4967according to orthography rules or using a non-interactive spell checker, 4968she can do so using the ‘msgexec’ program. 4969 4970 When third party tools create PO or POT files, sometimes duplicates 4971cannot be avoided. But the GNU ‘gettext’ tools give an error when they 4972encounter duplicate msgids in the same file and in the same domain. To 4973merge duplicates, the ‘msguniq’ program can be used. 4974 4975 ‘msgcomm’ is a more general tool for keeping or throwing away 4976duplicates, occurring in different files. 4977 4978 ‘msgcmp’ can be used to check whether a translation catalog is 4979completely translated. 4980 4981 ‘msgattrib’ can be used to select and extract only the fuzzy or 4982untranslated messages of a translation catalog. 4983 4984 ‘msgen’ is useful as a first step for preparing English translation 4985catalogs. It copies each message’s msgid to its msgstr. 4986 4987 Finally, for those applications where all these various programs are 4988not sufficient, a library ‘libgettextpo’ is provided that can be used to 4989write other specialized programs that process PO files. 4990 4991* Menu: 4992 4993* msgcat Invocation:: Invoking the ‘msgcat’ Program 4994* msgconv Invocation:: Invoking the ‘msgconv’ Program 4995* msggrep Invocation:: Invoking the ‘msggrep’ Program 4996* msgfilter Invocation:: Invoking the ‘msgfilter’ Program 4997* msguniq Invocation:: Invoking the ‘msguniq’ Program 4998* msgcomm Invocation:: Invoking the ‘msgcomm’ Program 4999* msgcmp Invocation:: Invoking the ‘msgcmp’ Program 5000* msgattrib Invocation:: Invoking the ‘msgattrib’ Program 5001* msgen Invocation:: Invoking the ‘msgen’ Program 5002* msgexec Invocation:: Invoking the ‘msgexec’ Program 5003* Colorizing:: Highlighting parts of PO files 5004* Other tools:: Other tools for manipulating PO files 5005* libgettextpo:: Writing your own programs that process PO files 5006 5007 5008File: gettext.info, Node: msgcat Invocation, Next: msgconv Invocation, Up: Manipulating 5009 50109.1 Invoking the ‘msgcat’ Program 5011================================= 5012 5013 msgcat [OPTION] [INPUTFILE]... 5014 5015 The ‘msgcat’ program concatenates and merges the specified PO files. 5016It finds messages which are common to two or more of the specified PO 5017files. By using the ‘--more-than’ option, greater commonality may be 5018requested before messages are printed. Conversely, the ‘--less-than’ 5019option may be used to specify less commonality before messages are 5020printed (i.e. ‘--less-than=2’ will only print the unique messages). 5021Translations, comments, extracted comments, and file positions will be 5022cumulated, except that if ‘--use-first’ is specified, they will be taken 5023from the first PO file to define them. 5024 5025 To concatenate POT files, better use ‘xgettext’, not ‘msgcat’, 5026because ‘msgcat’ would choke on the undefined charsets in the specified 5027POT files. 5028 50299.1.1 Input file location 5030------------------------- 5031 5032‘INPUTFILE ...’ 5033 Input files. 5034 5035‘-f FILE’ 5036‘--files-from=FILE’ 5037 Read the names of the input files from FILE instead of getting them 5038 from the command line. 5039 5040‘-D DIRECTORY’ 5041‘--directory=DIRECTORY’ 5042 Add DIRECTORY to the list of directories. Source files are 5043 searched relative to this list of directories. The resulting ‘.po’ 5044 file will be written relative to the current directory, though. 5045 5046 If INPUTFILE is ‘-’, standard input is read. 5047 50489.1.2 Output file location 5049-------------------------- 5050 5051‘-o FILE’ 5052‘--output-file=FILE’ 5053 Write output to specified file. 5054 5055 The results are written to standard output if no output file is 5056specified or if it is ‘-’. 5057 50589.1.3 Message selection 5059----------------------- 5060 5061‘-< NUMBER’ 5062‘--less-than=NUMBER’ 5063 Print messages with less than NUMBER definitions, defaults to 5064 infinite if not set. 5065 5066‘-> NUMBER’ 5067‘--more-than=NUMBER’ 5068 Print messages with more than NUMBER definitions, defaults to 0 if 5069 not set. 5070 5071‘-u’ 5072‘--unique’ 5073 Shorthand for ‘--less-than=2’. Requests that only unique messages 5074 be printed. 5075 50769.1.4 Input file syntax 5077----------------------- 5078 5079‘-P’ 5080‘--properties-input’ 5081 Assume the input files are Java ResourceBundles in Java 5082 ‘.properties’ syntax, not in PO file syntax. 5083 5084‘--stringtable-input’ 5085 Assume the input files are NeXTstep/GNUstep localized resource 5086 files in ‘.strings’ syntax, not in PO file syntax. 5087 50889.1.5 Output details 5089-------------------- 5090 5091‘-t’ 5092‘--to-code=NAME’ 5093 Specify encoding for output. 5094 5095‘--use-first’ 5096 Use first available translation for each message. Don’t merge 5097 several translations into one. 5098 5099‘--lang=CATALOGNAME’ 5100 Specify the ‘Language’ field to be used in the header entry. See 5101 *note Header Entry:: for the meaning of this field. Note: The 5102 ‘Language-Team’ and ‘Plural-Forms’ fields are left unchanged. 5103 5104‘--color’ 5105‘--color=WHEN’ 5106 Specify whether or when to use colors and other text attributes. 5107 See *note The --color option:: for details. 5108 5109‘--style=STYLE_FILE’ 5110 Specify the CSS style rule file to use for ‘--color’. See *note 5111 The --style option:: for details. 5112 5113‘--force-po’ 5114 Always write an output file even if it contains no message. 5115 5116‘-i’ 5117‘--indent’ 5118 Write the .po file using indented style. 5119 5120‘--no-location’ 5121 Do not write ‘#: FILENAME:LINE’ lines. 5122 5123‘-n’ 5124‘--add-location=TYPE’ 5125 Generate ‘#: FILENAME:LINE’ lines (default). 5126 5127 The optional TYPE can be either ‘full’, ‘file’, or ‘never’. If it 5128 is not given or ‘full’, it generates the lines with both file name 5129 and line number. If it is ‘file’, the line number part is omitted. 5130 If it is ‘never’, it completely suppresses the lines (same as 5131 ‘--no-location’). 5132 5133‘--strict’ 5134 Write out a strict Uniforum conforming PO file. Note that this 5135 Uniforum format should be avoided because it doesn’t support the 5136 GNU extensions. 5137 5138‘-p’ 5139‘--properties-output’ 5140 Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note 5141 that this file format doesn’t support plural forms and silently 5142 drops obsolete messages. 5143 5144‘--stringtable-output’ 5145 Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ 5146 syntax. Note that this file format doesn’t support plural forms. 5147 5148‘-w NUMBER’ 5149‘--width=NUMBER’ 5150 Set the output page width. Long strings in the output files will 5151 be split across multiple lines in order to ensure that each line’s 5152 width (= number of screen columns) is less or equal to the given 5153 NUMBER. 5154 5155‘--no-wrap’ 5156 Do not break long message lines. Message lines whose width exceeds 5157 the output page width will not be split into several lines. Only 5158 file reference lines which are wider than the output page width 5159 will be split. 5160 5161‘-s’ 5162‘--sort-output’ 5163 Generate sorted output. Note that using this option makes it much 5164 harder for the translator to understand each message’s context. 5165 5166‘-F’ 5167‘--sort-by-file’ 5168 Sort output by file location. 5169 51709.1.6 Informative output 5171------------------------ 5172 5173‘-h’ 5174‘--help’ 5175 Display this help and exit. 5176 5177‘-V’ 5178‘--version’ 5179 Output version information and exit. 5180 5181 5182File: gettext.info, Node: msgconv Invocation, Next: msggrep Invocation, Prev: msgcat Invocation, Up: Manipulating 5183 51849.2 Invoking the ‘msgconv’ Program 5185================================== 5186 5187 msgconv [OPTION] [INPUTFILE] 5188 5189 The ‘msgconv’ program converts a translation catalog to a different 5190character encoding. 5191 51929.2.1 Input file location 5193------------------------- 5194 5195‘INPUTFILE’ 5196 Input PO file. 5197 5198‘-D DIRECTORY’ 5199‘--directory=DIRECTORY’ 5200 Add DIRECTORY to the list of directories. Source files are 5201 searched relative to this list of directories. The resulting ‘.po’ 5202 file will be written relative to the current directory, though. 5203 5204 If no INPUTFILE is given or if it is ‘-’, standard input is read. 5205 52069.2.2 Output file location 5207-------------------------- 5208 5209‘-o FILE’ 5210‘--output-file=FILE’ 5211 Write output to specified file. 5212 5213 The results are written to standard output if no output file is 5214specified or if it is ‘-’. 5215 52169.2.3 Conversion target 5217----------------------- 5218 5219‘-t’ 5220‘--to-code=NAME’ 5221 Specify encoding for output. 5222 5223 The default encoding is the current locale’s encoding. 5224 52259.2.4 Input file syntax 5226----------------------- 5227 5228‘-P’ 5229‘--properties-input’ 5230 Assume the input file is a Java ResourceBundle in Java 5231 ‘.properties’ syntax, not in PO file syntax. 5232 5233‘--stringtable-input’ 5234 Assume the input file is a NeXTstep/GNUstep localized resource file 5235 in ‘.strings’ syntax, not in PO file syntax. 5236 52379.2.5 Output details 5238-------------------- 5239 5240‘--color’ 5241‘--color=WHEN’ 5242 Specify whether or when to use colors and other text attributes. 5243 See *note The --color option:: for details. 5244 5245‘--style=STYLE_FILE’ 5246 Specify the CSS style rule file to use for ‘--color’. See *note 5247 The --style option:: for details. 5248 5249‘--force-po’ 5250 Always write an output file even if it contains no message. 5251 5252‘-i’ 5253‘--indent’ 5254 Write the .po file using indented style. 5255 5256‘--no-location’ 5257 Do not write ‘#: FILENAME:LINE’ lines. 5258 5259‘-n’ 5260‘--add-location=TYPE’ 5261 Generate ‘#: FILENAME:LINE’ lines (default). 5262 5263 The optional TYPE can be either ‘full’, ‘file’, or ‘never’. If it 5264 is not given or ‘full’, it generates the lines with both file name 5265 and line number. If it is ‘file’, the line number part is omitted. 5266 If it is ‘never’, it completely suppresses the lines (same as 5267 ‘--no-location’). 5268 5269‘--strict’ 5270 Write out a strict Uniforum conforming PO file. Note that this 5271 Uniforum format should be avoided because it doesn’t support the 5272 GNU extensions. 5273 5274‘-p’ 5275‘--properties-output’ 5276 Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note 5277 that this file format doesn’t support plural forms and silently 5278 drops obsolete messages. 5279 5280‘--stringtable-output’ 5281 Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ 5282 syntax. Note that this file format doesn’t support plural forms. 5283 5284‘-w NUMBER’ 5285‘--width=NUMBER’ 5286 Set the output page width. Long strings in the output files will 5287 be split across multiple lines in order to ensure that each line’s 5288 width (= number of screen columns) is less or equal to the given 5289 NUMBER. 5290 5291‘--no-wrap’ 5292 Do not break long message lines. Message lines whose width exceeds 5293 the output page width will not be split into several lines. Only 5294 file reference lines which are wider than the output page width 5295 will be split. 5296 5297‘-s’ 5298‘--sort-output’ 5299 Generate sorted output. Note that using this option makes it much 5300 harder for the translator to understand each message’s context. 5301 5302‘-F’ 5303‘--sort-by-file’ 5304 Sort output by file location. 5305 53069.2.6 Informative output 5307------------------------ 5308 5309‘-h’ 5310‘--help’ 5311 Display this help and exit. 5312 5313‘-V’ 5314‘--version’ 5315 Output version information and exit. 5316 5317 5318File: gettext.info, Node: msggrep Invocation, Next: msgfilter Invocation, Prev: msgconv Invocation, Up: Manipulating 5319 53209.3 Invoking the ‘msggrep’ Program 5321================================== 5322 5323 msggrep [OPTION] [INPUTFILE] 5324 5325 The ‘msggrep’ program extracts all messages of a translation catalog 5326that match a given pattern or belong to some given source files. 5327 53289.3.1 Input file location 5329------------------------- 5330 5331‘INPUTFILE’ 5332 Input PO file. 5333 5334‘-D DIRECTORY’ 5335‘--directory=DIRECTORY’ 5336 Add DIRECTORY to the list of directories. Source files are 5337 searched relative to this list of directories. The resulting ‘.po’ 5338 file will be written relative to the current directory, though. 5339 5340 If no INPUTFILE is given or if it is ‘-’, standard input is read. 5341 53429.3.2 Output file location 5343-------------------------- 5344 5345‘-o FILE’ 5346‘--output-file=FILE’ 5347 Write output to specified file. 5348 5349 The results are written to standard output if no output file is 5350specified or if it is ‘-’. 5351 53529.3.3 Message selection 5353----------------------- 5354 5355 [-N SOURCEFILE]... [-M DOMAINNAME]... 5356 [-J MSGCTXT-PATTERN] [-K MSGID-PATTERN] [-T MSGSTR-PATTERN] 5357 [-C COMMENT-PATTERN] 5358 5359 A message is selected if 5360 • it comes from one of the specified source files, 5361 • or if it comes from one of the specified domains, 5362 • or if ‘-J’ is given and its context (msgctxt) matches 5363 MSGCTXT-PATTERN, 5364 • or if ‘-K’ is given and its key (msgid or msgid_plural) matches 5365 MSGID-PATTERN, 5366 • or if ‘-T’ is given and its translation (msgstr) matches 5367 MSGSTR-PATTERN, 5368 • or if ‘-C’ is given and the translator’s comment matches 5369 COMMENT-PATTERN. 5370 5371 When more than one selection criterion is specified, the set of 5372selected messages is the union of the selected messages of each 5373criterion. 5374 5375 MSGCTXT-PATTERN or MSGID-PATTERN or MSGSTR-PATTERN syntax: 5376 [-E | -F] [-e PATTERN | -f FILE]... 5377 PATTERNs are basic regular expressions by default, or extended 5378regular expressions if -E is given, or fixed strings if -F is given. 5379 5380‘-N SOURCEFILE’ 5381‘--location=SOURCEFILE’ 5382 Select messages extracted from SOURCEFILE. SOURCEFILE can be 5383 either a literal file name or a wildcard pattern. 5384 5385‘-M DOMAINNAME’ 5386‘--domain=DOMAINNAME’ 5387 Select messages belonging to domain DOMAINNAME. 5388 5389‘-J’ 5390‘--msgctxt’ 5391 Start of patterns for the msgctxt. 5392 5393‘-K’ 5394‘--msgid’ 5395 Start of patterns for the msgid. 5396 5397‘-T’ 5398‘--msgstr’ 5399 Start of patterns for the msgstr. 5400 5401‘-C’ 5402‘--comment’ 5403 Start of patterns for the translator’s comment. 5404 5405‘-X’ 5406‘--extracted-comment’ 5407 Start of patterns for the extracted comments. 5408 5409‘-E’ 5410‘--extended-regexp’ 5411 Specify that PATTERN is an extended regular expression. 5412 5413‘-F’ 5414‘--fixed-strings’ 5415 Specify that PATTERN is a set of newline-separated strings. 5416 5417‘-e PATTERN’ 5418‘--regexp=PATTERN’ 5419 Use PATTERN as a regular expression. 5420 5421‘-f FILE’ 5422‘--file=FILE’ 5423 Obtain PATTERN from FILE. 5424 5425‘-i’ 5426‘--ignore-case’ 5427 Ignore case distinctions. 5428 5429‘-v’ 5430‘--invert-match’ 5431 Output only the messages that do not match any selection criterion, 5432 instead of the messages that match a selection criterion. 5433 54349.3.4 Input file syntax 5435----------------------- 5436 5437‘-P’ 5438‘--properties-input’ 5439 Assume the input file is a Java ResourceBundle in Java 5440 ‘.properties’ syntax, not in PO file syntax. 5441 5442‘--stringtable-input’ 5443 Assume the input file is a NeXTstep/GNUstep localized resource file 5444 in ‘.strings’ syntax, not in PO file syntax. 5445 54469.3.5 Output details 5447-------------------- 5448 5449‘--color’ 5450‘--color=WHEN’ 5451 Specify whether or when to use colors and other text attributes. 5452 See *note The --color option:: for details. 5453 5454‘--style=STYLE_FILE’ 5455 Specify the CSS style rule file to use for ‘--color’. See *note 5456 The --style option:: for details. 5457 5458‘--force-po’ 5459 Always write an output file even if it contains no message. 5460 5461‘--indent’ 5462 Write the .po file using indented style. 5463 5464‘--no-location’ 5465 Do not write ‘#: FILENAME:LINE’ lines. 5466 5467‘-n’ 5468‘--add-location=TYPE’ 5469 Generate ‘#: FILENAME:LINE’ lines (default). 5470 5471 The optional TYPE can be either ‘full’, ‘file’, or ‘never’. If it 5472 is not given or ‘full’, it generates the lines with both file name 5473 and line number. If it is ‘file’, the line number part is omitted. 5474 If it is ‘never’, it completely suppresses the lines (same as 5475 ‘--no-location’). 5476 5477‘--strict’ 5478 Write out a strict Uniforum conforming PO file. Note that this 5479 Uniforum format should be avoided because it doesn’t support the 5480 GNU extensions. 5481 5482‘-p’ 5483‘--properties-output’ 5484 Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note 5485 that this file format doesn’t support plural forms and silently 5486 drops obsolete messages. 5487 5488‘--stringtable-output’ 5489 Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ 5490 syntax. Note that this file format doesn’t support plural forms. 5491 5492‘-w NUMBER’ 5493‘--width=NUMBER’ 5494 Set the output page width. Long strings in the output files will 5495 be split across multiple lines in order to ensure that each line’s 5496 width (= number of screen columns) is less or equal to the given 5497 NUMBER. 5498 5499‘--no-wrap’ 5500 Do not break long message lines. Message lines whose width exceeds 5501 the output page width will not be split into several lines. Only 5502 file reference lines which are wider than the output page width 5503 will be split. 5504 5505‘--sort-output’ 5506 Generate sorted output. Note that using this option makes it much 5507 harder for the translator to understand each message’s context. 5508 5509‘--sort-by-file’ 5510 Sort output by file location. 5511 55129.3.6 Informative output 5513------------------------ 5514 5515‘-h’ 5516‘--help’ 5517 Display this help and exit. 5518 5519‘-V’ 5520‘--version’ 5521 Output version information and exit. 5522 55239.3.7 Examples 5524-------------- 5525 5526 To extract the messages that come from the source files 5527‘gnulib-lib/error.c’ and ‘gnulib-lib/getopt.c’: 5528 5529 msggrep -N gnulib-lib/error.c -N gnulib-lib/getopt.c input.po 5530 5531 To extract the messages that contain the string “Please specify” in 5532the original string: 5533 5534 msggrep --msgid -F -e 'Please specify' input.po 5535 5536 To extract the messages that have a context specifier of either 5537“Menu>File” or “Menu>Edit” or a submenu of them: 5538 5539 msggrep --msgctxt -E -e '^Menu>(File|Edit)' input.po 5540 5541 To extract the messages whose translation contains one of the strings 5542in the file ‘wordlist.txt’: 5543 5544 msggrep --msgstr -F -f wordlist.txt input.po 5545 5546 5547File: gettext.info, Node: msgfilter Invocation, Next: msguniq Invocation, Prev: msggrep Invocation, Up: Manipulating 5548 55499.4 Invoking the ‘msgfilter’ Program 5550==================================== 5551 5552 msgfilter [OPTION] FILTER [FILTER-OPTION] 5553 5554 The ‘msgfilter’ program applies a filter to all translations of a 5555translation catalog. 5556 5557 During each FILTER invocation, the environment variable 5558‘MSGFILTER_MSGID’ is bound to the message’s msgid, and the environment 5559variable ‘MSGFILTER_LOCATION’ is bound to the location in the PO file of 5560the message. If the message has a context, the environment variable 5561‘MSGFILTER_MSGCTXT’ is bound to the message’s msgctxt, otherwise it is 5562unbound. If the message has a plural form, environment variable 5563‘MSGFILTER_MSGID_PLURAL’ is bound to the message’s msgid_plural and 5564‘MSGFILTER_PLURAL_FORM’ is bound to the order number of the plural 5565actually processed (starting with 0), otherwise both are unbound. If 5566the message has a previous msgid (added by ‘msgmerge’), environment 5567variable ‘MSGFILTER_PREV_MSGCTXT’ is bound to the message’s previous 5568msgctxt, ‘MSGFILTER_PREV_MSGID’ is bound to the previous msgid, and 5569‘MSGFILTER_PREV_MSGID_PLURAL’ is bound to the previous msgid_plural. 5570 55719.4.1 Input file location 5572------------------------- 5573 5574‘-i INPUTFILE’ 5575‘--input=INPUTFILE’ 5576 Input PO file. 5577 5578‘-D DIRECTORY’ 5579‘--directory=DIRECTORY’ 5580 Add DIRECTORY to the list of directories. Source files are 5581 searched relative to this list of directories. The resulting ‘.po’ 5582 file will be written relative to the current directory, though. 5583 5584 If no INPUTFILE is given or if it is ‘-’, standard input is read. 5585 55869.4.2 Output file location 5587-------------------------- 5588 5589‘-o FILE’ 5590‘--output-file=FILE’ 5591 Write output to specified file. 5592 5593 The results are written to standard output if no output file is 5594specified or if it is ‘-’. 5595 55969.4.3 The filter 5597---------------- 5598 5599 The FILTER can be any program that reads a translation from standard 5600input and writes a modified translation to standard output. A 5601frequently used filter is ‘sed’. A few particular built-in filters are 5602also recognized. 5603 5604‘--newline’ 5605 Add newline at the end of each input line and also strip the ending 5606 newline from the output line. 5607 5608 Note: If the filter is not a built-in filter, you have to care about 5609encodings: It is your responsibility to ensure that the FILTER can cope 5610with input encoded in the translation catalog’s encoding. If the FILTER 5611wants input in a particular encoding, you can in a first step convert 5612the translation catalog to that encoding using the ‘msgconv’ program, 5613before invoking ‘msgfilter’. If the FILTER wants input in the locale’s 5614encoding, but you want to avoid the locale’s encoding, then you can 5615first convert the translation catalog to UTF-8 using the ‘msgconv’ 5616program and then make ‘msgfilter’ work in an UTF-8 locale, by using the 5617‘LC_ALL’ environment variable. 5618 5619 Note: Most translations in a translation catalog don’t end with a 5620newline character. For this reason, unless the ‘--newline’ option is 5621used, it is important that the FILTER recognizes its last input line 5622even if it ends without a newline, and that it doesn’t add an undesired 5623trailing newline at the end. The ‘sed’ program on some platforms is 5624known to ignore the last line of input if it is not terminated with a 5625newline. You can use GNU ‘sed’ instead; it does not have this 5626limitation. 5627 56289.4.4 Useful FILTER-OPTIONs when the FILTER is ‘sed’ 5629---------------------------------------------------- 5630 5631‘-e SCRIPT’ 5632‘--expression=SCRIPT’ 5633 Add SCRIPT to the commands to be executed. 5634 5635‘-f SCRIPTFILE’ 5636‘--file=SCRIPTFILE’ 5637 Add the contents of SCRIPTFILE to the commands to be executed. 5638 5639‘-n’ 5640‘--quiet’ 5641‘--silent’ 5642 Suppress automatic printing of pattern space. 5643 56449.4.5 Built-in FILTERs 5645---------------------- 5646 5647 The filter ‘recode-sr-latin’ is recognized as a built-in filter. The 5648command ‘recode-sr-latin’ converts Serbian text, written in the Cyrillic 5649script, to the Latin script. The command ‘msgfilter recode-sr-latin’ 5650applies this conversion to the translations of a PO file. Thus, it can 5651be used to convert an ‘sr.po’ file to an ‘sr@latin.po’ file. 5652 5653 The filter ‘quot’ is recognized as a built-in filter. The command 5654‘msgfilter quot’ converts any quotations surrounded by a pair of ‘"’, 5655‘'’, and ‘`’. 5656 5657 The filter ‘boldquot’ is recognized as a built-in filter. The 5658command ‘msgfilter boldquot’ converts any quotations surrounded by a 5659pair of ‘"’, ‘'’, and ‘`’, also adding the VT100 escape sequences to the 5660text to decorate it as bold. 5661 5662 The use of built-in filters is not sensitive to the current locale’s 5663encoding. Moreover, when used with a built-in filter, ‘msgfilter’ can 5664automatically convert the message catalog to the UTF-8 encoding when 5665needed. 5666 56679.4.6 Input file syntax 5668----------------------- 5669 5670‘-P’ 5671‘--properties-input’ 5672 Assume the input file is a Java ResourceBundle in Java 5673 ‘.properties’ syntax, not in PO file syntax. 5674 5675‘--stringtable-input’ 5676 Assume the input file is a NeXTstep/GNUstep localized resource file 5677 in ‘.strings’ syntax, not in PO file syntax. 5678 56799.4.7 Output details 5680-------------------- 5681 5682‘--color’ 5683‘--color=WHEN’ 5684 Specify whether or when to use colors and other text attributes. 5685 See *note The --color option:: for details. 5686 5687‘--style=STYLE_FILE’ 5688 Specify the CSS style rule file to use for ‘--color’. See *note 5689 The --style option:: for details. 5690 5691‘--force-po’ 5692 Always write an output file even if it contains no message. 5693 5694‘--indent’ 5695 Write the .po file using indented style. 5696 5697‘--keep-header’ 5698 Keep the header entry, i.e. the message with ‘msgid ""’, 5699 unmodified, instead of filtering it. By default, the header entry 5700 is subject to filtering like any other message. 5701 5702‘--no-location’ 5703 Do not write ‘#: FILENAME:LINE’ lines. 5704 5705‘-n’ 5706‘--add-location=TYPE’ 5707 Generate ‘#: FILENAME:LINE’ lines (default). 5708 5709 The optional TYPE can be either ‘full’, ‘file’, or ‘never’. If it 5710 is not given or ‘full’, it generates the lines with both file name 5711 and line number. If it is ‘file’, the line number part is omitted. 5712 If it is ‘never’, it completely suppresses the lines (same as 5713 ‘--no-location’). 5714 5715‘--strict’ 5716 Write out a strict Uniforum conforming PO file. Note that this 5717 Uniforum format should be avoided because it doesn’t support the 5718 GNU extensions. 5719 5720‘-p’ 5721‘--properties-output’ 5722 Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note 5723 that this file format doesn’t support plural forms and silently 5724 drops obsolete messages. 5725 5726‘--stringtable-output’ 5727 Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ 5728 syntax. Note that this file format doesn’t support plural forms. 5729 5730‘-w NUMBER’ 5731‘--width=NUMBER’ 5732 Set the output page width. Long strings in the output files will 5733 be split across multiple lines in order to ensure that each line’s 5734 width (= number of screen columns) is less or equal to the given 5735 NUMBER. 5736 5737‘--no-wrap’ 5738 Do not break long message lines. Message lines whose width exceeds 5739 the output page width will not be split into several lines. Only 5740 file reference lines which are wider than the output page width 5741 will be split. 5742 5743‘-s’ 5744‘--sort-output’ 5745 Generate sorted output. Note that using this option makes it much 5746 harder for the translator to understand each message’s context. 5747 5748‘-F’ 5749‘--sort-by-file’ 5750 Sort output by file location. 5751 57529.4.8 Informative output 5753------------------------ 5754 5755‘-h’ 5756‘--help’ 5757 Display this help and exit. 5758 5759‘-V’ 5760‘--version’ 5761 Output version information and exit. 5762 57639.4.9 Examples 5764-------------- 5765 5766 To convert German translations to Swiss orthography (in an UTF-8 5767locale): 5768 5769 msgconv -t UTF-8 de.po | msgfilter sed -e 's/ß/ss/g' 5770 5771 To convert Serbian translations in Cyrillic script to Latin script: 5772 5773 msgfilter recode-sr-latin < sr.po 5774 5775 5776File: gettext.info, Node: msguniq Invocation, Next: msgcomm Invocation, Prev: msgfilter Invocation, Up: Manipulating 5777 57789.5 Invoking the ‘msguniq’ Program 5779================================== 5780 5781 msguniq [OPTION] [INPUTFILE] 5782 5783 The ‘msguniq’ program unifies duplicate translations in a translation 5784catalog. It finds duplicate translations of the same message ID. Such 5785duplicates are invalid input for other programs like ‘msgfmt’, 5786‘msgmerge’ or ‘msgcat’. By default, duplicates are merged together. 5787When using the ‘--repeated’ option, only duplicates are output, and all 5788other messages are discarded. Comments and extracted comments will be 5789cumulated, except that if ‘--use-first’ is specified, they will be taken 5790from the first translation. File positions will be cumulated. When 5791using the ‘--unique’ option, duplicates are discarded. 5792 57939.5.1 Input file location 5794------------------------- 5795 5796‘INPUTFILE’ 5797 Input PO file. 5798 5799‘-D DIRECTORY’ 5800‘--directory=DIRECTORY’ 5801 Add DIRECTORY to the list of directories. Source files are 5802 searched relative to this list of directories. The resulting ‘.po’ 5803 file will be written relative to the current directory, though. 5804 5805 If no INPUTFILE is given or if it is ‘-’, standard input is read. 5806 58079.5.2 Output file location 5808-------------------------- 5809 5810‘-o FILE’ 5811‘--output-file=FILE’ 5812 Write output to specified file. 5813 5814 The results are written to standard output if no output file is 5815specified or if it is ‘-’. 5816 58179.5.3 Message selection 5818----------------------- 5819 5820‘-d’ 5821‘--repeated’ 5822 Print only duplicates. 5823 5824‘-u’ 5825‘--unique’ 5826 Print only unique messages, discard duplicates. 5827 58289.5.4 Input file syntax 5829----------------------- 5830 5831‘-P’ 5832‘--properties-input’ 5833 Assume the input file is a Java ResourceBundle in Java 5834 ‘.properties’ syntax, not in PO file syntax. 5835 5836‘--stringtable-input’ 5837 Assume the input file is a NeXTstep/GNUstep localized resource file 5838 in ‘.strings’ syntax, not in PO file syntax. 5839 58409.5.5 Output details 5841-------------------- 5842 5843‘-t’ 5844‘--to-code=NAME’ 5845 Specify encoding for output. 5846 5847‘--use-first’ 5848 Use first available translation for each message. Don’t merge 5849 several translations into one. 5850 5851‘--color’ 5852‘--color=WHEN’ 5853 Specify whether or when to use colors and other text attributes. 5854 See *note The --color option:: for details. 5855 5856‘--style=STYLE_FILE’ 5857 Specify the CSS style rule file to use for ‘--color’. See *note 5858 The --style option:: for details. 5859 5860‘--force-po’ 5861 Always write an output file even if it contains no message. 5862 5863‘-i’ 5864‘--indent’ 5865 Write the .po file using indented style. 5866 5867‘--no-location’ 5868 Do not write ‘#: FILENAME:LINE’ lines. 5869 5870‘-n’ 5871‘--add-location=TYPE’ 5872 Generate ‘#: FILENAME:LINE’ lines (default). 5873 5874 The optional TYPE can be either ‘full’, ‘file’, or ‘never’. If it 5875 is not given or ‘full’, it generates the lines with both file name 5876 and line number. If it is ‘file’, the line number part is omitted. 5877 If it is ‘never’, it completely suppresses the lines (same as 5878 ‘--no-location’). 5879 5880‘--strict’ 5881 Write out a strict Uniforum conforming PO file. Note that this 5882 Uniforum format should be avoided because it doesn’t support the 5883 GNU extensions. 5884 5885‘-p’ 5886‘--properties-output’ 5887 Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note 5888 that this file format doesn’t support plural forms and silently 5889 drops obsolete messages. 5890 5891‘--stringtable-output’ 5892 Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ 5893 syntax. Note that this file format doesn’t support plural forms. 5894 5895‘-w NUMBER’ 5896‘--width=NUMBER’ 5897 Set the output page width. Long strings in the output files will 5898 be split across multiple lines in order to ensure that each line’s 5899 width (= number of screen columns) is less or equal to the given 5900 NUMBER. 5901 5902‘--no-wrap’ 5903 Do not break long message lines. Message lines whose width exceeds 5904 the output page width will not be split into several lines. Only 5905 file reference lines which are wider than the output page width 5906 will be split. 5907 5908‘-s’ 5909‘--sort-output’ 5910 Generate sorted output. Note that using this option makes it much 5911 harder for the translator to understand each message’s context. 5912 5913‘-F’ 5914‘--sort-by-file’ 5915 Sort output by file location. 5916 59179.5.6 Informative output 5918------------------------ 5919 5920‘-h’ 5921‘--help’ 5922 Display this help and exit. 5923 5924‘-V’ 5925‘--version’ 5926 Output version information and exit. 5927 5928 5929File: gettext.info, Node: msgcomm Invocation, Next: msgcmp Invocation, Prev: msguniq Invocation, Up: Manipulating 5930 59319.6 Invoking the ‘msgcomm’ Program 5932================================== 5933 5934 msgcomm [OPTION] [INPUTFILE]... 5935 5936 The ‘msgcomm’ program finds messages which are common to two or more 5937of the specified PO files. By using the ‘--more-than’ option, greater 5938commonality may be requested before messages are printed. Conversely, 5939the ‘--less-than’ option may be used to specify less commonality before 5940messages are printed (i.e. ‘--less-than=2’ will only print the unique 5941messages). Translations, comments and extracted comments will be 5942preserved, but only from the first PO file to define them. File 5943positions from all PO files will be cumulated. 5944 59459.6.1 Input file location 5946------------------------- 5947 5948‘INPUTFILE ...’ 5949 Input files. 5950 5951‘-f FILE’ 5952‘--files-from=FILE’ 5953 Read the names of the input files from FILE instead of getting them 5954 from the command line. 5955 5956‘-D DIRECTORY’ 5957‘--directory=DIRECTORY’ 5958 Add DIRECTORY to the list of directories. Source files are 5959 searched relative to this list of directories. The resulting ‘.po’ 5960 file will be written relative to the current directory, though. 5961 5962 If INPUTFILE is ‘-’, standard input is read. 5963 59649.6.2 Output file location 5965-------------------------- 5966 5967‘-o FILE’ 5968‘--output-file=FILE’ 5969 Write output to specified file. 5970 5971 The results are written to standard output if no output file is 5972specified or if it is ‘-’. 5973 59749.6.3 Message selection 5975----------------------- 5976 5977‘-< NUMBER’ 5978‘--less-than=NUMBER’ 5979 Print messages with less than NUMBER definitions, defaults to 5980 infinite if not set. 5981 5982‘-> NUMBER’ 5983‘--more-than=NUMBER’ 5984 Print messages with more than NUMBER definitions, defaults to 1 if 5985 not set. 5986 5987‘-u’ 5988‘--unique’ 5989 Shorthand for ‘--less-than=2’. Requests that only unique messages 5990 be printed. 5991 59929.6.4 Input file syntax 5993----------------------- 5994 5995‘-P’ 5996‘--properties-input’ 5997 Assume the input files are Java ResourceBundles in Java 5998 ‘.properties’ syntax, not in PO file syntax. 5999 6000‘--stringtable-input’ 6001 Assume the input files are NeXTstep/GNUstep localized resource 6002 files in ‘.strings’ syntax, not in PO file syntax. 6003 60049.6.5 Output details 6005-------------------- 6006 6007‘--color’ 6008‘--color=WHEN’ 6009 Specify whether or when to use colors and other text attributes. 6010 See *note The --color option:: for details. 6011 6012‘--style=STYLE_FILE’ 6013 Specify the CSS style rule file to use for ‘--color’. See *note 6014 The --style option:: for details. 6015 6016‘--force-po’ 6017 Always write an output file even if it contains no message. 6018 6019‘-i’ 6020‘--indent’ 6021 Write the .po file using indented style. 6022 6023‘--no-location’ 6024 Do not write ‘#: FILENAME:LINE’ lines. 6025 6026‘-n’ 6027‘--add-location=TYPE’ 6028 Generate ‘#: FILENAME:LINE’ lines (default). 6029 6030 The optional TYPE can be either ‘full’, ‘file’, or ‘never’. If it 6031 is not given or ‘full’, it generates the lines with both file name 6032 and line number. If it is ‘file’, the line number part is omitted. 6033 If it is ‘never’, it completely suppresses the lines (same as 6034 ‘--no-location’). 6035 6036‘--strict’ 6037 Write out a strict Uniforum conforming PO file. Note that this 6038 Uniforum format should be avoided because it doesn’t support the 6039 GNU extensions. 6040 6041‘-p’ 6042‘--properties-output’ 6043 Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note 6044 that this file format doesn’t support plural forms and silently 6045 drops obsolete messages. 6046 6047‘--stringtable-output’ 6048 Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ 6049 syntax. Note that this file format doesn’t support plural forms. 6050 6051‘-w NUMBER’ 6052‘--width=NUMBER’ 6053 Set the output page width. Long strings in the output files will 6054 be split across multiple lines in order to ensure that each line’s 6055 width (= number of screen columns) is less or equal to the given 6056 NUMBER. 6057 6058‘--no-wrap’ 6059 Do not break long message lines. Message lines whose width exceeds 6060 the output page width will not be split into several lines. Only 6061 file reference lines which are wider than the output page width 6062 will be split. 6063 6064‘-s’ 6065‘--sort-output’ 6066 Generate sorted output. Note that using this option makes it much 6067 harder for the translator to understand each message’s context. 6068 6069‘-F’ 6070‘--sort-by-file’ 6071 Sort output by file location. 6072 6073‘--omit-header’ 6074 Don’t write header with ‘msgid ""’ entry. 6075 60769.6.6 Informative output 6077------------------------ 6078 6079‘-h’ 6080‘--help’ 6081 Display this help and exit. 6082 6083‘-V’ 6084‘--version’ 6085 Output version information and exit. 6086 6087 6088File: gettext.info, Node: msgcmp Invocation, Next: msgattrib Invocation, Prev: msgcomm Invocation, Up: Manipulating 6089 60909.7 Invoking the ‘msgcmp’ Program 6091================================= 6092 6093 msgcmp [OPTION] DEF.po REF.pot 6094 6095 The ‘msgcmp’ program compares two Uniforum style .po files to check 6096that both contain the same set of msgid strings. The DEF.po file is an 6097existing PO file with the translations. The REF.pot file is the last 6098created PO file, or a PO Template file (generally created by 6099‘xgettext’). This is useful for checking that you have translated each 6100and every message in your program. Where an exact match cannot be 6101found, fuzzy matching is used to produce better diagnostics. 6102 61039.7.1 Input file location 6104------------------------- 6105 6106‘DEF.po’ 6107 Translations. 6108 6109‘REF.pot’ 6110 References to the sources. 6111 6112‘-D DIRECTORY’ 6113‘--directory=DIRECTORY’ 6114 Add DIRECTORY to the list of directories. Source files are 6115 searched relative to this list of directories. 6116 61179.7.2 Operation modifiers 6118------------------------- 6119 6120‘-m’ 6121‘--multi-domain’ 6122 Apply REF.pot to each of the domains in DEF.po. 6123 6124‘-N’ 6125‘--no-fuzzy-matching’ 6126 Do not use fuzzy matching when an exact match is not found. This 6127 may speed up the operation considerably. 6128 6129‘--use-fuzzy’ 6130 Consider fuzzy messages in the DEF.po file like translated 6131 messages. Note that using this option is usually wrong, because 6132 fuzzy messages are exactly those which have not been validated by a 6133 human translator. 6134 6135‘--use-untranslated’ 6136 Consider untranslated messages in the DEF.po file like translated 6137 messages. Note that using this option is usually wrong. 6138 61399.7.3 Input file syntax 6140----------------------- 6141 6142‘-P’ 6143‘--properties-input’ 6144 Assume the input files are Java ResourceBundles in Java 6145 ‘.properties’ syntax, not in PO file syntax. 6146 6147‘--stringtable-input’ 6148 Assume the input files are NeXTstep/GNUstep localized resource 6149 files in ‘.strings’ syntax, not in PO file syntax. 6150 61519.7.4 Informative output 6152------------------------ 6153 6154‘-h’ 6155‘--help’ 6156 Display this help and exit. 6157 6158‘-V’ 6159‘--version’ 6160 Output version information and exit. 6161 6162 6163File: gettext.info, Node: msgattrib Invocation, Next: msgen Invocation, Prev: msgcmp Invocation, Up: Manipulating 6164 61659.8 Invoking the ‘msgattrib’ Program 6166==================================== 6167 6168 msgattrib [OPTION] [INPUTFILE] 6169 6170 The ‘msgattrib’ program filters the messages of a translation catalog 6171according to their attributes, and manipulates the attributes. 6172 61739.8.1 Input file location 6174------------------------- 6175 6176‘INPUTFILE’ 6177 Input PO file. 6178 6179‘-D DIRECTORY’ 6180‘--directory=DIRECTORY’ 6181 Add DIRECTORY to the list of directories. Source files are 6182 searched relative to this list of directories. The resulting ‘.po’ 6183 file will be written relative to the current directory, though. 6184 6185 If no INPUTFILE is given or if it is ‘-’, standard input is read. 6186 61879.8.2 Output file location 6188-------------------------- 6189 6190‘-o FILE’ 6191‘--output-file=FILE’ 6192 Write output to specified file. 6193 6194 The results are written to standard output if no output file is 6195specified or if it is ‘-’. 6196 61979.8.3 Message selection 6198----------------------- 6199 6200‘--translated’ 6201 Keep translated messages, remove untranslated messages. 6202 6203‘--untranslated’ 6204 Keep untranslated messages, remove translated messages. 6205 6206‘--no-fuzzy’ 6207 Remove ‘fuzzy’ marked messages. 6208 6209‘--only-fuzzy’ 6210 Keep ‘fuzzy’ marked messages, remove all other messages. 6211 6212‘--no-obsolete’ 6213 Remove obsolete #~ messages. 6214 6215‘--only-obsolete’ 6216 Keep obsolete #~ messages, remove all other messages. 6217 62189.8.4 Attribute manipulation 6219---------------------------- 6220 6221 Attributes are modified after the message selection/removal has been 6222performed. If the ‘--only-file’ or ‘--ignore-file’ option is specified, 6223the attribute modification is applied only to those messages that are 6224listed in the ONLY-FILE and not listed in the IGNORE-FILE. 6225 6226‘--set-fuzzy’ 6227 Set all messages ‘fuzzy’. 6228 6229‘--clear-fuzzy’ 6230 Set all messages non-‘fuzzy’. 6231 6232‘--set-obsolete’ 6233 Set all messages obsolete. 6234 6235‘--clear-obsolete’ 6236 Set all messages non-obsolete. 6237 6238‘--previous’ 6239 When setting ‘fuzzy’ mark, keep “previous msgid” of translated 6240 messages. 6241 6242‘--clear-previous’ 6243 Remove the “previous msgid” (‘#|’) comments from all messages. 6244 6245‘--empty’ 6246 When removing ‘fuzzy’ mark, also set msgstr empty. 6247 6248‘--only-file=FILE’ 6249 Limit the attribute changes to entries that are listed in FILE. 6250 FILE should be a PO or POT file. 6251 6252‘--ignore-file=FILE’ 6253 Limit the attribute changes to entries that are not listed in FILE. 6254 FILE should be a PO or POT file. 6255 6256‘--fuzzy’ 6257 Synonym for ‘--only-fuzzy --clear-fuzzy’: It keeps only the fuzzy 6258 messages and removes their ‘fuzzy’ mark. 6259 6260‘--obsolete’ 6261 Synonym for ‘--only-obsolete --clear-obsolete’: It keeps only the 6262 obsolete messages and makes them non-obsolete. 6263 62649.8.5 Input file syntax 6265----------------------- 6266 6267‘-P’ 6268‘--properties-input’ 6269 Assume the input file is a Java ResourceBundle in Java 6270 ‘.properties’ syntax, not in PO file syntax. 6271 6272‘--stringtable-input’ 6273 Assume the input file is a NeXTstep/GNUstep localized resource file 6274 in ‘.strings’ syntax, not in PO file syntax. 6275 62769.8.6 Output details 6277-------------------- 6278 6279‘--color’ 6280‘--color=WHEN’ 6281 Specify whether or when to use colors and other text attributes. 6282 See *note The --color option:: for details. 6283 6284‘--style=STYLE_FILE’ 6285 Specify the CSS style rule file to use for ‘--color’. See *note 6286 The --style option:: for details. 6287 6288‘--force-po’ 6289 Always write an output file even if it contains no message. 6290 6291‘-i’ 6292‘--indent’ 6293 Write the .po file using indented style. 6294 6295‘--no-location’ 6296 Do not write ‘#: FILENAME:LINE’ lines. 6297 6298‘-n’ 6299‘--add-location=TYPE’ 6300 Generate ‘#: FILENAME:LINE’ lines (default). 6301 6302 The optional TYPE can be either ‘full’, ‘file’, or ‘never’. If it 6303 is not given or ‘full’, it generates the lines with both file name 6304 and line number. If it is ‘file’, the line number part is omitted. 6305 If it is ‘never’, it completely suppresses the lines (same as 6306 ‘--no-location’). 6307 6308‘--strict’ 6309 Write out a strict Uniforum conforming PO file. Note that this 6310 Uniforum format should be avoided because it doesn’t support the 6311 GNU extensions. 6312 6313‘-p’ 6314‘--properties-output’ 6315 Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note 6316 that this file format doesn’t support plural forms and silently 6317 drops obsolete messages. 6318 6319‘--stringtable-output’ 6320 Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ 6321 syntax. Note that this file format doesn’t support plural forms. 6322 6323‘-w NUMBER’ 6324‘--width=NUMBER’ 6325 Set the output page width. Long strings in the output files will 6326 be split across multiple lines in order to ensure that each line’s 6327 width (= number of screen columns) is less or equal to the given 6328 NUMBER. 6329 6330‘--no-wrap’ 6331 Do not break long message lines. Message lines whose width exceeds 6332 the output page width will not be split into several lines. Only 6333 file reference lines which are wider than the output page width 6334 will be split. 6335 6336‘-s’ 6337‘--sort-output’ 6338 Generate sorted output. Note that using this option makes it much 6339 harder for the translator to understand each message’s context. 6340 6341‘-F’ 6342‘--sort-by-file’ 6343 Sort output by file location. 6344 63459.8.7 Informative output 6346------------------------ 6347 6348‘-h’ 6349‘--help’ 6350 Display this help and exit. 6351 6352‘-V’ 6353‘--version’ 6354 Output version information and exit. 6355 6356 6357File: gettext.info, Node: msgen Invocation, Next: msgexec Invocation, Prev: msgattrib Invocation, Up: Manipulating 6358 63599.9 Invoking the ‘msgen’ Program 6360================================ 6361 6362 msgen [OPTION] INPUTFILE 6363 6364 The ‘msgen’ program creates an English translation catalog. The 6365input file is the last created English PO file, or a PO Template file 6366(generally created by xgettext). Untranslated entries are assigned a 6367translation that is identical to the msgid. 6368 6369 Note: ‘msginit --no-translator --locale=en’ performs a very similar 6370task. The main difference is that ‘msginit’ cares specially about the 6371header entry, whereas ‘msgen’ doesn’t. 6372 63739.9.1 Input file location 6374------------------------- 6375 6376‘INPUTFILE’ 6377 Input PO or POT file. 6378 6379‘-D DIRECTORY’ 6380‘--directory=DIRECTORY’ 6381 Add DIRECTORY to the list of directories. Source files are 6382 searched relative to this list of directories. The resulting ‘.po’ 6383 file will be written relative to the current directory, though. 6384 6385 If INPUTFILE is ‘-’, standard input is read. 6386 63879.9.2 Output file location 6388-------------------------- 6389 6390‘-o FILE’ 6391‘--output-file=FILE’ 6392 Write output to specified file. 6393 6394 The results are written to standard output if no output file is 6395specified or if it is ‘-’. 6396 63979.9.3 Input file syntax 6398----------------------- 6399 6400‘-P’ 6401‘--properties-input’ 6402 Assume the input file is a Java ResourceBundle in Java 6403 ‘.properties’ syntax, not in PO file syntax. 6404 6405‘--stringtable-input’ 6406 Assume the input file is a NeXTstep/GNUstep localized resource file 6407 in ‘.strings’ syntax, not in PO file syntax. 6408 64099.9.4 Output details 6410-------------------- 6411 6412‘--lang=CATALOGNAME’ 6413 Specify the ‘Language’ field to be used in the header entry. See 6414 *note Header Entry:: for the meaning of this field. Note: The 6415 ‘Language-Team’ and ‘Plural-Forms’ fields are not set by this 6416 option. 6417 6418‘--color’ 6419‘--color=WHEN’ 6420 Specify whether or when to use colors and other text attributes. 6421 See *note The --color option:: for details. 6422 6423‘--style=STYLE_FILE’ 6424 Specify the CSS style rule file to use for ‘--color’. See *note 6425 The --style option:: for details. 6426 6427‘--force-po’ 6428 Always write an output file even if it contains no message. 6429 6430‘-i’ 6431‘--indent’ 6432 Write the .po file using indented style. 6433 6434‘--no-location’ 6435 Do not write ‘#: FILENAME:LINE’ lines. 6436 6437‘-n’ 6438‘--add-location=TYPE’ 6439 Generate ‘#: FILENAME:LINE’ lines (default). 6440 6441 The optional TYPE can be either ‘full’, ‘file’, or ‘never’. If it 6442 is not given or ‘full’, it generates the lines with both file name 6443 and line number. If it is ‘file’, the line number part is omitted. 6444 If it is ‘never’, it completely suppresses the lines (same as 6445 ‘--no-location’). 6446 6447‘--strict’ 6448 Write out a strict Uniforum conforming PO file. Note that this 6449 Uniforum format should be avoided because it doesn’t support the 6450 GNU extensions. 6451 6452‘-p’ 6453‘--properties-output’ 6454 Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note 6455 that this file format doesn’t support plural forms and silently 6456 drops obsolete messages. 6457 6458‘--stringtable-output’ 6459 Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ 6460 syntax. Note that this file format doesn’t support plural forms. 6461 6462‘-w NUMBER’ 6463‘--width=NUMBER’ 6464 Set the output page width. Long strings in the output files will 6465 be split across multiple lines in order to ensure that each line’s 6466 width (= number of screen columns) is less or equal to the given 6467 NUMBER. 6468 6469‘--no-wrap’ 6470 Do not break long message lines. Message lines whose width exceeds 6471 the output page width will not be split into several lines. Only 6472 file reference lines which are wider than the output page width 6473 will be split. 6474 6475‘-s’ 6476‘--sort-output’ 6477 Generate sorted output. Note that using this option makes it much 6478 harder for the translator to understand each message’s context. 6479 6480‘-F’ 6481‘--sort-by-file’ 6482 Sort output by file location. 6483 64849.9.5 Informative output 6485------------------------ 6486 6487‘-h’ 6488‘--help’ 6489 Display this help and exit. 6490 6491‘-V’ 6492‘--version’ 6493 Output version information and exit. 6494 6495 6496File: gettext.info, Node: msgexec Invocation, Next: Colorizing, Prev: msgen Invocation, Up: Manipulating 6497 64989.10 Invoking the ‘msgexec’ Program 6499=================================== 6500 6501 msgexec [OPTION] COMMAND [COMMAND-OPTION] 6502 6503 The ‘msgexec’ program applies a command to all translations of a 6504translation catalog. The COMMAND can be any program that reads a 6505translation from standard input. It is invoked once for each 6506translation. Its output becomes msgexec’s output. ‘msgexec’’s return 6507code is the maximum return code across all invocations. 6508 6509 A special builtin command called ‘0’ outputs the translation, 6510followed by a null byte. The output of ‘msgexec 0’ is suitable as input 6511for ‘xargs -0’. 6512 6513‘--newline’ 6514 Add newline at the end of each input line. 6515 6516 During each COMMAND invocation, the environment variable 6517‘MSGEXEC_MSGID’ is bound to the message’s msgid, and the environment 6518variable ‘MSGEXEC_LOCATION’ is bound to the location in the PO file of 6519the message. If the message has a context, the environment variable 6520‘MSGEXEC_MSGCTXT’ is bound to the message’s msgctxt, otherwise it is 6521unbound. If the message has a plural form, environment variable 6522‘MSGEXEC_MSGID_PLURAL’ is bound to the message’s msgid_plural and 6523‘MSGEXEC_PLURAL_FORM’ is bound to the order number of the plural 6524actually processed (starting with 0), otherwise both are unbound. If 6525the message has a previous msgid (added by ‘msgmerge’), environment 6526variable ‘MSGEXEC_PREV_MSGCTXT’ is bound to the message’s previous 6527msgctxt, ‘MSGEXEC_PREV_MSGID’ is bound to the previous msgid, and 6528‘MSGEXEC_PREV_MSGID_PLURAL’ is bound to the previous msgid_plural. 6529 6530 Note: It is your responsibility to ensure that the COMMAND can cope 6531with input encoded in the translation catalog’s encoding. If the 6532COMMAND wants input in a particular encoding, you can in a first step 6533convert the translation catalog to that encoding using the ‘msgconv’ 6534program, before invoking ‘msgexec’. If the COMMAND wants input in the 6535locale’s encoding, but you want to avoid the locale’s encoding, then you 6536can first convert the translation catalog to UTF-8 using the ‘msgconv’ 6537program and then make ‘msgexec’ work in an UTF-8 locale, by using the 6538‘LC_ALL’ environment variable. 6539 65409.10.1 Input file location 6541-------------------------- 6542 6543‘-i INPUTFILE’ 6544‘--input=INPUTFILE’ 6545 Input PO file. 6546 6547‘-D DIRECTORY’ 6548‘--directory=DIRECTORY’ 6549 Add DIRECTORY to the list of directories. Source files are 6550 searched relative to this list of directories. The resulting ‘.po’ 6551 file will be written relative to the current directory, though. 6552 6553 If no INPUTFILE is given or if it is ‘-’, standard input is read. 6554 65559.10.2 Input file syntax 6556------------------------ 6557 6558‘-P’ 6559‘--properties-input’ 6560 Assume the input file is a Java ResourceBundle in Java 6561 ‘.properties’ syntax, not in PO file syntax. 6562 6563‘--stringtable-input’ 6564 Assume the input file is a NeXTstep/GNUstep localized resource file 6565 in ‘.strings’ syntax, not in PO file syntax. 6566 65679.10.3 Informative output 6568------------------------- 6569 6570‘-h’ 6571‘--help’ 6572 Display this help and exit. 6573 6574‘-V’ 6575‘--version’ 6576 Output version information and exit. 6577 6578 6579File: gettext.info, Node: Colorizing, Next: Other tools, Prev: msgexec Invocation, Up: Manipulating 6580 65819.11 Highlighting parts of PO files 6582=================================== 6583 6584 Translators are usually only interested in seeing the untranslated 6585and fuzzy messages of a PO file. Also, when a message is set fuzzy 6586because the msgid changed, they want to see the differences between the 6587previous msgid and the current one (especially if the msgid is long and 6588only few words in it have changed). Finally, it’s always welcome to 6589highlight the different sections of a message in a PO file (comments, 6590msgid, msgstr, etc.). 6591 6592 Such highlighting is possible through the options ‘--color’ and 6593‘--style’. They are supported by all the programs that produce a PO 6594file on standard output, such as ‘msgcat’, ‘msgmerge’, and ‘msgunfmt’. 6595 6596* Menu: 6597 6598* The --color option:: Triggering colorized output 6599* The TERM variable:: The environment variable ‘TERM’ 6600* The --style option:: The ‘--style’ option 6601* Style rules:: Style rules for PO files 6602* Customizing less:: Customizing ‘less’ for viewing PO files 6603 6604 6605File: gettext.info, Node: The --color option, Next: The TERM variable, Up: Colorizing 6606 66079.11.1 The ‘--color’ option 6608--------------------------- 6609 6610 The ‘--color=WHEN’ option specifies under which conditions colorized 6611output should be generated. The WHEN part can be one of the following: 6612 6613‘always’ 6614‘yes’ 6615 The output will be colorized. 6616 6617‘never’ 6618‘no’ 6619 The output will not be colorized. 6620 6621‘auto’ 6622‘tty’ 6623 The output will be colorized if the output device is a tty, i.e. 6624 when the output goes directly to a text screen or terminal emulator 6625 window. 6626 6627‘html’ 6628 The output will be colorized and be in HTML format. 6629 6630‘test’ 6631 This is a special value, understood only by the ‘msgcat’ program. 6632 It is explained in the next section (*note The TERM variable::). 6633 6634‘--color’ is equivalent to ‘--color=yes’. The default is 6635‘--color=auto’. 6636 6637 Thus, a command like ‘msgcat vi.po’ will produce colorized output 6638when called by itself in a command window. Whereas in a pipe, such as 6639‘msgcat vi.po | less -R’, it will not produce colorized output. To get 6640colorized output in this situation nevertheless, use the command ‘msgcat 6641--color vi.po | less -R’. 6642 6643 The ‘--color=html’ option will produce output that can be viewed in a 6644browser. This can be useful, for example, for Indic languages, because 6645the renderic of Indic scripts in browsers is usually better than in 6646terminal emulators. 6647 6648 Note that the output produced with the ‘--color’ option is _not_ a 6649valid PO file in itself. It contains additional terminal-specific 6650escape sequences or HTML tags. A PO file reader will give a syntax 6651error when confronted with such content. Except for the ‘--color=html’ 6652case, you therefore normally don’t need to save output produced with the 6653‘--color’ option in a file. 6654 6655 6656File: gettext.info, Node: The TERM variable, Next: The --style option, Prev: The --color option, Up: Colorizing 6657 66589.11.2 The environment variable ‘TERM’ 6659-------------------------------------- 6660 6661 The environment variable ‘TERM’ contains a identifier for the text 6662window’s capabilities. You can get a detailed list of these 6663cababilities by using the ‘infocmp’ command, using ‘man 5 terminfo’ as a 6664reference. 6665 6666 When producing text with embedded color directives, ‘msgcat’ looks at 6667the ‘TERM’ variable. Text windows today typically support at least 8 6668colors. Often, however, the text window supports 16 or more colors, 6669even though the ‘TERM’ variable is set to a identifier denoting only 8 6670supported colors. It can be worth setting the ‘TERM’ variable to a 6671different value in these cases: 6672 6673‘xterm’ 6674 ‘xterm’ is in most cases built with support for 16 colors. It can 6675 also be built with support for 88 or 256 colors (but not both). 6676 You can try to set ‘TERM’ to either ‘xterm-16color’, 6677 ‘xterm-88color’, or ‘xterm-256color’. 6678 6679‘rxvt’ 6680 ‘rxvt’ is often built with support for 16 colors. You can try to 6681 set ‘TERM’ to ‘rxvt-16color’. 6682 6683‘konsole’ 6684 ‘konsole’ too is often built with support for 16 colors. You can 6685 try to set ‘TERM’ to ‘konsole-16color’ or ‘xterm-16color’. 6686 6687 After setting ‘TERM’, you can verify it by invoking ‘msgcat 6688--color=test’ and seeing whether the output looks like a reasonable 6689color map. 6690 6691 6692File: gettext.info, Node: The --style option, Next: Style rules, Prev: The TERM variable, Up: Colorizing 6693 66949.11.3 The ‘--style’ option 6695--------------------------- 6696 6697 The ‘--style=STYLE_FILE’ option specifies the style file to use when 6698colorizing. It has an effect only when the ‘--color’ option is 6699effective. 6700 6701 If the ‘--style’ option is not specified, the environment variable 6702‘PO_STYLE’ is considered. It is meant to point to the user’s preferred 6703style for PO files. 6704 6705 The default style file is 6706‘$prefix/share/gettext/styles/po-default.css’, where ‘$prefix’ is the 6707installation location. 6708 6709 A few style files are predefined: 6710‘po-vim.css’ 6711 This style imitates the look used by vim 7. 6712 6713‘po-emacs-x.css’ 6714 This style imitates the look used by GNU Emacs 21 and 22 in an X11 6715 window. 6716 6717‘po-emacs-xterm.css’ 6718‘po-emacs-xterm16.css’ 6719‘po-emacs-xterm256.css’ 6720 This style imitates the look used by GNU Emacs 22 in a terminal of 6721 type ‘xterm’ (8 colors) or ‘xterm-16color’ (16 colors) or 6722 ‘xterm-256color’ (256 colors), respectively. 6723 6724You can use these styles without specifying a directory. They are 6725actually located in ‘$prefix/share/gettext/styles/’, where ‘$prefix’ is 6726the installation location. 6727 6728 You can also design your own styles. This is described in the next 6729section. 6730 6731 6732File: gettext.info, Node: Style rules, Next: Customizing less, Prev: The --style option, Up: Colorizing 6733 67349.11.4 Style rules for PO files 6735------------------------------- 6736 6737 The same style file can be used for styling of a PO file, for 6738terminal output and for HTML output. It is written in CSS (Cascading 6739Style Sheet) syntax. See <https://www.w3.org/TR/css2/cover.html> for a 6740formal definition of CSS. Many HTML authoring tutorials also contain 6741explanations of CSS. 6742 6743 In the case of HTML output, the style file is embedded in the HTML 6744output. In the case of text output, the style file is interpreted by 6745the ‘msgcat’ program. This means, in particular, that when ‘@import’ is 6746used with relative file names, the file names are 6747 6748 − relative to the resulting HTML file, in the case of HTML output, 6749 6750 − relative to the style sheet containing the ‘@import’, in the case 6751 of text output. (Actually, ‘@import’s are not yet supported in 6752 this case, due to a limitation in ‘libcroco’.) 6753 6754 CSS rules are built up from selectors and declarations. The 6755declarations specify graphical properties; the selectors specify when 6756they apply. 6757 6758 In PO files, the following simple selectors (based on "CSS classes", 6759see the CSS2 spec, section 5.8.3) are supported. 6760 6761 • Selectors that apply to entire messages: 6762 6763 ‘.header’ 6764 This matches the header entry of a PO file. 6765 6766 ‘.translated’ 6767 This matches a translated message. 6768 6769 ‘.untranslated’ 6770 This matches an untranslated message (i.e. a message with 6771 empty translation). 6772 6773 ‘.fuzzy’ 6774 This matches a fuzzy message (i.e. a message which has a 6775 translation that needs review by the translator). 6776 6777 ‘.obsolete’ 6778 This matches an obsolete message (i.e. a message that was 6779 translated but is not needed by the current POT file any 6780 more). 6781 6782 • Selectors that apply to parts of a message in PO syntax. Recall 6783 the general structure of a message in PO syntax: 6784 6785 WHITE-SPACE 6786 # TRANSLATOR-COMMENTS 6787 #. EXTRACTED-COMMENTS 6788 #: REFERENCE... 6789 #, FLAG... 6790 #| msgid PREVIOUS-UNTRANSLATED-STRING 6791 msgid UNTRANSLATED-STRING 6792 msgstr TRANSLATED-STRING 6793 6794 ‘.comment’ 6795 This matches all comments (translator comments, extracted 6796 comments, source file reference comments, flag comments, 6797 previous message comments, as well as the entire obsolete 6798 messages). 6799 6800 ‘.translator-comment’ 6801 This matches the translator comments. 6802 6803 ‘.extracted-comment’ 6804 This matches the extracted comments, i.e. the comments placed 6805 by the programmer at the attention of the translator. 6806 6807 ‘.reference-comment’ 6808 This matches the source file reference comments (entire 6809 lines). 6810 6811 ‘.reference’ 6812 This matches the individual source file references inside the 6813 source file reference comment lines. 6814 6815 ‘.flag-comment’ 6816 This matches the flag comment lines (entire lines). 6817 6818 ‘.flag’ 6819 This matches the individual flags inside flag comment lines. 6820 6821 ‘.fuzzy-flag’ 6822 This matches the ‘fuzzy’ flag inside flag comment lines. 6823 6824 ‘.previous-comment’ 6825 This matches the comments containing the previous untranslated 6826 string (entire lines). 6827 6828 ‘.previous’ 6829 This matches the previous untranslated string including the 6830 string delimiters, the associated keywords (‘msgid’ etc.) and 6831 the spaces between them. 6832 6833 ‘.msgid’ 6834 This matches the untranslated string including the string 6835 delimiters, the associated keywords (‘msgid’ etc.) and the 6836 spaces between them. 6837 6838 ‘.msgstr’ 6839 This matches the translated string including the string 6840 delimiters, the associated keywords (‘msgstr’ etc.) and the 6841 spaces between them. 6842 6843 ‘.keyword’ 6844 This matches the keywords (‘msgid’, ‘msgstr’, etc.). 6845 6846 ‘.string’ 6847 This matches strings, including the string delimiters (double 6848 quotes). 6849 6850 • Selectors that apply to parts of strings: 6851 6852 ‘.text’ 6853 This matches the entire contents of a string (excluding the 6854 string delimiters, i.e. the double quotes). 6855 6856 ‘.escape-sequence’ 6857 This matches an escape sequence (starting with a backslash). 6858 6859 ‘.format-directive’ 6860 This matches a format string directive (starting with a ‘%’ 6861 sign in the case of most programming languages, with a ‘{’ in 6862 the case of ‘java-format’ and ‘csharp-format’, with a ‘~’ in 6863 the case of ‘lisp-format’ and ‘scheme-format’, or with ‘$’ in 6864 the case of ‘sh-format’). 6865 6866 ‘.invalid-format-directive’ 6867 This matches an invalid format string directive. 6868 6869 ‘.added’ 6870 In an untranslated string, this matches a part of the string 6871 that was not present in the previous untranslated string. 6872 (Not yet implemented in this release.) 6873 6874 ‘.changed’ 6875 In an untranslated string or in a previous untranslated 6876 string, this matches a part of the string that is changed or 6877 replaced. (Not yet implemented in this release.) 6878 6879 ‘.removed’ 6880 In a previous untranslated string, this matches a part of the 6881 string that is not present in the current untranslated string. 6882 (Not yet implemented in this release.) 6883 6884 These selectors can be combined to hierarchical selectors. For 6885example, 6886 6887 .msgstr .invalid-format-directive { color: red; } 6888 6889will highlight the invalid format directives in the translated strings. 6890 6891 In text mode, pseudo-classes (CSS2 spec, section 5.11) and 6892pseudo-elements (CSS2 spec, section 5.12) are not supported. 6893 6894 The declarations in HTML mode are not limited; any graphical 6895attribute supported by the browsers can be used. 6896 6897 The declarations in text mode are limited to the following 6898properties. Other properties will be silently ignored. 6899 6900‘color’ (CSS2 spec, section 14.1) 6901‘background-color’ (CSS2 spec, section 14.2.1) 6902 These properties is supported. Colors will be adjusted to match 6903 the terminal’s capabilities. Note that many terminals support only 6904 8 colors. 6905 6906‘font-weight’ (CSS2 spec, section 15.2.3) 6907 This property is supported, but most terminals can only render two 6908 different weights: ‘normal’ and ‘bold’. Values >= 600 are rendered 6909 as ‘bold’. 6910 6911‘font-style’ (CSS2 spec, section 15.2.3) 6912 This property is supported. The values ‘italic’ and ‘oblique’ are 6913 rendered the same way. 6914 6915‘text-decoration’ (CSS2 spec, section 16.3.1) 6916 This property is supported, limited to the values ‘none’ and 6917 ‘underline’. 6918 6919 6920File: gettext.info, Node: Customizing less, Prev: Style rules, Up: Colorizing 6921 69229.11.5 Customizing ‘less’ for viewing PO files 6923---------------------------------------------- 6924 6925 The ‘less’ program is a popular text file browser for use in a text 6926screen or terminal emulator. It also supports text with embedded escape 6927sequences for colors and text decorations. 6928 6929 You can use ‘less’ to view a PO file like this (assuming an UTF-8 6930environment): 6931 6932 msgcat --to-code=UTF-8 --color xyz.po | less -R 6933 6934 You can simplify this to this simple command: 6935 6936 less xyz.po 6937 6938after these three preparations: 6939 6940 1. Add the options ‘-R’ and ‘-f’ to the ‘LESS’ environment variable. 6941 In sh shells: 6942 $ LESS="$LESS -R -f" 6943 $ export LESS 6944 6945 2. If your system does not already have the ‘lessopen.sh’ and 6946 ‘lessclose.sh’ scripts, create them and set the ‘LESSOPEN’ and 6947 ‘LESSCLOSE’ environment variables, as indicated in the manual page 6948 (‘man less’). 6949 6950 3. Add to ‘lessopen.sh’ a piece of script that recognizes PO files 6951 through their file extension and invokes ‘msgcat’ on them, 6952 producing a temporary file. Like this: 6953 6954 case "$1" in 6955 *.po) 6956 tmpfile=`mktemp "${TMPDIR-/tmp}/less.XXXXXX"` 6957 msgcat --to-code=UTF-8 --color "$1" > "$tmpfile" 6958 echo "$tmpfile" 6959 exit 0 6960 ;; 6961 esac 6962 6963 6964File: gettext.info, Node: Other tools, Next: libgettextpo, Prev: Colorizing, Up: Manipulating 6965 69669.12 Other tools for manipulating PO files 6967========================================== 6968 6969 The “Pology” package is a Free Software package for manipulating PO 6970files. It features, in particular: 6971 6972 • Examination and in-place modification of collections of PO files. 6973 • Format-aware diffing and patching of PO files. 6974 • Handling of version-control branches. 6975 • Fine-grained asynchronous review workflow. 6976 • Custom translation validation. 6977 • Language and project specific support. 6978 6979 Its home page is at <http://pology.nedohodnik.net/>. 6980 6981 6982File: gettext.info, Node: libgettextpo, Prev: Other tools, Up: Manipulating 6983 69849.13 Writing your own programs that process PO files 6985==================================================== 6986 6987 For the tasks for which a combination of ‘msgattrib’, ‘msgcat’ etc. 6988is not sufficient, a set of C functions is provided in a library, to 6989make it possible to process PO files in your own programs. When you use 6990this library, you don’t need to write routines to parse the PO file; 6991instead, you retrieve a pointer in memory to each of messages contained 6992in the PO file. Functions for writing those memory structures to a file 6993after working with them are provided too. 6994 6995 The functions are declared in the header file ‘<gettext-po.h>’, and 6996are defined in a library called ‘libgettextpo’. 6997 6998* Menu: 6999 7000* Error Handling:: Error handling functions 7001* po_file_t API:: File management 7002* po_message_iterator_t API:: Message iteration 7003* po_message_t API:: The basic units of the file 7004* PO Header Entry API:: Meta information of the file 7005* po_filepos_t API:: References to the sources 7006* Format Type API:: Supported format types 7007* Checking API:: Enforcing constraints 7008 7009 The following example shows code how these functions can be used. 7010Error handling code is omitted, as its implementation is delegated to 7011the user provided functions. 7012 7013 struct po_xerror_handler handler = 7014 { 7015 .xerror = ..., 7016 .xerror2 = ... 7017 }; 7018 const char *filename = ...; 7019 /* Read the file into memory. */ 7020 po_file_t file = po_file_read (filename, &handler); 7021 7022 { 7023 const char * const *domains = po_file_domains (file); 7024 const char * const *domainp; 7025 7026 /* Iterate the domains contained in the file. */ 7027 for (domainp = domains; *domainp; domainp++) 7028 { 7029 po_message_t *message; 7030 const char *domain = *domainp; 7031 po_message_iterator_t iterator = po_message_iterator (file, domain); 7032 7033 /* Iterate each message inside the domain. */ 7034 while ((message = po_next_message (iterator)) != NULL) 7035 { 7036 /* Read data from the message ... */ 7037 const char *msgid = po_message_msgid (message); 7038 const char *msgstr = po_message_msgstr (message); 7039 7040 ... 7041 7042 /* Modify its contents ... */ 7043 if (perform_some_tests (msgid, msgstr)) 7044 po_message_set_fuzzy (message, 1); 7045 7046 ... 7047 } 7048 /* Always release returned po_message_iterator_t. */ 7049 po_message_iterator_free (iterator); 7050 } 7051 7052 /* Write back the result. */ 7053 po_file_t result = po_file_write (file, filename, &handler); 7054 } 7055 7056 /* Always release the returned po_file_t. */ 7057 po_file_free (file); 7058 7059 7060File: gettext.info, Node: Error Handling, Next: po_file_t API, Up: libgettextpo 7061 70629.13.1 Error Handling 7063--------------------- 7064 7065 Error management is performed through callbacks provided by the user 7066of the library. They are provided through a parameter with the 7067following type: 7068 7069 -- Data Type: struct po_xerror_handler 7070 Its pointer is defined as ‘po_xerror_handler_t’. Contains two 7071 fields, ‘xerror’ and ‘xerror2’, with the following function 7072 signatures. 7073 7074 -- Function: void xerror (int SEVERITY, po_message_t MESSAGE, 7075 const char *FILENAME, size_t LINENO, size_t COLUMN, 7076 int MULTILINE_P, const char *MESSAGE_TEXT) 7077 7078 This function is called to signal a problem of the given SEVERITY. 7079 It _must not return_ if SEVERITY is ‘PO_SEVERITY_FATAL_ERROR’. 7080 7081 MESSAGE_TEXT is the problem description. When MULTILINE_P is true, 7082 it can contain multiple lines of text, each terminated with a 7083 newline, otherwise a single line. 7084 7085 MESSAGE and/or FILENAME and LINENO indicate where the problem 7086 occurred: 7087 7088 • If FILENAME is ‘NULL’, FILENAME and LINENO and COLUMN should 7089 be ignored. 7090 7091 • If LINENO is ‘(size_t)(-1)’, LINENO and COLUMN should be 7092 ignored. 7093 7094 • If COLUMN is ‘(size_t)(-1)’, it should be ignored. 7095 7096 -- Function: void xerror2 (int SEVERITY, po_message_t MESSAGE1, 7097 const char *FILENAME1, size_t LINENO1, size_t COLUMN1, 7098 int MULTILINE_P1, const char *MESSAGE_TEXT1, 7099 po_message_t MESSAGE2, const char *FILENAME2, size_t LINENO2, 7100 size_t COLUMN2, int MULTILINE_P2, const char *MESSAGE_TEXT2) 7101 7102 This function is called to signal a problem of the given SEVERITY 7103 that refers to two messages. It _must not return_ if SEVERITY is 7104 ‘PO_SEVERITY_FATAL_ERROR’. 7105 7106 It is similar to two calls to xerror. If possible, an ellipsis can 7107 be appended to MESSAGE_TEXT1 and prepended to MESSAGE_TEXT2. 7108 7109 7110File: gettext.info, Node: po_file_t API, Next: po_message_iterator_t API, Prev: Error Handling, Up: libgettextpo 7111 71129.13.2 po_file_t API 7113-------------------- 7114 7115 -- Data Type: po_file_t 7116 This is a pointer type that refers to the contents of a PO file, 7117 after it has been read into memory. 7118 7119 -- Function: po_file_t po_file_create () 7120 The ‘po_file_create’ function creates an empty PO file 7121 representation in memory. 7122 7123 -- Function: po_file_t po_file_read (const char *FILENAME, 7124 struct po_xerror_handler *HANDLER) 7125 The ‘po_file_read’ function reads a PO file into memory. The file 7126 name is given as argument. The return value is a handle to the PO 7127 file’s contents, valid until ‘po_file_free’ is called on it. In 7128 case of error, the functions from HANDLER are called to signal it. 7129 7130 This function is exported as ‘po_file_read_v3’ at ABI level, but is 7131 defined as ‘po_file_read’ in C code after the inclusion of 7132 ‘<gettext-po.h>’. 7133 7134 -- Function: po_file_t po_file_write (po_file_t FILE, 7135 const char *FILENAME, struct po_xerror_handler *HANDLER) 7136 The ‘po_file_write’ function writes the contents of the memory 7137 structure FILE the FILENAME given. The return value is FILE after 7138 a successful operation. In case of error, the functions from 7139 HANDLER are called to signal it. 7140 7141 This function is exported as ‘po_file_write_v2’ at ABI level, but 7142 is defined as ‘po_file_write’ in C code after the inclusion of 7143 ‘<gettext-po.h>’. 7144 7145 -- Function: void po_file_free (po_file_t FILE) 7146 The ‘po_file_free’ function frees a PO file’s contents from memory, 7147 including all messages that are only implicitly accessible through 7148 iterators. 7149 7150 -- Function: const char * const * po_file_domains (po_file_t FILE) 7151 The ‘po_file_domains’ function returns the domains for which the 7152 given PO file has messages. The return value is a ‘NULL’ 7153 terminated array which is valid as long as the FILE handle is 7154 valid. For PO files which contain no ‘domain’ directive, the 7155 return value contains only one domain, namely the default domain 7156 ‘"messages"’. 7157 7158 7159File: gettext.info, Node: po_message_iterator_t API, Next: po_message_t API, Prev: po_file_t API, Up: libgettextpo 7160 71619.13.3 po_message_iterator_t API 7162-------------------------------- 7163 7164 -- Data Type: po_message_iterator_t 7165 This is a pointer type that refers to an iterator that produces a 7166 sequence of messages. 7167 7168 -- Function: po_message_iterator_t po_message_iterator (po_file_t FILE, 7169 const char *DOMAIN) 7170 The ‘po_message_iterator’ returns an iterator that will produce the 7171 messages of FILE that belong to the given DOMAIN. If DOMAIN is 7172 ‘NULL’, the default domain is used instead. To list the messages, 7173 use the function ‘po_next_message’ repeatedly. 7174 7175 -- Function: void po_message_iterator_free 7176 (po_message_iterator_t ITERATOR) 7177 The ‘po_message_iterator_free’ function frees an iterator 7178 previously allocated through the ‘po_message_iterator’ function. 7179 7180 -- Function: po_message_t po_next_message 7181 (po_message_iterator_t ITERATOR) 7182 The ‘po_next_message’ function returns the next message from 7183 ITERATOR and advances the iterator. It returns ‘NULL’ when the 7184 iterator has reached the end of its message list. 7185 7186 7187File: gettext.info, Node: po_message_t API, Next: PO Header Entry API, Prev: po_message_iterator_t API, Up: libgettextpo 7188 71899.13.4 po_message_t API 7190----------------------- 7191 7192 -- Data Type: po_message_t 7193 This is a pointer type that refers to a message of a PO file, 7194 including its translation. 7195 7196 -- Function: po_message_t po_message_create (void) 7197 Returns a freshly constructed message. To finish initializing the 7198 message, you must set the ‘msgid’ and ‘msgstr’. It _must_ be 7199 inserted into a file to manage its memory, as there is no 7200 ‘po_message_free’ available to the user of the library. 7201 7202 The following functions access details of a ‘po_message_t’. Recall 7203that the results are valid as long as the FILE handle is valid. 7204 7205 -- Function: const char * po_message_msgctxt (po_message_t MESSAGE) 7206 The ‘po_message_msgctxt’ function returns the ‘msgctxt’, the 7207 context of MESSAGE. Returns ‘NULL’ for a message not restricted to 7208 a context. 7209 7210 -- Function: void po_message_set_msgctxt (po_message_t MESSAGE, 7211 const char *MSGCTXT) 7212 The ‘po_message_set_msgctxt’ function changes the ‘msgctxt’, the 7213 context of the message, to the value provided through MSGCTXT. The 7214 value ‘NULL’ removes the restriction. 7215 7216 -- Function: const char * po_message_msgid (po_message_t MESSAGE) 7217 The ‘po_message_msgid’ function returns the ‘msgid’ (untranslated 7218 English string) of MESSAGE. This is guaranteed to be non-‘NULL’. 7219 7220 -- Function: void po_message_set_msgid (po_message_t MESSAGE, 7221 const char *MSGID) 7222 The ‘po_message_set_msgid’ function changes the ‘msgid’ 7223 (untranslated English string) of MESSAGE to the value provided 7224 through MSGID, a non-‘NULL’ string. 7225 7226 -- Function: const char * po_message_msgid_plural 7227 (po_message_t MESSAGE) 7228 The ‘po_message_msgid_plural’ function returns the ‘msgid_plural’ 7229 (untranslated English plural string) of MESSAGE, a message with 7230 plurals, or ‘NULL’ for a message without plural. 7231 7232 -- Function: void po_message_set_msgid_plural (po_message_t MESSAGE, 7233 const char *MSGID_PLURAL) 7234 The ‘po_message_set_msgid_plural’ function changes the 7235 ‘msgid_plural’ (untranslated English plural string) of a message to 7236 the value provided through MSGID_PLURAL, or removes the plurals if 7237 ‘NULL’ is provided as MSGID_PLURAL. 7238 7239 -- Function: const char * po_message_msgstr (po_message_t MESSAGE) 7240 The ‘po_message_msgstr’ function returns the ‘msgstr’ (translation) 7241 of MESSAGE. For an untranslated message, the return value is an 7242 empty string. 7243 7244 -- Function: void po_message_set_msgstr (po_message_t MESSAGE, 7245 const char *MSGSTR) 7246 The ‘po_message_set_msgstr’ function changes the ‘msgstr’ 7247 (translation) of MESSAGE to the value provided through MSGSTR, a 7248 non-‘NULL’ string. 7249 7250 -- Function: const char * po_message_msgstr_plural 7251 (po_message_t MESSAGE, int INDEX) 7252 The ‘po_message_msgstr_plural’ function returns the ‘msgstr[INDEX]’ 7253 of MESSAGE, a message with plurals, or ‘NULL’ when the INDEX is out 7254 of range or for a message without plural. 7255 7256 -- Function: void po_message_set_msgstr_plural (po_message_t MESSAGE, 7257 int INDEX, const char *MSGSTR_PLURAL) 7258 The ‘po_message_set_msgstr_plural’ function changes the 7259 ‘msgstr[INDEX]’ of MESSAGE, a message with plurals, to the value 7260 provided through MSGSTR_PLURAL. MESSAGE must be a message with 7261 plurals. Use ‘NULL’ as the value of MSGSTR_PLURAL with INDEX 7262 pointing to the last element to reduce the number of plural forms. 7263 7264 -- Function: const char * po_message_comments (po_message_t MESSAGE) 7265 The ‘po_message_comments’ function returns the comments of MESSAGE, 7266 a multiline string, ending in a newline, or a non-‘NULL’ empty 7267 string. 7268 7269 -- Function: void po_message_set_comments (po_message_t MESSAGE, 7270 const char *COMMENTS) 7271 The ‘po_message_set_comments’ function changes the comments of 7272 MESSAGE to the value COMMENTS, a multiline string, ending in a 7273 newline, or a non-‘NULL’ empty string. 7274 7275 -- Function: const char * po_message_extracted_comments 7276 (po_message_t MESSAGE) 7277 The ‘po_message_extracted_comments’ function returns the extracted 7278 comments of MESSAGE, a multiline string, ending in a newline, or a 7279 non-‘NULL’ empty string. 7280 7281 -- Function: void po_message_set_extracted_comments 7282 (po_message_t MESSAGE, const char *EXTRACTED_COMMENTS) 7283 The ‘po_message_set_extracted_comments’ function changes the 7284 comments of MESSAGE to the value EXTRACTED_COMMENTS, a multiline 7285 string, ending in a newline, or a non-‘NULL’ empty string. 7286 7287 -- Function: const char * po_message_prev_msgctxt 7288 (po_message_t MESSAGE) 7289 The ‘po_message_prev_msgctxt’ function returns the previous 7290 ‘msgctxt’, the previous context of MESSAGE. Return ‘NULL’ for a 7291 message that does not have a previous context. 7292 7293 -- Function: void po_message_set_prev_msgctxt (po_message_t MESSAGE, 7294 const char *PREV_MSGCTXT) 7295 The ‘po_message_set_prev_msgctxt’ function changes the previous 7296 ‘msgctxt’, the context of the message, to the value provided 7297 through PREV_MSGCTXT. The value ‘NULL’ removes the stored previous 7298 msgctxt. 7299 7300 -- Function: const char * po_message_prev_msgid (po_message_t MESSAGE) 7301 The ‘po_message_prev_msgid’ function returns the previous ‘msgid’ 7302 (untranslated English string) of MESSAGE, or ‘NULL’ if there is no 7303 previous ‘msgid’ stored. 7304 7305 -- Function: void po_message_set_prev_msgid (po_message_t MESSAGE, 7306 const char *PREV_MSGID) 7307 The ‘po_message_set_prev_msgid’ function changes the previous 7308 ‘msgid’ (untranslated English string) of MESSAGE to the value 7309 provided through PREV_MSGID, or removes the message when it is 7310 ‘NULL’. 7311 7312 -- Function: const char * po_message_prev_msgid_plural 7313 (po_message_t MESSAGE) 7314 The ‘po_message_prev_msgid_plural’ function returns the previous 7315 ‘msgid_plural’ (untranslated English plural string) of MESSAGE, a 7316 message with plurals, or ‘NULL’ for a message without plural 7317 without any stored previous ‘msgid_plural’. 7318 7319 -- Function: void po_message_set_prev_msgid_plural 7320 (po_message_t MESSAGE, const char *PREV_MSGID_PLURAL) 7321 The ‘po_message_set_prev_msgid_plural’ function changes the 7322 previous ‘msgid_plural’ (untranslated English plural string) of a 7323 message to the value provided through PREV_MSGID_PLURAL, or removes 7324 the stored previous ‘msgid_plural’ if ‘NULL’ is provided as 7325 PREV_MSGID_PLURAL. 7326 7327 -- Function: int po_message_is_obsolete (po_message_t MESSAGE) 7328 The ‘po_message_is_obsolete’ function returns true when MESSAGE is 7329 marked as obsolete. 7330 7331 -- Function: void po_message_set_obsolete (po_message_t MESSAGE, 7332 int OBSOLETE) 7333 The ‘po_message_set_obsolete’ function changes the obsolete mark of 7334 MESSAGE. 7335 7336 -- Function: int po_message_is_fuzzy (po_message_t MESSAGE) 7337 The ‘po_message_is_fuzzy’ function returns true when MESSAGE is 7338 marked as fuzzy. 7339 7340 -- Function: void po_message_set_fuzzy (po_message_t MESSAGE, 7341 int FUZZY) 7342 The ‘po_message_set_fuzzy’ function changes the fuzzy mark of 7343 MESSAGE. 7344 7345 -- Function: int po_message_is_format (po_message_t MESSAGE, 7346 const char *FORMAT_TYPE) 7347 The ‘po_message_is_format’ function returns true when the message 7348 is marked as being a format string of FORMAT_TYPE. 7349 7350 -- Function: void po_message_set_format (po_message_t MESSAGE, 7351 const char *FORMAT_TYPE, int VALUE) 7352 The ‘po_message_set_fuzzy’ function changes the format mark of the 7353 message for the FORMAT_TYPE provided. 7354 7355 -- Function: int po_message_is_range (po_message_t MESSAGE, int *MINP, 7356 int *MAXP) 7357 The ‘po_message_is_range’ function returns true when the message 7358 has a numeric range set, and stores the minimum and maximum value 7359 in the locations pointed by MINP and MAXP respectively. 7360 7361 -- Function: void po_message_set_range (po_message_t MESSAGE, int MIN, 7362 int MAX) 7363 The ‘po_message_set_range’ function changes the numeric range of 7364 the message. MIN and MAX must be non-negative, with MIN < MAX. 7365 Use MIN and MAX with value ‘-1’ to remove the numeric range of 7366 MESSAGE. 7367 7368 7369File: gettext.info, Node: PO Header Entry API, Next: po_filepos_t API, Prev: po_message_t API, Up: libgettextpo 7370 73719.13.5 PO Header Entry API 7372-------------------------- 7373 7374 The following functions provide an interface to extract and 7375manipulate the header entry (*note Header Entry::) from a file loaded in 7376memory. The meta information must be written back into the domain 7377message with the empty string as ‘msgid’. 7378 7379 -- Function: const char * po_file_domain_header (po_file_t FILE, 7380 const char *DOMAIN) 7381 Returns the header entry of a domain from FILE, a PO file loaded in 7382 memory. The value ‘NULL’ provided as DOMAIN denotes the default 7383 domain. Returns ‘NULL’ if there is no header entry. 7384 7385 -- Function: char * po_header_field (const char *HEADER, 7386 const char *FIELD) 7387 Returns the value of FIELD in the HEADER entry. The return value 7388 is either a freshly allocated string, to be freed by the caller, or 7389 ‘NULL’. 7390 7391 -- Function: char * po_header_set_field (const char *HEADER, 7392 const char *FIELD, const char *VALUE) 7393 Returns a freshly allocated string which contains the entry from 7394 HEADER with FIELD set to VALUE. The field is added if necessary. 7395 7396 7397File: gettext.info, Node: po_filepos_t API, Next: Format Type API, Prev: PO Header Entry API, Up: libgettextpo 7398 73999.13.6 po_filepos_t API 7400----------------------- 7401 7402 -- Data Type: po_filepos_t 7403 This is a pointer type that refers to a string’s position within a 7404 source file. 7405 7406 The following functions provide an interface to extract and 7407manipulate these references. 7408 7409 -- Function: po_filepos_t po_message_filepos (po_message_t MESSAGE, 7410 int INDEX) 7411 Returns the file reference in position INDEX from the message. If 7412 INDEX is out of range, returns ‘NULL’. 7413 7414 -- Function: void po_message_remove_filepos (po_message_t MESSAGE, 7415 int INDEX) 7416 Removes the file reference in position INDEX from the message. It 7417 moves all references following INDEX one position backwards. 7418 7419 -- Function: void po_message_add_filepos (po_message_t MESSAGE, 7420 const char *FILE, size_t START_LINE) 7421 Adds a reference to the string from FILE starting at START_LINE, if 7422 it is not already present for the message. The value 7423 ‘(size_t)(-1)’ for START_LINE denotes that the line number is not 7424 available. 7425 7426 7427File: gettext.info, Node: Format Type API, Next: Checking API, Prev: po_filepos_t API, Up: libgettextpo 7428 74299.13.7 Format Type API 7430---------------------- 7431 7432 -- Function: const char * const * po_format_list (void) 7433 Returns a ‘NULL’ terminated array of the supported format types. 7434 7435 -- Function: const char * po_format_pretty_name 7436 (const char *FORMAT_TYPE) 7437 Returns the pretty name associated with FORMAT_TYPE. For example, 7438 it returns “C#” when FORMAT_TYPE is “csharp_format”. Return ‘NULL’ 7439 if FORMAT_TYPE is not a supported format type. 7440 7441 7442File: gettext.info, Node: Checking API, Prev: Format Type API, Up: libgettextpo 7443 74449.13.8 Checking API 7445------------------- 7446 7447 -- Function: void po_file_check_all (po_file_t FILE, 7448 po_xerror_handler_t HANDLER) 7449 Tests whether the entire FILE is valid, like ‘msgfmt’ does it. If 7450 it is invalid, passes the reasons to HANDLER. 7451 7452 -- Function: void po_message_check_all (po_message_t MESSAGE, 7453 po_message_iterator_t ITERATOR, po_xerror_handler_t HANDLER) 7454 Tests MESSAGE, to be inserted at ITERATOR in a PO file in memory, 7455 like ‘msgfmt’ does it. If it is invalid, passes the reasons to 7456 HANDLER. ITERATOR is not modified by this call; it only specifies 7457 the file and the domain. 7458 7459 -- Function: void po_message_check_format (po_message_t MESSAGE, 7460 po_xerror_handler_t HANDLER) 7461 Tests whether the message translation from MESSAGE is a valid 7462 format string if the message is marked as being a format string. 7463 If it is invalid, passes the reasons to HANDLER. 7464 7465 This function is exported as ‘po_message_check_format_v2’ at ABI 7466 level, but is defined as ‘po_message_check_format’ in C code after 7467 the inclusion of ‘<gettext-po.h>’. 7468 7469 7470File: gettext.info, Node: Binaries, Next: Programmers, Prev: Manipulating, Up: Top 7471 747210 Producing Binary MO Files 7473**************************** 7474 7475* Menu: 7476 7477* msgfmt Invocation:: Invoking the ‘msgfmt’ Program 7478* msgunfmt Invocation:: Invoking the ‘msgunfmt’ Program 7479* MO Files:: The Format of GNU MO Files 7480 7481 7482File: gettext.info, Node: msgfmt Invocation, Next: msgunfmt Invocation, Up: Binaries 7483 748410.1 Invoking the ‘msgfmt’ Program 7485================================== 7486 7487 msgfmt [OPTION] FILENAME.po ... 7488 7489 The ‘msgfmt’ programs generates a binary message catalog from a 7490textual translation description. 7491 749210.1.1 Input file location 7493-------------------------- 7494 7495‘FILENAME.po ...’ 7496 7497‘-D DIRECTORY’ 7498‘--directory=DIRECTORY’ 7499 Add DIRECTORY to the list of directories. Source files are 7500 searched relative to this list of directories. The resulting 7501 binary file will be written relative to the current directory, 7502 though. 7503 7504 If an input file is ‘-’, standard input is read. 7505 750610.1.2 Operation mode 7507--------------------- 7508 7509‘-j’ 7510‘--java’ 7511 Java mode: generate a Java ‘ResourceBundle’ class. 7512 7513‘--java2’ 7514 Like –java, and assume Java2 (JDK 1.2 or higher). 7515 7516‘--csharp’ 7517 C# mode: generate a .NET .dll file containing a subclass of 7518 ‘GettextResourceSet’. 7519 7520‘--csharp-resources’ 7521 C# resources mode: generate a .NET ‘.resources’ file. 7522 7523‘--tcl’ 7524 Tcl mode: generate a tcl/msgcat ‘.msg’ file. 7525 7526‘--qt’ 7527 Qt mode: generate a Qt ‘.qm’ file. 7528 7529‘--desktop’ 7530 Desktop Entry mode: generate a ‘.desktop’ file. 7531 7532‘--xml’ 7533 XML mode: generate an XML file. 7534 753510.1.3 Output file location 7536--------------------------- 7537 7538‘-o FILE’ 7539‘--output-file=FILE’ 7540 Write output to specified file. 7541 7542‘--strict’ 7543 Direct the program to work strictly following the Uniforum/Sun 7544 implementation. Currently this only affects the naming of the 7545 output file. If this option is not given the name of the output 7546 file is the same as the domain name. If the strict Uniforum mode 7547 is enabled the suffix ‘.mo’ is added to the file name if it is not 7548 already present. 7549 7550 We find this behaviour of Sun’s implementation rather silly and so 7551 by default this mode is _not_ selected. 7552 7553 If the output FILE is ‘-’, output is written to standard output. 7554 755510.1.4 Output file location in Java mode 7556---------------------------------------- 7557 7558‘-r RESOURCE’ 7559‘--resource=RESOURCE’ 7560 Specify the resource name. 7561 7562‘-l LOCALE’ 7563‘--locale=LOCALE’ 7564 Specify the locale name, either a language specification of the 7565 form LL or a combined language and country specification of the 7566 form LL_CC. 7567 7568‘-d DIRECTORY’ 7569 Specify the base directory of classes directory hierarchy. 7570 7571‘--source’ 7572 Produce a .java source file, instead of a compiled .class file. 7573 7574 The class name is determined by appending the locale name to the 7575resource name, separated with an underscore. The ‘-d’ option is 7576mandatory. The class is written under the specified directory. 7577 757810.1.5 Output file location in C# mode 7579-------------------------------------- 7580 7581‘-r RESOURCE’ 7582‘--resource=RESOURCE’ 7583 Specify the resource name. 7584 7585‘-l LOCALE’ 7586‘--locale=LOCALE’ 7587 Specify the locale name, either a language specification of the 7588 form LL or a combined language and country specification of the 7589 form LL_CC. 7590 7591‘-d DIRECTORY’ 7592 Specify the base directory for locale dependent ‘.dll’ files. 7593 7594 The ‘-l’ and ‘-d’ options are mandatory. The ‘.dll’ file is written 7595in a subdirectory of the specified directory whose name depends on the 7596locale. 7597 759810.1.6 Output file location in Tcl mode 7599--------------------------------------- 7600 7601‘-l LOCALE’ 7602‘--locale=LOCALE’ 7603 Specify the locale name, either a language specification of the 7604 form LL or a combined language and country specification of the 7605 form LL_CC. 7606 7607‘-d DIRECTORY’ 7608 Specify the base directory of ‘.msg’ message catalogs. 7609 7610 The ‘-l’ and ‘-d’ options are mandatory. The ‘.msg’ file is written 7611in the specified directory. 7612 761310.1.7 Desktop Entry mode operations 7614------------------------------------ 7615 7616‘--template=TEMPLATE’ 7617 Specify a .desktop file used as a template. 7618 7619‘-k[KEYWORDSPEC]’ 7620‘--keyword[=KEYWORDSPEC]’ 7621 Specify KEYWORDSPEC as an additional keyword to be looked for. 7622 Without a KEYWORDSPEC, the option means to not use default 7623 keywords. 7624 7625‘-l LOCALE’ 7626‘--locale=LOCALE’ 7627 Specify the locale name, either a language specification of the 7628 form LL or a combined language and country specification of the 7629 form LL_CC. 7630 7631‘-d DIRECTORY’ 7632 Specify the directory where PO files are read. The directory must 7633 contain the ‘LINGUAS’ file. 7634 7635 To generate a ‘.desktop’ file for a single locale, you can use it as 7636follows. 7637 7638 msgfmt --desktop --template=TEMPLATE --locale=LOCALE \ 7639 -o FILE FILENAME.po ... 7640 7641 msgfmt provides a special "bulk" operation mode to process multiple 7642‘.po’ files at a time. 7643 7644 msgfmt --desktop --template=TEMPLATE -d DIRECTORY -o FILE 7645 7646 msgfmt first reads the ‘LINGUAS’ file under DIRECTORY, and then 7647processes all ‘.po’ files listed there. You can also limit the locales 7648to a subset, through the ‘LINGUAS’ environment variable. 7649 7650 For either operation modes, the ‘-o’ and ‘--template’ options are 7651mandatory. 7652 765310.1.8 XML mode operations 7654-------------------------- 7655 7656‘--template=TEMPLATE’ 7657 Specify an XML file used as a template. 7658 7659‘-L NAME’ 7660‘--language=NAME’ 7661 Specifies the language of the input files. 7662 7663‘-l LOCALE’ 7664‘--locale=LOCALE’ 7665 Specify the locale name, either a language specification of the 7666 form LL or a combined language and country specification of the 7667 form LL_CC. 7668 7669‘-d DIRECTORY’ 7670 Specify the base directory of ‘.po’ message catalogs. 7671 7672 To generate an XML file for a single locale, you can use it as 7673follows. 7674 7675 msgfmt --xml --template=TEMPLATE --locale=LOCALE \ 7676 -o FILE FILENAME.po ... 7677 7678 msgfmt provides a special "bulk" operation mode to process multiple 7679‘.po’ files at a time. 7680 7681 msgfmt --xml --template=TEMPLATE -d DIRECTORY -o FILE 7682 7683 msgfmt first reads the ‘LINGUAS’ file under DIRECTORY, and then 7684processes all ‘.po’ files listed there. You can also limit the locales 7685to a subset, through the ‘LINGUAS’ environment variable. 7686 7687 For either operation modes, the ‘-o’ and ‘--template’ options are 7688mandatory. 7689 769010.1.9 Input file syntax 7691------------------------ 7692 7693‘-P’ 7694‘--properties-input’ 7695 Assume the input files are Java ResourceBundles in Java 7696 ‘.properties’ syntax, not in PO file syntax. 7697 7698‘--stringtable-input’ 7699 Assume the input files are NeXTstep/GNUstep localized resource 7700 files in ‘.strings’ syntax, not in PO file syntax. 7701 770210.1.10 Input file interpretation 7703--------------------------------- 7704 7705‘-c’ 7706‘--check’ 7707 Perform all the checks implied by ‘--check-format’, 7708 ‘--check-header’, ‘--check-domain’. 7709 7710‘--check-format’ 7711 Check language dependent format strings. 7712 7713 If the string represents a format string used in a ‘printf’-like 7714 function both strings should have the same number of ‘%’ format 7715 specifiers, with matching types. If the flag ‘c-format’ or 7716 ‘possible-c-format’ appears in the special comment <#,> for this 7717 entry a check is performed. For example, the check will diagnose 7718 using ‘%.*s’ against ‘%s’, or ‘%d’ against ‘%s’, or ‘%d’ against 7719 ‘%x’. It can even handle positional parameters. 7720 7721 Normally the ‘xgettext’ program automatically decides whether a 7722 string is a format string or not. This algorithm is not perfect, 7723 though. It might regard a string as a format string though it is 7724 not used in a ‘printf’-like function and so ‘msgfmt’ might report 7725 errors where there are none. 7726 7727 To solve this problem the programmer can dictate the decision to 7728 the ‘xgettext’ program (*note c-format::). The translator should 7729 not consider removing the flag from the <#,> line. This "fix" 7730 would be reversed again as soon as ‘msgmerge’ is called the next 7731 time. 7732 7733‘--check-header’ 7734 Verify presence and contents of the header entry. *Note Header 7735 Entry::, for a description of the various fields in the header 7736 entry. 7737 7738‘--check-domain’ 7739 Check for conflicts between domain directives and the 7740 ‘--output-file’ option 7741 7742‘-C’ 7743‘--check-compatibility’ 7744 Check that GNU msgfmt behaves like X/Open msgfmt. This will give 7745 an error when attempting to use the GNU extensions. 7746 7747‘--check-accelerators[=CHAR]’ 7748 Check presence of keyboard accelerators for menu items. This is 7749 based on the convention used in some GUIs that a keyboard 7750 accelerator in a menu item string is designated by an immediately 7751 preceding ‘&’ character. Sometimes a keyboard accelerator is also 7752 called "keyboard mnemonic". This check verifies that if the 7753 untranslated string has exactly one ‘&’ character, the translated 7754 string has exactly one ‘&’ as well. If this option is given with a 7755 CHAR argument, this CHAR should be a non-alphanumeric character and 7756 is used as keyboard accelerator mark instead of ‘&’. 7757 7758‘-f’ 7759‘--use-fuzzy’ 7760 Use fuzzy entries in output. Note that using this option is 7761 usually wrong, because fuzzy messages are exactly those which have 7762 not been validated by a human translator. 7763 776410.1.11 Output details 7765---------------------- 7766 7767‘-a NUMBER’ 7768‘--alignment=NUMBER’ 7769 Align strings to NUMBER bytes (default: 1). 7770 7771‘--endianness=BYTEORDER’ 7772 Write out 32-bit numbers in the given byte order. The possible 7773 values are ‘big’ and ‘little’. The default is ‘little’. 7774 7775 MO files of any endianness can be used on any platform. When a MO 7776 file has an endianness other than the platform’s one, the 32-bit 7777 numbers from the MO file are swapped at runtime. The performance 7778 impact is negligible. 7779 7780 This option can be useful to produce MO files that are optimized 7781 for one platform. 7782 7783‘--no-hash’ 7784 Don’t include a hash table in the binary file. Lookup will be more 7785 expensive at run time (binary search instead of hash table lookup). 7786 778710.1.12 Informative output 7788-------------------------- 7789 7790‘-h’ 7791‘--help’ 7792 Display this help and exit. 7793 7794‘-V’ 7795‘--version’ 7796 Output version information and exit. 7797 7798‘--statistics’ 7799 Print statistics about translations. When the option ‘--verbose’ 7800 is used in combination with ‘--statistics’, the input file name is 7801 printed in front of the statistics line. 7802 7803‘-v’ 7804‘--verbose’ 7805 Increase verbosity level. 7806 7807 7808File: gettext.info, Node: msgunfmt Invocation, Next: MO Files, Prev: msgfmt Invocation, Up: Binaries 7809 781010.2 Invoking the ‘msgunfmt’ Program 7811==================================== 7812 7813 msgunfmt [OPTION] [FILE]... 7814 7815 The ‘msgunfmt’ program converts a binary message catalog to a 7816Uniforum style .po file. 7817 781810.2.1 Operation mode 7819--------------------- 7820 7821‘-j’ 7822‘--java’ 7823 Java mode: input is a Java ‘ResourceBundle’ class. 7824 7825‘--csharp’ 7826 C# mode: input is a .NET .dll file containing a subclass of 7827 ‘GettextResourceSet’. 7828 7829‘--csharp-resources’ 7830 C# resources mode: input is a .NET ‘.resources’ file. 7831 7832‘--tcl’ 7833 Tcl mode: input is a tcl/msgcat ‘.msg’ file. 7834 783510.2.2 Input file location 7836-------------------------- 7837 7838‘FILE ...’ 7839 Input .mo files. 7840 7841 If no input FILE is given or if it is ‘-’, standard input is read. 7842 784310.2.3 Input file location in Java mode 7844--------------------------------------- 7845 7846‘-r RESOURCE’ 7847‘--resource=RESOURCE’ 7848 Specify the resource name. 7849 7850‘-l LOCALE’ 7851‘--locale=LOCALE’ 7852 Specify the locale name, either a language specification of the 7853 form LL or a combined language and country specification of the 7854 form LL_CC. 7855 7856 The class name is determined by appending the locale name to the 7857resource name, separated with an underscore. The class is located using 7858the ‘CLASSPATH’. 7859 786010.2.4 Input file location in C# mode 7861------------------------------------- 7862 7863‘-r RESOURCE’ 7864‘--resource=RESOURCE’ 7865 Specify the resource name. 7866 7867‘-l LOCALE’ 7868‘--locale=LOCALE’ 7869 Specify the locale name, either a language specification of the 7870 form LL or a combined language and country specification of the 7871 form LL_CC. 7872 7873‘-d DIRECTORY’ 7874 Specify the base directory for locale dependent ‘.dll’ files. 7875 7876 The ‘-l’ and ‘-d’ options are mandatory. The ‘.msg’ file is located 7877in a subdirectory of the specified directory whose name depends on the 7878locale. 7879 788010.2.5 Input file location in Tcl mode 7881-------------------------------------- 7882 7883‘-l LOCALE’ 7884‘--locale=LOCALE’ 7885 Specify the locale name, either a language specification of the 7886 form LL or a combined language and country specification of the 7887 form LL_CC. 7888 7889‘-d DIRECTORY’ 7890 Specify the base directory of ‘.msg’ message catalogs. 7891 7892 The ‘-l’ and ‘-d’ options are mandatory. The ‘.msg’ file is located 7893in the specified directory. 7894 789510.2.6 Output file location 7896--------------------------- 7897 7898‘-o FILE’ 7899‘--output-file=FILE’ 7900 Write output to specified file. 7901 7902 The results are written to standard output if no output file is 7903specified or if it is ‘-’. 7904 790510.2.7 Output details 7906--------------------- 7907 7908‘--color’ 7909‘--color=WHEN’ 7910 Specify whether or when to use colors and other text attributes. 7911 See *note The --color option:: for details. 7912 7913‘--style=STYLE_FILE’ 7914 Specify the CSS style rule file to use for ‘--color’. See *note 7915 The --style option:: for details. 7916 7917‘--force-po’ 7918 Always write an output file even if it contains no message. 7919 7920‘-i’ 7921‘--indent’ 7922 Write the .po file using indented style. 7923 7924‘--strict’ 7925 Write out a strict Uniforum conforming PO file. Note that this 7926 Uniforum format should be avoided because it doesn’t support the 7927 GNU extensions. 7928 7929‘-p’ 7930‘--properties-output’ 7931 Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note 7932 that this file format doesn’t support plural forms and silently 7933 drops obsolete messages. 7934 7935‘--stringtable-output’ 7936 Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ 7937 syntax. Note that this file format doesn’t support plural forms. 7938 7939‘-w NUMBER’ 7940‘--width=NUMBER’ 7941 Set the output page width. Long strings in the output files will 7942 be split across multiple lines in order to ensure that each line’s 7943 width (= number of screen columns) is less or equal to the given 7944 NUMBER. 7945 7946‘--no-wrap’ 7947 Do not break long message lines. Message lines whose width exceeds 7948 the output page width will not be split into several lines. Only 7949 file reference lines which are wider than the output page width 7950 will be split. 7951 7952‘-s’ 7953‘--sort-output’ 7954 Generate sorted output. Note that using this option makes it much 7955 harder for the translator to understand each message’s context. 7956 795710.2.8 Informative output 7958------------------------- 7959 7960‘-h’ 7961‘--help’ 7962 Display this help and exit. 7963 7964‘-V’ 7965‘--version’ 7966 Output version information and exit. 7967 7968‘-v’ 7969‘--verbose’ 7970 Increase verbosity level. 7971 7972 7973File: gettext.info, Node: MO Files, Prev: msgunfmt Invocation, Up: Binaries 7974 797510.3 The Format of GNU MO Files 7976=============================== 7977 7978 The format of the generated MO files is best described by a picture, 7979which appears below. 7980 7981 The first two words serve the identification of the file. The magic 7982number will always signal GNU MO files. The number is stored in the 7983byte order used when the MO file was generated, so the magic number 7984really is two numbers: ‘0x950412de’ and ‘0xde120495’. 7985 7986 The second word describes the current revision of the file format, 7987composed of a major and a minor revision number. The revision numbers 7988ensure that the readers of MO files can distinguish new formats from old 7989ones and handle their contents, as far as possible. For now the major 7990revision is 0 or 1, and the minor revision is also 0 or 1. More 7991revisions might be added in the future. A program seeing an unexpected 7992major revision number should stop reading the MO file entirely; whereas 7993an unexpected minor revision number means that the file can be read but 7994will not reveal its full contents, when parsed by a program that 7995supports only smaller minor revision numbers. 7996 7997 The version is kept separate from the magic number, instead of using 7998different magic numbers for different formats, mainly because 7999‘/etc/magic’ is not updated often. 8000 8001 Follow a number of pointers to later tables in the file, allowing for 8002the extension of the prefix part of MO files without having to recompile 8003programs reading them. This might become useful for later inserting a 8004few flag bits, indication about the charset used, new tables, or other 8005things. 8006 8007 Then, at offset O and offset T in the picture, two tables of string 8008descriptors can be found. In both tables, each string descriptor uses 8009two 32 bits integers, one for the string length, another for the offset 8010of the string in the MO file, counting in bytes from the start of the 8011file. The first table contains descriptors for the original strings, 8012and is sorted so the original strings are in increasing lexicographical 8013order. The second table contains descriptors for the translated 8014strings, and is parallel to the first table: to find the corresponding 8015translation one has to access the array slot in the second array with 8016the same index. 8017 8018 Having the original strings sorted enables the use of simple binary 8019search, for when the MO file does not contain an hashing table, or for 8020when it is not practical to use the hashing table provided in the MO 8021file. This also has another advantage, as the empty string in a PO file 8022GNU ‘gettext’ is usually _translated_ into some system information 8023attached to that particular MO file, and the empty string necessarily 8024becomes the first in both the original and translated tables, making the 8025system information very easy to find. 8026 8027 The size S of the hash table can be zero. In this case, the hash 8028table itself is not contained in the MO file. Some people might prefer 8029this because a precomputed hashing table takes disk space, and does not 8030win _that_ much speed. The hash table contains indices to the sorted 8031array of strings in the MO file. Conflict resolution is done by double 8032hashing. The precise hashing algorithm used is fairly dependent on GNU 8033‘gettext’ code, and is not documented here. 8034 8035 As for the strings themselves, they follow the hash file, and each is 8036terminated with a <NUL>, and this <NUL> is not counted in the length 8037which appears in the string descriptor. The ‘msgfmt’ program has an 8038option selecting the alignment for MO file strings. With this option, 8039each string is separately aligned so it starts at an offset which is a 8040multiple of the alignment value. On some RISC machines, a correct 8041alignment will speed things up. 8042 8043 Contexts are stored by storing the concatenation of the context, a 8044<EOT> byte, and the original string, instead of the original string. 8045 8046 Plural forms are stored by letting the plural of the original string 8047follow the singular of the original string, separated through a <NUL> 8048byte. The length which appears in the string descriptor includes both. 8049However, only the singular of the original string takes part in the hash 8050table lookup. The plural variants of the translation are all stored 8051consecutively, separated through a <NUL> byte. Here also, the length in 8052the string descriptor includes all of them. 8053 8054 Nothing prevents a MO file from having embedded <NUL>s in strings. 8055However, the program interface currently used already presumes that 8056strings are <NUL> terminated, so embedded <NUL>s are somewhat useless. 8057But the MO file format is general enough so other interfaces would be 8058later possible, if for example, we ever want to implement wide 8059characters right in MO files, where <NUL> bytes may accidentally appear. 8060(No, we don’t want to have wide characters in MO files. They would make 8061the file unnecessarily large, and the ‘wchar_t’ type being platform 8062dependent, MO files would be platform dependent as well.) 8063 8064 This particular issue has been strongly debated in the GNU ‘gettext’ 8065development forum, and it is expectable that MO file format will evolve 8066or change over time. It is even possible that many formats may later be 8067supported concurrently. But surely, we have to start somewhere, and the 8068MO file format described here is a good start. Nothing is cast in 8069concrete, and the format may later evolve fairly easily, so we should 8070feel comfortable with the current approach. 8071 8072 byte 8073 +------------------------------------------+ 8074 0 | magic number = 0x950412de | 8075 | | 8076 4 | file format revision = 0 | 8077 | | 8078 8 | number of strings | == N 8079 | | 8080 12 | offset of table with original strings | == O 8081 | | 8082 16 | offset of table with translation strings | == T 8083 | | 8084 20 | size of hashing table | == S 8085 | | 8086 24 | offset of hashing table | == H 8087 | | 8088 . . 8089 . (possibly more entries later) . 8090 . . 8091 | | 8092 O | length & offset 0th string ----------------. 8093 O + 8 | length & offset 1st string ------------------. 8094 ... ... | | 8095 O + ((N-1)*8)| length & offset (N-1)th string | | | 8096 | | | | 8097 T | length & offset 0th translation ---------------. 8098 T + 8 | length & offset 1st translation -----------------. 8099 ... ... | | | | 8100 T + ((N-1)*8)| length & offset (N-1)th translation | | | | | 8101 | | | | | | 8102 H | start hash table | | | | | 8103 ... ... | | | | 8104 H + S * 4 | end hash table | | | | | 8105 | | | | | | 8106 | NUL terminated 0th string <----------------' | | | 8107 | | | | | 8108 | NUL terminated 1st string <------------------' | | 8109 | | | | 8110 ... ... | | 8111 | | | | 8112 | NUL terminated 0th translation <---------------' | 8113 | | | 8114 | NUL terminated 1st translation <-----------------' 8115 | | 8116 ... ... 8117 | | 8118 +------------------------------------------+ 8119 8120 8121File: gettext.info, Node: Programmers, Next: Translators, Prev: Binaries, Up: Top 8122 812311 The Programmer’s View 8124************************ 8125 8126 One aim of the current message catalog implementation provided by GNU 8127‘gettext’ was to use the system’s message catalog handling, if the 8128installer wishes to do so. So we perhaps should first take a look at 8129the solutions we know about. The people in the POSIX committee did not 8130manage to agree on one of the semi-official standards which we’ll 8131describe below. In fact they couldn’t agree on anything, so they 8132decided only to include an example of an interface. The major Unix 8133vendors are split in the usage of the two most important specifications: 8134X/Open’s catgets vs. Uniforum’s gettext interface. We’ll describe them 8135both and later explain our solution of this dilemma. 8136 8137* Menu: 8138 8139* catgets:: About ‘catgets’ 8140* gettext:: About ‘gettext’ 8141* Comparison:: Comparing the two interfaces 8142* Using libintl.a:: Using libintl.a in own programs 8143* gettext grok:: Being a ‘gettext’ grok 8144* Temp Programmers:: Temporary Notes for the Programmers Chapter 8145 8146 8147File: gettext.info, Node: catgets, Next: gettext, Up: Programmers 8148 814911.1 About ‘catgets’ 8150==================== 8151 8152 The ‘catgets’ implementation is defined in the X/Open Portability 8153Guide, Volume 3, XSI Supplementary Definitions, Chapter 5. But the 8154process of creating this standard seemed to be too slow for some of the 8155Unix vendors so they created their implementations on preliminary 8156versions of the standard. Of course this leads again to problems while 8157writing platform independent programs: even the usage of ‘catgets’ does 8158not guarantee a unique interface. 8159 8160 Another, personal comment on this that only a bunch of committee 8161members could have made this interface. They never really tried to 8162program using this interface. It is a fast, memory-saving 8163implementation, an user can happily live with it. But programmers hate 8164it (at least I and some others do...) 8165 8166 But we must not forget one point: after all the trouble with 8167transferring the rights on Unix they at last came to X/Open, the very 8168same who published this specification. This leads me to making the 8169prediction that this interface will be in future Unix standards (e.g. 8170Spec1170) and therefore part of all Unix implementation 8171(implementations, which are _allowed_ to wear this name). 8172 8173* Menu: 8174 8175* Interface to catgets:: The interface 8176* Problems with catgets:: Problems with the ‘catgets’ interface?! 8177 8178 8179File: gettext.info, Node: Interface to catgets, Next: Problems with catgets, Up: catgets 8180 818111.1.1 The Interface 8182-------------------- 8183 8184 The interface to the ‘catgets’ implementation consists of three 8185functions which correspond to those used in file access: ‘catopen’ to 8186open the catalog for using, ‘catgets’ for accessing the message tables, 8187and ‘catclose’ for closing after work is done. Prototypes for the 8188functions and the needed definitions are in the ‘<nl_types.h>’ header 8189file. 8190 8191 ‘catopen’ is used like in this: 8192 8193 nl_catd catd = catopen ("catalog_name", 0); 8194 8195 The function takes as the argument the name of the catalog. This 8196usual refers to the name of the program or the package. The second 8197parameter is not further specified in the standard. I don’t even know 8198whether it is implemented consistently among various systems. So the 8199common advice is to use ‘0’ as the value. The return value is a handle 8200to the message catalog, equivalent to handles to file returned by 8201‘open’. 8202 8203 This handle is of course used in the ‘catgets’ function which can be 8204used like this: 8205 8206 char *translation = catgets (catd, set_no, msg_id, "original string"); 8207 8208 The first parameter is this catalog descriptor. The second parameter 8209specifies the set of messages in this catalog, in which the message 8210described by ‘msg_id’ is obtained. ‘catgets’ therefore uses a 8211three-stage addressing: 8212 8213 catalog name ⇒ set number ⇒ message ID ⇒ translation 8214 8215 The fourth argument is not used to address the translation. It is 8216given as a default value in case when one of the addressing stages fail. 8217One important thing to remember is that although the return type of 8218catgets is ‘char *’ the resulting string _must not_ be changed. It 8219should better be ‘const char *’, but the standard is published in 1988, 8220one year before ANSI C. 8221 8222The last of these functions is used and behaves as expected: 8223 8224 catclose (catd); 8225 8226 After this no ‘catgets’ call using the descriptor is legal anymore. 8227 8228 8229File: gettext.info, Node: Problems with catgets, Prev: Interface to catgets, Up: catgets 8230 823111.1.2 Problems with the ‘catgets’ Interface?! 8232---------------------------------------------- 8233 8234 Now that this description seemed to be really easy — where are the 8235problems we speak of? In fact the interface could be used in a 8236reasonable way, but constructing the message catalogs is a pain. The 8237reason for this lies in the third argument of ‘catgets’: the unique 8238message ID. This has to be a numeric value for all messages in a single 8239set. Perhaps you could imagine the problems keeping such a list while 8240changing the source code. Add a new message here, remove one there. Of 8241course there have been developed a lot of tools helping to organize this 8242chaos but one as the other fails in one aspect or the other. We don’t 8243want to say that the other approach has no problems but they are far 8244more easy to manage. 8245 8246 8247File: gettext.info, Node: gettext, Next: Comparison, Prev: catgets, Up: Programmers 8248 824911.2 About ‘gettext’ 8250==================== 8251 8252 The definition of the ‘gettext’ interface comes from a Uniforum 8253proposal. It was submitted there by Sun, who had implemented the 8254‘gettext’ function in SunOS 4, around 1990. Nowadays, the ‘gettext’ 8255interface is specified by the OpenI18N standard. 8256 8257 The main point about this solution is that it does not follow the 8258method of normal file handling (open-use-close) and that it does not 8259burden the programmer with so many tasks, especially the unique key 8260handling. Of course here also a unique key is needed, but this key is 8261the message itself (how long or short it is). See *note Comparison:: 8262for a more detailed comparison of the two methods. 8263 8264 The following section contains a rather detailed description of the 8265interface. We make it that detailed because this is the interface we 8266chose for the GNU ‘gettext’ Library. Programmers interested in using 8267this library will be interested in this description. 8268 8269* Menu: 8270 8271* Interface to gettext:: The interface 8272* Ambiguities:: Solving ambiguities 8273* Locating Catalogs:: Locating message catalog files 8274* Charset conversion:: How to request conversion to Unicode 8275* Contexts:: Solving ambiguities in GUI programs 8276* Plural forms:: Additional functions for handling plurals 8277* Optimized gettext:: Optimization of the *gettext functions 8278 8279 8280File: gettext.info, Node: Interface to gettext, Next: Ambiguities, Up: gettext 8281 828211.2.1 The Interface 8283-------------------- 8284 8285 The minimal functionality an interface must have is a) to select a 8286domain the strings are coming from (a single domain for all programs is 8287not reasonable because its construction and maintenance is difficult, 8288perhaps impossible) and b) to access a string in a selected domain. 8289 8290 This is principally the description of the ‘gettext’ interface. It 8291has a global domain which unqualified usages reference. Of course this 8292domain is selectable by the user. 8293 8294 char *textdomain (const char *domain_name); 8295 8296 This provides the possibility to change or query the current status 8297of the current global domain of the ‘LC_MESSAGE’ category. The argument 8298is a null-terminated string, whose characters must be legal in the use 8299in filenames. If the DOMAIN_NAME argument is ‘NULL’, the function 8300returns the current value. If no value has been set before, the name of 8301the default domain is returned: _messages_. Please note that although 8302the return value of ‘textdomain’ is of type ‘char *’ no changing is 8303allowed. It is also important to know that no checks of the 8304availability are made. If the name is not available you will see this 8305by the fact that no translations are provided. 8306 8307To use a domain set by ‘textdomain’ the function 8308 8309 char *gettext (const char *msgid); 8310 8311is to be used. This is the simplest reasonable form one can imagine. 8312The translation of the string MSGID is returned if it is available in 8313the current domain. If it is not available, the argument itself is 8314returned. If the argument is ‘NULL’ the result is undefined. 8315 8316 One thing which should come into mind is that no explicit dependency 8317to the used domain is given. The current value of the domain is used. 8318If this changes between two executions of the same ‘gettext’ call in the 8319program, both calls reference a different message catalog. 8320 8321 For the easiest case, which is normally used in internationalized 8322packages, once at the beginning of execution a call to ‘textdomain’ is 8323issued, setting the domain to a unique name, normally the package name. 8324In the following code all strings which have to be translated are 8325filtered through the gettext function. That’s all, the package speaks 8326your language. 8327 8328 8329File: gettext.info, Node: Ambiguities, Next: Locating Catalogs, Prev: Interface to gettext, Up: gettext 8330 833111.2.2 Solving Ambiguities 8332-------------------------- 8333 8334 While this single name domain works well for most applications there 8335might be the need to get translations from more than one domain. Of 8336course one could switch between different domains with calls to 8337‘textdomain’, but this is really not convenient nor is it fast. A 8338possible situation could be one case subject to discussion during this 8339writing: all error messages of functions in the set of common used 8340functions should go into a separate domain ‘error’. By this mean we 8341would only need to translate them once. Another case are messages from 8342a library, as these _have_ to be independent of the current domain set 8343by the application. 8344 8345For this reasons there are two more functions to retrieve strings: 8346 8347 char *dgettext (const char *domain_name, const char *msgid); 8348 char *dcgettext (const char *domain_name, const char *msgid, 8349 int category); 8350 8351 Both take an additional argument at the first place, which 8352corresponds to the argument of ‘textdomain’. The third argument of 8353‘dcgettext’ allows to use another locale category but ‘LC_MESSAGES’. 8354But I really don’t know where this can be useful. If the DOMAIN_NAME is 8355‘NULL’ or CATEGORY has an value beside the known ones, the result is 8356undefined. It should also be noted that this function is not part of 8357the second known implementation of this function family, the one found 8358in Solaris. 8359 8360 A second ambiguity can arise by the fact, that perhaps more than one 8361domain has the same name. This can be solved by specifying where the 8362needed message catalog files can be found. 8363 8364 char *bindtextdomain (const char *domain_name, 8365 const char *dir_name); 8366 8367 Calling this function binds the given domain to a file in the 8368specified directory (how this file is determined follows below). 8369Especially a file in the systems default place is not favored against 8370the specified file anymore (as it would be by solely using 8371‘textdomain’). A ‘NULL’ pointer for the DIR_NAME parameter returns the 8372binding associated with DOMAIN_NAME. If DOMAIN_NAME itself is ‘NULL’ 8373nothing happens and a ‘NULL’ pointer is returned. Here again as for all 8374the other functions is true that none of the return value must be 8375changed! 8376 8377 It is important to remember that relative path names for the DIR_NAME 8378parameter can be trouble. Since the path is always computed relative to 8379the current directory different results will be achieved when the 8380program executes a ‘chdir’ command. Relative paths should always be 8381avoided to avoid dependencies and unreliabilities. 8382 8383 wchar_t *wbindtextdomain (const char *domain_name, 8384 const wchar_t *dir_name); 8385 8386 This function is provided only on native Windows platforms. It is 8387like ‘bindtextdomain’, except that the DIR_NAME parameter is a wide 8388string (in UTF-16 encoding, as usual on Windows). 8389 8390 8391File: gettext.info, Node: Locating Catalogs, Next: Charset conversion, Prev: Ambiguities, Up: gettext 8392 839311.2.3 Locating Message Catalog Files 8394------------------------------------- 8395 8396 Because many different languages for many different packages have to 8397be stored we need some way to add these information to file message 8398catalog files. The way usually used in Unix environments is have this 8399encoding in the file name. This is also done here. The directory name 8400given in ‘bindtextdomain’s second argument (or the default directory), 8401followed by the name of the locale, the locale category, and the domain 8402name are concatenated: 8403 8404 DIR_NAME/LOCALE/LC_CATEGORY/DOMAIN_NAME.mo 8405 8406 The default value for DIR_NAME is system specific. For the GNU 8407library, and for packages adhering to its conventions, it’s: 8408 /usr/local/share/locale 8409 8410LOCALE is the name of the locale category which is designated by 8411‘LC_CATEGORY’. For ‘gettext’ and ‘dgettext’ this ‘LC_CATEGORY’ is 8412always ‘LC_MESSAGES’.(1) The name of the locale category is determined 8413through ‘setlocale (LC_CATEGORY, NULL)’. (2) When using the function 8414‘dcgettext’, you can specify the locale category through the third 8415argument. 8416 8417 ---------- Footnotes ---------- 8418 8419 (1) Some system, e.g. mingw, don’t have ‘LC_MESSAGES’. Here we use a 8420more or less arbitrary value for it, namely 1729, the smallest positive 8421integer which can be represented in two different ways as the sum of two 8422cubes. 8423 8424 (2) When the system does not support ‘setlocale’ its behavior in 8425setting the locale values is simulated by looking at the environment 8426variables. 8427 8428 8429File: gettext.info, Node: Charset conversion, Next: Contexts, Prev: Locating Catalogs, Up: gettext 8430 843111.2.4 How to specify the output character set ‘gettext’ uses 8432------------------------------------------------------------- 8433 8434 ‘gettext’ not only looks up a translation in a message catalog. It 8435also converts the translation on the fly to the desired output character 8436set. This is useful if the user is working in a different character set 8437than the translator who created the message catalog, because it avoids 8438distributing variants of message catalogs which differ only in the 8439character set. 8440 8441 The output character set is, by default, the value of ‘nl_langinfo 8442(CODESET)’, which depends on the ‘LC_CTYPE’ part of the current locale. 8443But programs which store strings in a locale independent way (e.g. 8444UTF-8) can request that ‘gettext’ and related functions return the 8445translations in that encoding, by use of the ‘bind_textdomain_codeset’ 8446function. 8447 8448 Note that the MSGID argument to ‘gettext’ is not subject to character 8449set conversion. Also, when ‘gettext’ does not find a translation for 8450MSGID, it returns MSGID unchanged – independently of the current output 8451character set. It is therefore recommended that all MSGIDs be US-ASCII 8452strings. 8453 8454 -- Function: char * bind_textdomain_codeset (const char *DOMAINNAME, 8455 const char *CODESET) 8456 The ‘bind_textdomain_codeset’ function can be used to specify the 8457 output character set for message catalogs for domain DOMAINNAME. 8458 The CODESET argument must be a valid codeset name which can be used 8459 for the ‘iconv_open’ function, or a null pointer. 8460 8461 If the CODESET parameter is the null pointer, 8462 ‘bind_textdomain_codeset’ returns the currently selected codeset 8463 for the domain with the name DOMAINNAME. It returns ‘NULL’ if no 8464 codeset has yet been selected. 8465 8466 The ‘bind_textdomain_codeset’ function can be used several times. 8467 If used multiple times with the same DOMAINNAME argument, the later 8468 call overrides the settings made by the earlier one. 8469 8470 The ‘bind_textdomain_codeset’ function returns a pointer to a 8471 string containing the name of the selected codeset. The string is 8472 allocated internally in the function and must not be changed by the 8473 user. If the system went out of core during the execution of 8474 ‘bind_textdomain_codeset’, the return value is ‘NULL’ and the 8475 global variable ERRNO is set accordingly. 8476 8477 8478File: gettext.info, Node: Contexts, Next: Plural forms, Prev: Charset conversion, Up: gettext 8479 848011.2.5 Using contexts for solving ambiguities 8481--------------------------------------------- 8482 8483 One place where the ‘gettext’ functions, if used normally, have big 8484problems is within programs with graphical user interfaces (GUIs). The 8485problem is that many of the strings which have to be translated are very 8486short. They have to appear in pull-down menus which restricts the 8487length. But strings which are not containing entire sentences or at 8488least large fragments of a sentence may appear in more than one 8489situation in the program but might have different translations. This is 8490especially true for the one-word strings which are frequently used in 8491GUI programs. 8492 8493 As a consequence many people say that the ‘gettext’ approach is wrong 8494and instead ‘catgets’ should be used which indeed does not have this 8495problem. But there is a very simple and powerful method to handle this 8496kind of problems with the ‘gettext’ functions. 8497 8498 Contexts can be added to strings to be translated. A context 8499dependent translation lookup is when a translation for a given string is 8500searched, that is limited to a given context. The translation for the 8501same string in a different context can be different. The different 8502translations of the same string in different contexts can be stored in 8503the in the same MO file, and can be edited by the translator in the same 8504PO file. 8505 8506 The ‘gettext.h’ include file contains the lookup macros for strings 8507with contexts. They are implemented as thin macros and inline functions 8508over the functions from ‘<libintl.h>’. 8509 8510 const char *pgettext (const char *msgctxt, const char *msgid); 8511 8512 In a call of this macro, MSGCTXT and MSGID must be string literals. 8513The macro returns the translation of MSGID, restricted to the context 8514given by MSGCTXT. 8515 8516 The MSGCTXT string is visible in the PO file to the translator. You 8517should try to make it somehow canonical and never changing. Because 8518every time you change an MSGCTXT, the translator will have to review the 8519translation of MSGID. 8520 8521 Finding a canonical MSGCTXT string that doesn’t change over time can 8522be hard. But you shouldn’t use the file name or class name containing 8523the ‘pgettext’ call – because it is a common development task to rename 8524a file or a class, and it shouldn’t cause translator work. Also you 8525shouldn’t use a comment in the form of a complete English sentence as 8526MSGCTXT – because orthography or grammar changes are often applied to 8527such sentences, and again, it shouldn’t force the translator to do a 8528review. 8529 8530 The ‘p’ in ‘pgettext’ stands for “particular”: ‘pgettext’ fetches a 8531particular translation of the MSGID. 8532 8533 const char *dpgettext (const char *domain_name, 8534 const char *msgctxt, const char *msgid); 8535 const char *dcpgettext (const char *domain_name, 8536 const char *msgctxt, const char *msgid, 8537 int category); 8538 8539 These are generalizations of ‘pgettext’. They behave similarly to 8540‘dgettext’ and ‘dcgettext’, respectively. The DOMAIN_NAME argument 8541defines the translation domain. The CATEGORY argument allows to use 8542another locale category than ‘LC_MESSAGES’. 8543 8544 As as example consider the following fictional situation. A GUI 8545program has a menu bar with the following entries: 8546 8547 +------------+------------+--------------------------------------+ 8548 | File | Printer | | 8549 +------------+------------+--------------------------------------+ 8550 | Open | | Select | 8551 | New | | Open | 8552 +----------+ | Connect | 8553 +----------+ 8554 8555 To have the strings ‘File’, ‘Printer’, ‘Open’, ‘New’, ‘Select’, and 8556‘Connect’ translated there has to be at some point in the code a call to 8557a function of the ‘gettext’ family. But in two places the string passed 8558into the function would be ‘Open’. The translations might not be the 8559same and therefore we are in the dilemma described above. 8560 8561 What distinguishes the two places is the menu path from the menu root 8562to the particular menu entries: 8563 8564 Menu|File 8565 Menu|Printer 8566 Menu|File|Open 8567 Menu|File|New 8568 Menu|Printer|Select 8569 Menu|Printer|Open 8570 Menu|Printer|Connect 8571 8572 The context is thus the menu path without its last part. So, the 8573calls look like this: 8574 8575 pgettext ("Menu|", "File") 8576 pgettext ("Menu|", "Printer") 8577 pgettext ("Menu|File|", "Open") 8578 pgettext ("Menu|File|", "New") 8579 pgettext ("Menu|Printer|", "Select") 8580 pgettext ("Menu|Printer|", "Open") 8581 pgettext ("Menu|Printer|", "Connect") 8582 8583 Whether or not to use the ‘|’ character at the end of the context is 8584a matter of style. 8585 8586 For more complex cases, where the MSGCTXT or MSGID are not string 8587literals, more general macros are available: 8588 8589 const char *pgettext_expr (const char *msgctxt, const char *msgid); 8590 const char *dpgettext_expr (const char *domain_name, 8591 const char *msgctxt, const char *msgid); 8592 const char *dcpgettext_expr (const char *domain_name, 8593 const char *msgctxt, const char *msgid, 8594 int category); 8595 8596 Here MSGCTXT and MSGID can be arbitrary string-valued expressions. 8597These macros are more general. But in the case that both argument 8598expressions are string literals, the macros without the ‘_expr’ suffix 8599are more efficient. 8600 8601 8602File: gettext.info, Node: Plural forms, Next: Optimized gettext, Prev: Contexts, Up: gettext 8603 860411.2.6 Additional functions for plural forms 8605-------------------------------------------- 8606 8607 The functions of the ‘gettext’ family described so far (and all the 8608‘catgets’ functions as well) have one problem in the real world which 8609have been neglected completely in all existing approaches. What is 8610meant here is the handling of plural forms. 8611 8612 Looking through Unix source code before the time anybody thought 8613about internationalization (and, sadly, even afterwards) one can often 8614find code similar to the following: 8615 8616 printf ("%d file%s deleted", n, n == 1 ? "" : "s"); 8617 8618After the first complaints from people internationalizing the code 8619people either completely avoided formulations like this or used strings 8620like ‘"file(s)"’. Both look unnatural and should be avoided. First 8621tries to solve the problem correctly looked like this: 8622 8623 if (n == 1) 8624 printf ("%d file deleted", n); 8625 else 8626 printf ("%d files deleted", n); 8627 8628 But this does not solve the problem. It helps languages where the 8629plural form of a noun is not simply constructed by adding an ‘s’ but 8630that is all. Once again people fell into the trap of believing the 8631rules their language is using are universal. But the handling of plural 8632forms differs widely between the language families. For example, Rafal 8633Maszkowski ‘<rzm@mat.uni.torun.pl>’ reports: 8634 8635 In Polish we use e.g. plik (file) this way: 8636 1 plik 8637 2,3,4 pliki 8638 5-21 pliko'w 8639 22-24 pliki 8640 25-31 pliko'w 8641 and so on (o’ means 8859-2 oacute which should be rather okreska, 8642 similar to aogonek). 8643 8644 There are two things which can differ between languages (and even 8645inside language families); 8646 8647 • The form how plural forms are built differs. This is a problem 8648 with languages which have many irregularities. German, for 8649 instance, is a drastic case. Though English and German are part of 8650 the same language family (Germanic), the almost regular forming of 8651 plural noun forms (appending an ‘s’) is hardly found in German. 8652 8653 • The number of plural forms differ. This is somewhat surprising for 8654 those who only have experiences with Romanic and Germanic languages 8655 since here the number is the same (there are two). 8656 8657 But other language families have only one form or many forms. More 8658 information on this in an extra section. 8659 8660 The consequence of this is that application writers should not try to 8661solve the problem in their code. This would be localization since it is 8662only usable for certain, hardcoded language environments. Instead the 8663extended ‘gettext’ interface should be used. 8664 8665 These extra functions are taking instead of the one key string two 8666strings and a numerical argument. The idea behind this is that using 8667the numerical argument and the first string as a key, the implementation 8668can select using rules specified by the translator the right plural 8669form. The two string arguments then will be used to provide a return 8670value in case no message catalog is found (similar to the normal 8671‘gettext’ behavior). In this case the rules for Germanic language is 8672used and it is assumed that the first string argument is the singular 8673form, the second the plural form. 8674 8675 This has the consequence that programs without language catalogs can 8676display the correct strings only if the program itself is written using 8677a Germanic language. This is a limitation but since the GNU C library 8678(as well as the GNU ‘gettext’ package) are written as part of the GNU 8679package and the coding standards for the GNU project require program 8680being written in English, this solution nevertheless fulfills its 8681purpose. 8682 8683 -- Function: char * ngettext (const char *MSGID1, const char *MSGID2, 8684 unsigned long int N) 8685 The ‘ngettext’ function is similar to the ‘gettext’ function as it 8686 finds the message catalogs in the same way. But it takes two extra 8687 arguments. The MSGID1 parameter must contain the singular form of 8688 the string to be converted. It is also used as the key for the 8689 search in the catalog. The MSGID2 parameter is the plural form. 8690 The parameter N is used to determine the plural form. If no 8691 message catalog is found MSGID1 is returned if ‘n == 1’, otherwise 8692 ‘msgid2’. 8693 8694 An example for the use of this function is: 8695 8696 printf (ngettext ("%d file removed", "%d files removed", n), n); 8697 8698 Please note that the numeric value N has to be passed to the 8699 ‘printf’ function as well. It is not sufficient to pass it only to 8700 ‘ngettext’. 8701 8702 In the English singular case, the number – always 1 – can be 8703 replaced with "one": 8704 8705 printf (ngettext ("One file removed", "%d files removed", n), n); 8706 8707 This works because the ‘printf’ function discards excess arguments 8708 that are not consumed by the format string. 8709 8710 If this function is meant to yield a format string that takes two 8711 or more arguments, you can not use it like this: 8712 8713 printf (ngettext ("%d file removed from directory %s", 8714 "%d files removed from directory %s", 8715 n), 8716 n, dir); 8717 8718 because in many languages the translators want to replace the ‘%d’ 8719 with an explicit word in the singular case, just like “one” in 8720 English, and C format strings cannot consume the second argument 8721 but skip the first argument. Instead, you have to reorder the 8722 arguments so that ‘n’ comes last: 8723 8724 printf (ngettext ("%2$d file removed from directory %1$s", 8725 "%2$d files removed from directory %1$s", 8726 n), 8727 dir, n); 8728 8729 See *note c-format:: for details about this argument reordering 8730 syntax. 8731 8732 When you know that the value of ‘n’ is within a given range, you 8733 can specify it as a comment directed to the ‘xgettext’ tool. This 8734 information may help translators to use more adequate translations. 8735 Like this: 8736 8737 if (days > 7 && days < 14) 8738 /* xgettext: range: 1..6 */ 8739 printf (ngettext ("one week and one day", "one week and %d days", 8740 days - 7), 8741 days - 7); 8742 8743 It is also possible to use this function when the strings don’t 8744 contain a cardinal number: 8745 8746 puts (ngettext ("Delete the selected file?", 8747 "Delete the selected files?", 8748 n)); 8749 8750 In this case the number N is only used to choose the plural form. 8751 8752 -- Function: char * dngettext (const char *DOMAIN, const char *MSGID1, 8753 const char *MSGID2, unsigned long int N) 8754 The ‘dngettext’ is similar to the ‘dgettext’ function in the way 8755 the message catalog is selected. The difference is that it takes 8756 two extra parameter to provide the correct plural form. These two 8757 parameters are handled in the same way ‘ngettext’ handles them. 8758 8759 -- Function: char * dcngettext (const char *DOMAIN, const char *MSGID1, 8760 const char *MSGID2, unsigned long int N, int CATEGORY) 8761 The ‘dcngettext’ is similar to the ‘dcgettext’ function in the way 8762 the message catalog is selected. The difference is that it takes 8763 two extra parameter to provide the correct plural form. These two 8764 parameters are handled in the same way ‘ngettext’ handles them. 8765 8766 Now, how do these functions solve the problem of the plural forms? 8767Without the input of linguists (which was not available) it was not 8768possible to determine whether there are only a few different forms in 8769which plural forms are formed or whether the number can increase with 8770every new supported language. 8771 8772 Therefore the solution implemented is to allow the translator to 8773specify the rules of how to select the plural form. Since the formula 8774varies with every language this is the only viable solution except for 8775hardcoding the information in the code (which still would require the 8776possibility of extensions to not prevent the use of new languages). 8777 8778 The information about the plural form selection has to be stored in 8779the header entry of the PO file (the one with the empty ‘msgid’ string). 8780The plural form information looks like this: 8781 8782 Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1; 8783 8784 The ‘nplurals’ value must be a decimal number which specifies how 8785many different plural forms exist for this language. The string 8786following ‘plural’ is an expression which is using the C language 8787syntax. Exceptions are that no negative numbers are allowed, numbers 8788must be decimal, and the only variable allowed is ‘n’. Spaces are 8789allowed in the expression, but backslash-newlines are not; in the 8790examples below the backslash-newlines are present for formatting 8791purposes only. This expression will be evaluated whenever one of the 8792functions ‘ngettext’, ‘dngettext’, or ‘dcngettext’ is called. The 8793numeric value passed to these functions is then substituted for all uses 8794of the variable ‘n’ in the expression. The resulting value then must be 8795greater or equal to zero and smaller than the value given as the value 8796of ‘nplurals’. 8797 8798The following rules are known at this point. The language with families 8799are listed. But this does not necessarily mean the information can be 8800generalized for the whole family (as can be easily seen in the table 8801below).(1) 8802 8803Only one form: 8804 Some languages only require one single form. There is no 8805 distinction between the singular and plural form. An appropriate 8806 header entry would look like this: 8807 8808 Plural-Forms: nplurals=1; plural=0; 8809 8810 Languages with this property include: 8811 8812 Asian family 8813 Japanese, Vietnamese, Korean 8814 Tai-Kadai family 8815 Thai 8816 8817Two forms, singular used for one only 8818 This is the form used in most existing programs since it is what 8819 English is using. A header entry would look like this: 8820 8821 Plural-Forms: nplurals=2; plural=n != 1; 8822 8823 (Note: this uses the feature of C expressions that boolean 8824 expressions have to value zero or one.) 8825 8826 Languages with this property include: 8827 8828 Germanic family 8829 English, German, Dutch, Swedish, Danish, Norwegian, Faroese 8830 Romanic family 8831 Spanish, Portuguese, Italian 8832 Latin/Greek family 8833 Greek 8834 Slavic family 8835 Bulgarian 8836 Finno-Ugric family 8837 Finnish, Estonian 8838 Semitic family 8839 Hebrew 8840 Austronesian family 8841 Bahasa Indonesian 8842 Artificial 8843 Esperanto 8844 8845 Other languages using the same header entry are: 8846 8847 Finno-Ugric family 8848 Hungarian 8849 Turkic/Altaic family 8850 Turkish 8851 8852 Hungarian does not appear to have a plural if you look at sentences 8853 involving cardinal numbers. For example, “1 apple” is “1 alma”, 8854 and “123 apples” is “123 alma”. But when the number is not 8855 explicit, the distinction between singular and plural exists: “the 8856 apple” is “az alma”, and “the apples” is “az almák”. Since 8857 ‘ngettext’ has to support both types of sentences, it is classified 8858 here, under “two forms”. 8859 8860 The same holds for Turkish: “1 apple” is “1 elma”, and “123 apples” 8861 is “123 elma”. But when the number is omitted, the distinction 8862 between singular and plural exists: “the apple” is “elma”, and “the 8863 apples” is “elmalar”. 8864 8865Two forms, singular used for zero and one 8866 Exceptional case in the language family. The header entry would 8867 be: 8868 8869 Plural-Forms: nplurals=2; plural=n>1; 8870 8871 Languages with this property include: 8872 8873 Romanic family 8874 Brazilian Portuguese, French 8875 8876Three forms, special case for zero 8877 The header entry would be: 8878 8879 Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2; 8880 8881 Languages with this property include: 8882 8883 Baltic family 8884 Latvian 8885 8886Three forms, special cases for one and two 8887 The header entry would be: 8888 8889 Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2; 8890 8891 Languages with this property include: 8892 8893 Celtic 8894 Gaeilge (Irish) 8895 8896Three forms, special case for numbers ending in 00 or [2-9][0-9] 8897 The header entry would be: 8898 8899 Plural-Forms: nplurals=3; \ 8900 plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2; 8901 8902 Languages with this property include: 8903 8904 Romanic family 8905 Romanian 8906 8907Three forms, special case for numbers ending in 1[2-9] 8908 The header entry would look like this: 8909 8910 Plural-Forms: nplurals=3; \ 8911 plural=n%10==1 && n%100!=11 ? 0 : \ 8912 n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2; 8913 8914 Languages with this property include: 8915 8916 Baltic family 8917 Lithuanian 8918 8919Three forms, special cases for numbers ending in 1 and 2, 3, 4, except those ending in 1[1-4] 8920 The header entry would look like this: 8921 8922 Plural-Forms: nplurals=3; \ 8923 plural=n%10==1 && n%100!=11 ? 0 : \ 8924 n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2; 8925 8926 Languages with this property include: 8927 8928 Slavic family 8929 Russian, Ukrainian, Belarusian, Serbian, Croatian 8930 8931Three forms, special cases for 1 and 2, 3, 4 8932 The header entry would look like this: 8933 8934 Plural-Forms: nplurals=3; \ 8935 plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2; 8936 8937 Languages with this property include: 8938 8939 Slavic family 8940 Czech, Slovak 8941 8942Three forms, special case for one and some numbers ending in 2, 3, or 4 8943 The header entry would look like this: 8944 8945 Plural-Forms: nplurals=3; \ 8946 plural=n==1 ? 0 : \ 8947 n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2; 8948 8949 Languages with this property include: 8950 8951 Slavic family 8952 Polish 8953 8954Four forms, special case for one and all numbers ending in 02, 03, or 04 8955 The header entry would look like this: 8956 8957 Plural-Forms: nplurals=4; \ 8958 plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3; 8959 8960 Languages with this property include: 8961 8962 Slavic family 8963 Slovenian 8964 8965Six forms, special cases for one, two, all numbers ending in 02, 03, ... 10, all numbers ending in 11 ... 99, and others 8966 The header entry would look like this: 8967 8968 Plural-Forms: nplurals=6; \ 8969 plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 \ 8970 : n%100>=11 ? 4 : 5; 8971 8972 Languages with this property include: 8973 8974 Afroasiatic family 8975 Arabic 8976 8977 You might now ask, ‘ngettext’ handles only numbers N of type 8978‘unsigned long’. What about larger integer types? What about negative 8979numbers? What about floating-point numbers? 8980 8981 About larger integer types, such as ‘uintmax_t’ or ‘unsigned long 8982long’: they can be handled by reducing the value to a range that fits in 8983an ‘unsigned long’. Simply casting the value to ‘unsigned long’ would 8984not do the right thing, since it would treat ‘ULONG_MAX + 1’ like zero, 8985‘ULONG_MAX + 2’ like singular, and the like. Here you can exploit the 8986fact that all mentioned plural form formulas eventually become periodic, 8987with a period that is a divisor of 100 (or 1000 or 1000000). So, when 8988you reduce a large value to another one in the range [1000000, 1999999] 8989that ends in the same 6 decimal digits, you can assume that it will lead 8990to the same plural form selection. This code does this: 8991 8992 #include <inttypes.h> 8993 uintmax_t nbytes = ...; 8994 printf (ngettext ("The file has %"PRIuMAX" byte.", 8995 "The file has %"PRIuMAX" bytes.", 8996 (nbytes > ULONG_MAX 8997 ? (nbytes % 1000000) + 1000000 8998 : nbytes)), 8999 nbytes); 9000 9001 Negative and floating-point values usually represent physical 9002entities for which singular and plural don’t clearly apply. In such 9003cases, there is no need to use ‘ngettext’; a simple ‘gettext’ call with 9004a form suitable for all values will do. For example: 9005 9006 printf (gettext ("Time elapsed: %.3f seconds"), 9007 num_milliseconds * 0.001); 9008 9009Even if NUM_MILLISECONDS happens to be a multiple of 1000, the output 9010 Time elapsed: 1.000 seconds 9011is acceptable in English, and similarly for other languages. 9012 9013 The translators’ perspective regarding plural forms is explained in 9014*note Translating plural forms::. 9015 9016 ---------- Footnotes ---------- 9017 9018 (1) Additions are welcome. Send appropriate information to 9019<bug-gettext@gnu.org> and <bug-glibc-manual@gnu.org>. The Unicode CLDR 9020Project (<http://cldr.unicode.org>) provides a comprehensive set of 9021plural forms in a different format. The ‘msginit’ program has 9022preliminary support for the format so you can use it as a baseline 9023(*note msginit Invocation::). 9024 9025 9026File: gettext.info, Node: Optimized gettext, Prev: Plural forms, Up: gettext 9027 902811.2.7 Optimization of the *gettext functions 9029--------------------------------------------- 9030 9031 At this point of the discussion we should talk about an advantage of 9032the GNU ‘gettext’ implementation. Some readers might have pointed out 9033that an internationalized program might have a poor performance if some 9034string has to be translated in an inner loop. While this is unavoidable 9035when the string varies from one run of the loop to the other it is 9036simply a waste of time when the string is always the same. Take the 9037following example: 9038 9039 { 9040 while (...) 9041 { 9042 puts (gettext ("Hello world")); 9043 } 9044 } 9045 9046When the locale selection does not change between two runs the resulting 9047string is always the same. One way to use this is: 9048 9049 { 9050 str = gettext ("Hello world"); 9051 while (...) 9052 { 9053 puts (str); 9054 } 9055 } 9056 9057But this solution is not usable in all situation (e.g. when the locale 9058selection changes) nor does it lead to legible code. 9059 9060 For this reason, GNU ‘gettext’ caches previous translation results. 9061When the same translation is requested twice, with no new message 9062catalogs being loaded in between, ‘gettext’ will, the second time, find 9063the result through a single cache lookup. 9064 9065 9066File: gettext.info, Node: Comparison, Next: Using libintl.a, Prev: gettext, Up: Programmers 9067 906811.3 Comparing the Two Interfaces 9069================================= 9070 9071 The following discussion is perhaps a little bit colored. As said 9072above we implemented GNU ‘gettext’ following the Uniforum proposal and 9073this surely has its reasons. But it should show how we came to this 9074decision. 9075 9076 First we take a look at the developing process. When we write an 9077application using NLS provided by ‘gettext’ we proceed as always. Only 9078when we come to a string which might be seen by the users and thus has 9079to be translated we use ‘gettext("...")’ instead of ‘"..."’. At the 9080beginning of each source file (or in a central header file) we define 9081 9082 #define gettext(String) (String) 9083 9084 Even this definition can be avoided when the system supports the 9085‘gettext’ function in its C library. When we compile this code the 9086result is the same as if no NLS code is used. When you take a look at 9087the GNU ‘gettext’ code you will see that we use ‘_("...")’ instead of 9088‘gettext("...")’. This reduces the number of additional characters per 9089translatable string to _3_ (in words: three). 9090 9091 When now a production version of the program is needed we simply 9092replace the definition 9093 9094 #define _(String) (String) 9095 9096by 9097 9098 #include <libintl.h> 9099 #define _(String) gettext (String) 9100 9101Additionally we run the program ‘xgettext’ on all source code file which 9102contain translatable strings and that’s it: we have a running program 9103which does not depend on translations to be available, but which can use 9104any that becomes available. 9105 9106 The same procedure can be done for the ‘gettext_noop’ invocations 9107(*note Special cases::). One usually defines ‘gettext_noop’ as a no-op 9108macro. So you should consider the following code for your project: 9109 9110 #define gettext_noop(String) String 9111 #define N_(String) gettext_noop (String) 9112 9113 ‘N_’ is a short form similar to ‘_’. The ‘Makefile’ in the ‘po/’ 9114directory of GNU ‘gettext’ knows by default both of the mentioned short 9115forms so you are invited to follow this proposal for your own ease. 9116 9117 Now to ‘catgets’. The main problem is the work for the programmer. 9118Every time he comes to a translatable string he has to define a number 9119(or a symbolic constant) which has also be defined in the message 9120catalog file. He also has to take care for duplicate entries, duplicate 9121message IDs etc. If he wants to have the same quality in the message 9122catalog as the GNU ‘gettext’ program provides he also has to put the 9123descriptive comments for the strings and the location in all source code 9124files in the message catalog. This is nearly a Mission: Impossible. 9125 9126 But there are also some points people might call advantages speaking 9127for ‘catgets’. If you have a single word in a string and this string is 9128used in different contexts it is likely that in one or the other 9129language the word has different translations. Example: 9130 9131 printf ("%s: %d", gettext ("number"), number_of_errors) 9132 9133 printf ("you should see %d %s", number_count, 9134 number_count == 1 ? gettext ("number") : gettext ("numbers")) 9135 9136 Here we have to translate two times the string ‘"number"’. Even if 9137you do not speak a language beside English it might be possible to 9138recognize that the two words have a different meaning. In German the 9139first appearance has to be translated to ‘"Anzahl"’ and the second to 9140‘"Zahl"’. 9141 9142 Now you can say that this example is really esoteric. And you are 9143right! This is exactly how we felt about this problem and decide that 9144it does not weight that much. The solution for the above problem could 9145be very easy: 9146 9147 printf ("%s %d", gettext ("number:"), number_of_errors) 9148 9149 printf (number_count == 1 ? gettext ("you should see %d number") 9150 : gettext ("you should see %d numbers"), 9151 number_count) 9152 9153 We believe that we can solve all conflicts with this method. If it 9154is difficult one can also consider changing one of the conflicting 9155string a little bit. But it is not impossible to overcome. 9156 9157 ‘catgets’ allows same original entry to have different translations, 9158but ‘gettext’ has another, scalable approach for solving ambiguities of 9159this kind: *Note Ambiguities::. 9160 9161 9162File: gettext.info, Node: Using libintl.a, Next: gettext grok, Prev: Comparison, Up: Programmers 9163 916411.4 Using libintl.a in own programs 9165==================================== 9166 9167 Starting with version 0.9.4 the library ‘libintl.h’ should be 9168self-contained. I.e., you can use it in your own programs without 9169providing additional functions. The ‘Makefile’ will put the header and 9170the library in directories selected using the ‘$(prefix)’. 9171 9172 9173File: gettext.info, Node: gettext grok, Next: Temp Programmers, Prev: Using libintl.a, Up: Programmers 9174 917511.5 Being a ‘gettext’ grok 9176=========================== 9177 9178 * NOTE: * This documentation section is outdated and needs to be 9179revised. 9180 9181 To fully exploit the functionality of the GNU ‘gettext’ library it is 9182surely helpful to read the source code. But for those who don’t want to 9183spend that much time in reading the (sometimes complicated) code here is 9184a list comments: 9185 9186 • Changing the language at runtime 9187 9188 For interactive programs it might be useful to offer a selection of 9189 the used language at runtime. To understand how to do this one 9190 need to know how the used language is determined while executing 9191 the ‘gettext’ function. The method which is presented here only 9192 works correctly with the GNU implementation of the ‘gettext’ 9193 functions. 9194 9195 In the function ‘dcgettext’ at every call the current setting of 9196 the highest priority environment variable is determined and used. 9197 Highest priority means here the following list with decreasing 9198 priority: 9199 9200 1. ‘LANGUAGE’ 9201 2. ‘LC_ALL’ 9202 3. ‘LC_xxx’, according to selected locale category 9203 4. ‘LANG’ 9204 9205 Afterwards the path is constructed using the found value and the 9206 translation file is loaded if available. 9207 9208 What happens now when the value for, say, ‘LANGUAGE’ changes? 9209 According to the process explained above the new value of this 9210 variable is found as soon as the ‘dcgettext’ function is called. 9211 But this also means the (perhaps) different message catalog file is 9212 loaded. In other words: the used language is changed. 9213 9214 But there is one little hook. The code for gcc-2.7.0 and up 9215 provides some optimization. This optimization normally prevents 9216 the calling of the ‘dcgettext’ function as long as no new catalog 9217 is loaded. But if ‘dcgettext’ is not called the program also 9218 cannot find the ‘LANGUAGE’ variable be changed (*note Optimized 9219 gettext::). A solution for this is very easy. Include the 9220 following code in the language switching function. 9221 9222 /* Change language. */ 9223 setenv ("LANGUAGE", "fr", 1); 9224 9225 /* Make change known. */ 9226 { 9227 extern int _nl_msg_cat_cntr; 9228 ++_nl_msg_cat_cntr; 9229 } 9230 9231 The variable ‘_nl_msg_cat_cntr’ is defined in ‘loadmsgcat.c’. You 9232 don’t need to know what this is for. But it can be used to detect 9233 whether a ‘gettext’ implementation is GNU gettext and not non-GNU 9234 system’s native gettext implementation. 9235 9236 9237File: gettext.info, Node: Temp Programmers, Prev: gettext grok, Up: Programmers 9238 923911.6 Temporary Notes for the Programmers Chapter 9240================================================ 9241 9242 * NOTE: * This documentation section is outdated and needs to be 9243revised. 9244 9245* Menu: 9246 9247* Temp Implementations:: Temporary - Two Possible Implementations 9248* Temp catgets:: Temporary - About ‘catgets’ 9249* Temp WSI:: Temporary - Why a single implementation 9250* Temp Notes:: Temporary - Notes 9251 9252 9253File: gettext.info, Node: Temp Implementations, Next: Temp catgets, Up: Temp Programmers 9254 925511.6.1 Temporary - Two Possible Implementations 9256----------------------------------------------- 9257 9258 There are two competing methods for language independent messages: 9259the X/Open ‘catgets’ method, and the Uniforum ‘gettext’ method. The 9260‘catgets’ method indexes messages by integers; the ‘gettext’ method 9261indexes them by their English translations. The ‘catgets’ method has 9262been around longer and is supported by more vendors. The ‘gettext’ 9263method is supported by Sun, and it has been heard that the COSE 9264multi-vendor initiative is supporting it. Neither method is a POSIX 9265standard; the POSIX.1 committee had a lot of disagreement in this area. 9266 9267 Neither one is in the POSIX standard. There was much disagreement in 9268the POSIX.1 committee about using the ‘gettext’ routines vs. ‘catgets’ 9269(XPG). In the end the committee couldn’t agree on anything, so no 9270messaging system was included as part of the standard. I believe the 9271informative annex of the standard includes the XPG3 messaging 9272interfaces, “...as an example of a messaging system that has been 9273implemented...” 9274 9275 They were very careful not to say anywhere that you should use one 9276set of interfaces over the other. For more on this topic please see the 9277Programming for Internationalization FAQ. 9278 9279 9280File: gettext.info, Node: Temp catgets, Next: Temp WSI, Prev: Temp Implementations, Up: Temp Programmers 9281 928211.6.2 Temporary - About ‘catgets’ 9283---------------------------------- 9284 9285 There have been a few discussions of late on the use of ‘catgets’ as 9286a base. I think it important to present both sides of the argument and 9287hence am opting to play devil’s advocate for a little bit. 9288 9289 I’ll not deny the fact that ‘catgets’ could have been designed a lot 9290better. It currently has quite a number of limitations and these have 9291already been pointed out. 9292 9293 However there is a great deal to be said for consistency and 9294standardization. A common recurring problem when writing Unix software 9295is the myriad portability problems across Unix platforms. It seems as 9296if every Unix vendor had a look at the operating system and found parts 9297they could improve upon. Undoubtedly, these modifications are probably 9298innovative and solve real problems. However, software developers have a 9299hard time keeping up with all these changes across so many platforms. 9300 9301 And this has prompted the Unix vendors to begin to standardize their 9302systems. Hence the impetus for Spec1170. Every major Unix vendor has 9303committed to supporting this standard and every Unix software developer 9304waits with glee the day they can write software to this standard and 9305simply recompile (without having to use autoconf) across different 9306platforms. 9307 9308 As I understand it, Spec1170 is roughly based upon version 4 of the 9309X/Open Portability Guidelines (XPG4). Because ‘catgets’ and friends are 9310defined in XPG4, I’m led to believe that ‘catgets’ is a part of Spec1170 9311and hence will become a standardized component of all Unix systems. 9312 9313 9314File: gettext.info, Node: Temp WSI, Next: Temp Notes, Prev: Temp catgets, Up: Temp Programmers 9315 931611.6.3 Temporary - Why a single implementation 9317---------------------------------------------- 9318 9319 Now it seems kind of wasteful to me to have two different systems 9320installed for accessing message catalogs. If we do want to remedy 9321‘catgets’ deficiencies why don’t we try to expand ‘catgets’ (in a 9322compatible manner) rather than implement an entirely new system. 9323Otherwise, we’ll end up with two message catalog access systems 9324installed with an operating system - one set of routines for packages 9325using GNU ‘gettext’ for their internationalization, and another set of 9326routines (catgets) for all other software. Bloated? 9327 9328 Supposing another catalog access system is implemented. Which do we 9329recommend? At least for Linux, we need to attract as many software 9330developers as possible. Hence we need to make it as easy for them to 9331port their software as possible. Which means supporting ‘catgets’. We 9332will be implementing the ‘libintl’ code within our ‘libc’, but does this 9333mean we also have to incorporate another message catalog access scheme 9334within our ‘libc’ as well? And what about people who are going to be 9335using the ‘libintl’ + non-‘catgets’ routines. When they port their 9336software to other platforms, they’re now going to have to include the 9337front-end (‘libintl’) code plus the back-end code (the non-‘catgets’ 9338access routines) with their software instead of just including the 9339‘libintl’ code with their software. 9340 9341 Message catalog support is however only the tip of the iceberg. What 9342about the data for the other locale categories? They also have a number 9343of deficiencies. Are we going to abandon them as well and develop 9344another duplicate set of routines (should ‘libintl’ expand beyond 9345message catalog support)? 9346 9347 Like many parts of Unix that can be improved upon, we’re stuck with 9348balancing compatibility with the past with useful improvements and 9349innovations for the future. 9350 9351 9352File: gettext.info, Node: Temp Notes, Prev: Temp WSI, Up: Temp Programmers 9353 935411.6.4 Temporary - Notes 9355------------------------ 9356 9357 X/Open agreed very late on the standard form so that many 9358implementations differ from the final form. Both of my system (old 9359Linux catgets and Ultrix-4) have a strange variation. 9360 9361 OK. After incorporating the last changes I have to spend some time on 9362making the GNU/Linux ‘libc’ ‘gettext’ functions. So in future Solaris 9363is not the only system having ‘gettext’. 9364 9365 9366File: gettext.info, Node: Translators, Next: Maintainers, Prev: Programmers, Up: Top 9367 936812 The Translator’s View 9369************************ 9370 9371* Menu: 9372 9373* Trans Intro 0:: Introduction 0 9374* Trans Intro 1:: Introduction 1 9375* Discussions:: Discussions 9376* Organization:: Organization 9377* Information Flow:: Information Flow 9378* Translating plural forms:: How to fill in ‘msgstr[0]’, ‘msgstr[1]’ 9379* Prioritizing messages:: How to find which messages to translate first 9380 9381 9382File: gettext.info, Node: Trans Intro 0, Next: Trans Intro 1, Up: Translators 9383 938412.1 Introduction 0 9385=================== 9386 9387 * NOTE: * This documentation section is outdated and needs to be 9388revised. 9389 9390 Free software is going international! The Translation Project is a 9391way to get maintainers, translators and users all together, so free 9392software will gradually become able to speak many native languages. 9393 9394 The GNU ‘gettext’ tool set contains _everything_ maintainers need for 9395internationalizing their packages for messages. It also contains quite 9396useful tools for helping translators at localizing messages to their 9397native language, once a package has already been internationalized. 9398 9399 To achieve the Translation Project, we need many interested people 9400who like their own language and write it well, and who are also able to 9401synergize with other translators speaking the same language. If you’d 9402like to volunteer to _work_ at translating messages, please send mail to 9403your translating team. 9404 9405 Each team has its own mailing list, courtesy of Linux International. 9406You may reach your translating team at the address ‘LL@li.org’, 9407replacing LL by the two-letter ISO 639 code for your language. Language 9408codes are _not_ the same as country codes given in ISO 3166. The 9409following translating teams exist: 9410 9411 Chinese ‘zh’, Czech ‘cs’, Danish ‘da’, Dutch ‘nl’, Esperanto ‘eo’, 9412 Finnish ‘fi’, French ‘fr’, Irish ‘ga’, German ‘de’, Greek ‘el’, 9413 Italian ‘it’, Japanese ‘ja’, Indonesian ‘in’, Norwegian ‘no’, 9414 Polish ‘pl’, Portuguese ‘pt’, Russian ‘ru’, Spanish ‘es’, Swedish 9415 ‘sv’ and Turkish ‘tr’. 9416 9417For example, you may reach the Chinese translating team by writing to 9418‘zh@li.org’. When you become a member of the translating team for your 9419own language, you may subscribe to its list. For example, Swedish 9420people can send a message to ‘sv-request@li.org’, having this message 9421body: 9422 9423 subscribe 9424 9425 Keep in mind that team members should be interested in _working_ at 9426translations, or at solving translational difficulties, rather than 9427merely lurking around. If your team does not exist yet and you want to 9428start one, please write to ‘coordinator@translationproject.org’; you 9429will then reach the coordinator for all translator teams. 9430 9431 A handful of GNU packages have already been adapted and provided with 9432message translations for several languages. Translation teams have 9433begun to organize, using these packages as a starting point. But there 9434are many more packages and many languages for which we have no volunteer 9435translators. If you would like to volunteer to work at translating 9436messages, please send mail to ‘coordinator@translationproject.org’ 9437indicating what language(s) you can work on. 9438 9439 9440File: gettext.info, Node: Trans Intro 1, Next: Discussions, Prev: Trans Intro 0, Up: Translators 9441 944212.2 Introduction 1 9443=================== 9444 9445 * NOTE: * This documentation section is outdated and needs to be 9446revised. 9447 9448 This is now official, GNU is going international! Here is the 9449announcement submitted for the January 1995 GNU Bulletin: 9450 9451 A handful of GNU packages have already been adapted and provided 9452 with message translations for several languages. Translation teams 9453 have begun to organize, using these packages as a starting point. 9454 But there are many more packages and many languages for which we 9455 have no volunteer translators. If you’d like to volunteer to work 9456 at translating messages, please send mail to 9457 ‘coordinator@translationproject.org’ indicating what language(s) 9458 you can work on. 9459 9460 This document should answer many questions for those who are curious 9461about the process or would like to contribute. Please at least skim 9462over it, hoping to cut down a little of the high volume of e-mail 9463generated by this collective effort towards internationalization of free 9464software. 9465 9466 Most free programming which is widely shared is done in English, and 9467currently, English is used as the main communicating language between 9468national communities collaborating to free software. This very document 9469is written in English. This will not change in the foreseeable future. 9470 9471 However, there is a strong appetite from national communities for 9472having more software able to write using national language and habits, 9473and there is an on-going effort to modify free software in such a way 9474that it becomes able to do so. The experiments driven so far raised an 9475enthusiastic response from pretesters, so we believe that 9476internationalization of free software is dedicated to succeed. 9477 9478 For suggestion clarifications, additions or corrections to this 9479document, please e-mail to ‘coordinator@translationproject.org’. 9480 9481 9482File: gettext.info, Node: Discussions, Next: Organization, Prev: Trans Intro 1, Up: Translators 9483 948412.3 Discussions 9485================ 9486 9487 * NOTE: * This documentation section is outdated and needs to be 9488revised. 9489 9490 Facing this internationalization effort, a few users expressed their 9491concerns. Some of these doubts are presented and discussed, here. 9492 9493 • Smaller groups 9494 9495 Some languages are not spoken by a very large number of people, so 9496 people speaking them sometimes consider that there may not be all 9497 that much demand such versions of free software packages. 9498 Moreover, many people being _into computers_, in some countries, 9499 generally seem to prefer English versions of their software. 9500 9501 On the other end, people might enjoy their own language a lot, and 9502 be very motivated at providing to themselves the pleasure of having 9503 their beloved free software speaking their mother tongue. They do 9504 themselves a personal favor, and do not pay that much attention to 9505 the number of people benefiting of their work. 9506 9507 • Misinterpretation 9508 9509 Other users are shy to push forward their own language, seeing in 9510 this some kind of misplaced propaganda. Someone thought there must 9511 be some users of the language over the networks pestering other 9512 people with it. 9513 9514 But any spoken language is worth localization, because there are 9515 people behind the language for whom the language is important and 9516 dear to their hearts. 9517 9518 • Odd translations 9519 9520 The biggest problem is to find the right translations so that 9521 everybody can understand the messages. Translations are usually a 9522 little odd. Some people get used to English, to the extent they 9523 may find translations into their own language “rather pushy, 9524 obnoxious and sometimes even hilarious.” As a French speaking man, 9525 I have the experience of those instruction manuals for goods, so 9526 poorly translated in French in Korea or Taiwan... 9527 9528 The fact is that we sometimes have to create a kind of national 9529 computer culture, and this is not easy without the collaboration of 9530 many people liking their mother tongue. This is why translations 9531 are better achieved by people knowing and loving their own 9532 language, and ready to work together at improving the results they 9533 obtain. 9534 9535 • Dependencies over the GPL or LGPL 9536 9537 Some people wonder if using GNU ‘gettext’ necessarily brings their 9538 package under the protective wing of the GNU General Public License 9539 or the GNU Lesser General Public License, when they do not want to 9540 make their program free, or want other kinds of freedom. The 9541 simplest answer is “normally not”. 9542 9543 The ‘gettext-runtime’ part of GNU ‘gettext’, i.e. the contents of 9544 ‘libintl’, is covered by the GNU Lesser General Public License. 9545 The ‘gettext-tools’ part of GNU ‘gettext’, i.e. the rest of the GNU 9546 ‘gettext’ package, is covered by the GNU General Public License. 9547 9548 The mere marking of localizable strings in a package, or 9549 conditional inclusion of a few lines for initialization, is not 9550 really including GPL’ed or LGPL’ed code. However, since the 9551 localization routines in ‘libintl’ are under the LGPL, the LGPL 9552 needs to be considered. It gives the right to distribute the 9553 complete unmodified source of ‘libintl’ even with non-free 9554 programs. It also gives the right to use ‘libintl’ as a shared 9555 library, even for non-free programs. But it gives the right to use 9556 ‘libintl’ as a static library or to incorporate ‘libintl’ into 9557 another library only to free software. 9558 9559 9560File: gettext.info, Node: Organization, Next: Information Flow, Prev: Discussions, Up: Translators 9561 956212.4 Organization 9563================= 9564 9565 * NOTE: * This documentation section is outdated and needs to be 9566revised. 9567 9568 On a larger scale, the true solution would be to organize some kind 9569of fairly precise set up in which volunteers could participate. I gave 9570some thought to this idea lately, and realize there will be some touchy 9571points. I thought of writing to Richard Stallman to launch such a 9572project, but feel it might be good to shake out the ideas between 9573ourselves first. Most probably that Linux International has some 9574experience in the field already, or would like to orchestrate the 9575volunteer work, maybe. Food for thought, in any case! 9576 9577 I guess we have to setup something early, somehow, that will help 9578many possible contributors of the same language to interlock and avoid 9579work duplication, and further be put in contact for solving together 9580problems particular to their tongue (in most languages, there are many 9581difficulties peculiar to translating technical English). My Swedish 9582contributor acknowledged these difficulties, and I’m well aware of them 9583for French. 9584 9585 This is surely not a technical issue, but we should manage so the 9586effort of locale contributors be maximally useful, despite the national 9587team layer interface between contributors and maintainers. 9588 9589 The Translation Project needs some setup for coordinating language 9590coordinators. Localizing evolving programs will surely become a 9591permanent and continuous activity in the free software community, once 9592well started. The setup should be minimally completed and tested before 9593GNU ‘gettext’ becomes an official reality. The e-mail address 9594‘coordinator@translationproject.org’ has been set up for receiving 9595offers from volunteers and general e-mail on these topics. This address 9596reaches the Translation Project coordinator. 9597 9598* Menu: 9599 9600* Central Coordination:: Central Coordination 9601* National Teams:: National Teams 9602* Mailing Lists:: Mailing Lists 9603 9604 9605File: gettext.info, Node: Central Coordination, Next: National Teams, Up: Organization 9606 960712.4.1 Central Coordination 9608--------------------------- 9609 9610 I also think GNU will need sooner than it thinks, that someone set up 9611a way to organize and coordinate these groups. Some kind of group of 9612groups. My opinion is that it would be good that GNU delegates this 9613task to a small group of collaborating volunteers, shortly. Perhaps in 9614‘gnu.announce’ a list of this national committee’s can be published. 9615 9616 My role as coordinator would simply be to refer to Ulrich any German 9617speaking volunteer interested to localization of free software packages, 9618and maybe helping national groups to initially organize, while 9619maintaining national registries for until national groups are ready to 9620take over. In fact, the coordinator should ease volunteers to get in 9621contact with one another for creating national teams, which should then 9622select one coordinator per language, or country (regionalized language). 9623If well done, the coordination should be useful without being an 9624overwhelming task, the time to put delegations in place. 9625 9626 9627File: gettext.info, Node: National Teams, Next: Mailing Lists, Prev: Central Coordination, Up: Organization 9628 962912.4.2 National Teams 9630--------------------- 9631 9632 I suggest we look for volunteer coordinators/editors for individual 9633languages. These people will scan contributions of translation files 9634for various programs, for their own languages, and will ensure high and 9635uniform standards of diction. 9636 9637 From my current experience with other people in these days, those who 9638provide localizations are very enthusiastic about the process, and are 9639more interested in the localization process than in the program they 9640localize, and want to do many programs, not just one. This seems to 9641confirm that having a coordinator/editor for each language is a good 9642idea. 9643 9644 We need to choose someone who is good at writing clear and concise 9645prose in the language in question. That is hard—we can’t check it 9646ourselves. So we need to ask a few people to judge each others’ writing 9647and select the one who is best. 9648 9649 I announce my prerelease to a few dozen people, and you would not 9650believe all the discussions it generated already. I shudder to think 9651what will happen when this will be launched, for true, officially, world 9652wide. Who am I to arbitrate between two Czekolsovak users contradicting 9653each other, for example? 9654 9655 I assume that your German is not much better than my French so that I 9656would not be able to judge about these formulations. What I would 9657suggest is that for each language there is a group for people who 9658maintain the PO files and judge about changes. I suspect there will be 9659cultural differences between how such groups of people will behave. 9660Some will have relaxed ways, reach consensus easily, and have anyone of 9661the group relate to the maintainers, while others will fight to death, 9662organize heavy administrations up to national standards, and use strict 9663channels. 9664 9665 The German team is putting out a good example. Right now, they are 9666maybe half a dozen people revising translations of each other and 9667discussing the linguistic issues. I do not even have all the names. 9668Ulrich Drepper is taking care of coordinating the German team. He 9669subscribed to all my pretest lists, so I do not even have to warn him 9670specifically of incoming releases. 9671 9672 I’m sure, that is a good idea to get teams for each language working 9673on translations. That will make the translations better and more 9674consistent. 9675 9676* Menu: 9677 9678* Sub-Cultures:: Sub-Cultures 9679* Organizational Ideas:: Organizational Ideas 9680 9681 9682File: gettext.info, Node: Sub-Cultures, Next: Organizational Ideas, Up: National Teams 9683 968412.4.2.1 Sub-Cultures 9685..................... 9686 9687 Taking French for example, there are a few sub-cultures around 9688computers which developed diverging vocabularies. Picking volunteers 9689here and there without addressing this problem in an organized way, soon 9690in the project, might produce a distasteful mix of internationalized 9691programs, and possibly trigger endless quarrels among those who really 9692care. 9693 9694 Keeping some kind of unity in the way French localization of 9695internationalized programs is achieved is a difficult (and delicate) 9696job. Knowing the latin character of French people (:-), if we take this 9697the wrong way, we could end up nowhere, or spoil a lot of energies. 9698Maybe we should begin to address this problem seriously _before_ GNU 9699‘gettext’ become officially published. And I suspect that this means 9700soon! 9701 9702 9703File: gettext.info, Node: Organizational Ideas, Prev: Sub-Cultures, Up: National Teams 9704 970512.4.2.2 Organizational Ideas 9706............................. 9707 9708 I expect the next big changes after the official release. Please 9709note that I use the German translation of the short GPL message. We 9710need to set a few good examples before the localization goes out for 9711true in the free software community. Here are a few points to discuss: 9712 9713 • Each group should have one FTP server (at least one master). 9714 9715 • The files on the server should reflect the latest version (of 9716 course!) and it should also contain a RCS directory with the 9717 corresponding archives (I don’t have this now). 9718 9719 • There should also be a ChangeLog file (this is more useful than the 9720 RCS archive but can be generated automatically from the later by 9721 Emacs). 9722 9723 • A “core group” should judge about questionable changes (for now 9724 this group consists solely by me but I ask some others 9725 occasionally; this also seems to work). 9726 9727 9728File: gettext.info, Node: Mailing Lists, Prev: National Teams, Up: Organization 9729 973012.4.3 Mailing Lists 9731-------------------- 9732 9733 If we get any inquiries about GNU ‘gettext’, send them on to: 9734 9735 coordinator@translationproject.org 9736 9737 The ‘*-pretest’ lists are quite useful to me, maybe the idea could be 9738generalized to many GNU, and non-GNU packages. But each maintainer 9739his/her way! 9740 9741 François, we have a mechanism in place here at ‘gnu.ai.mit.edu’ to 9742track teams, support mailing lists for them and log members. We have a 9743slight preference that you use it. If this is OK with you, I can get 9744you clued in. 9745 9746 Things are changing! A few years ago, when Daniel Fekete and I asked 9747for a mailing list for GNU localization, nested at the FSF, we were 9748politely invited to organize it anywhere else, and so did we. For 9749communicating with my pretesters, I later made a handful of mailing 9750lists located at iro.umontreal.ca and administrated by ‘majordomo’. 9751These lists have been _very_ dependable so far... 9752 9753 I suspect that the German team will organize itself a mailing list 9754located in Germany, and so forth for other countries. But before they 9755organize for true, it could surely be useful to offer mailing lists 9756located at the FSF to each national team. So yes, please explain me how 9757I should proceed to create and handle them. 9758 9759 We should create temporary mailing lists, one per country, to help 9760people organize. Temporary, because once regrouped and structured, it 9761would be fair the volunteers from country bring back _their_ list in 9762there and manage it as they want. My feeling is that, in the long run, 9763each team should run its own list, from within their country. There 9764also should be some central list to which all teams could subscribe as 9765they see fit, as long as each team is represented in it. 9766 9767 9768File: gettext.info, Node: Information Flow, Next: Translating plural forms, Prev: Organization, Up: Translators 9769 977012.5 Information Flow 9771===================== 9772 9773 * NOTE: * This documentation section is outdated and needs to be 9774revised. 9775 9776 There will surely be some discussion about this messages after the 9777packages are finally released. If people now send you some proposals 9778for better messages, how do you proceed? Jim, please note that right 9779now, as I put forward nearly a dozen of localizable programs, I receive 9780both the translations and the coordination concerns about them. 9781 9782 If I put one of my things to pretest, Ulrich receives the 9783announcement and passes it on to the German team, who make last minute 9784revisions. Then he submits the translation files to me _as the 9785maintainer_. For free packages I do not maintain, I would not even hear 9786about it. This scheme could be made to work for the whole Translation 9787Project, I think. For security reasons, maybe Ulrich (national 9788coordinators, in fact) should update central registry kept at the 9789Translation Project (Jim, me, or Len’s recruits) once in a while. 9790 9791 In December/January, I was aggressively ready to internationalize all 9792of GNU, giving myself the duty of one small GNU package per week or so, 9793taking many weeks or months for bigger packages. But it does not work 9794this way. I first did all the things I’m responsible for. I’ve nothing 9795against some missionary work on other maintainers, but I’m also losing a 9796lot of energy over it—same debates over again. 9797 9798 And when the first localized packages are released we’ll get a lot of 9799responses about ugly translations :-). Surely, and we need to have 9800beforehand a fairly good idea about how to handle the information flow 9801between the national teams and the package maintainers. 9802 9803 Please start saving somewhere a quick history of each PO file. I 9804know for sure that the file format will change, allowing for comments. 9805It would be nice that each file has a kind of log, and references for 9806those who want to submit comments or gripes, or otherwise contribute. I 9807sent a proposal for a fast and flexible format, but it is not receiving 9808acceptance yet by the GNU deciders. I’ll tell you when I have more 9809information about this. 9810 9811 9812File: gettext.info, Node: Translating plural forms, Next: Prioritizing messages, Prev: Information Flow, Up: Translators 9813 981412.6 Translating plural forms 9815============================= 9816 9817 Suppose you are translating a PO file, and it contains an entry like 9818this: 9819 9820 #, c-format 9821 msgid "One file removed" 9822 msgid_plural "%d files removed" 9823 msgstr[0] "" 9824 msgstr[1] "" 9825 9826What does this mean? How do you fill it in? 9827 9828 Such an entry denotes a message with plural forms, that is, a message 9829where the text depends on a cardinal number. The general form of the 9830message, in English, is the ‘msgid_plural’ line. The ‘msgid’ line is 9831the English singular form, that is, the form for when the number is 9832equal to 1. More details about plural forms are explained in *note 9833Plural forms::. 9834 9835 The first thing you need to look at is the ‘Plural-Forms’ line in the 9836header entry of the PO file. It contains the number of plural forms and 9837a formula. If the PO file does not yet have such a line, you have to 9838add it. It only depends on the language into which you are translating. 9839You can get this info by using the ‘msginit’ command (see *note 9840Creating::) – it contains a database of known plural formulas – or by 9841asking other members of your translation team. 9842 9843 Suppose the line looks as follows: 9844 9845 "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" 9846 "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" 9847 9848 It’s logically one line; recall that the PO file formatting is 9849allowed to break long lines so that each physical line fits in 80 9850monospaced columns. 9851 9852 The value of ‘nplurals’ here tells you that there are three plural 9853forms. The first thing you need to do is to ensure that the entry 9854contains an ‘msgstr’ line for each of the forms: 9855 9856 #, c-format 9857 msgid "One file removed" 9858 msgid_plural "%d files removed" 9859 msgstr[0] "" 9860 msgstr[1] "" 9861 msgstr[2] "" 9862 9863 Then translate the ‘msgid_plural’ line and fill it in into each 9864‘msgstr’ line: 9865 9866 #, c-format 9867 msgid "One file removed" 9868 msgid_plural "%d files removed" 9869 msgstr[0] "%d slika uklonjenih" 9870 msgstr[1] "%d slika uklonjenih" 9871 msgstr[2] "%d slika uklonjenih" 9872 9873 Now you can refine the translation so that it matches the plural 9874form. According to the formula above, ‘msgstr[0]’ is used when the 9875number ends in 1 but does not end in 11; ‘msgstr[1]’ is used when the 9876number ends in 2, 3, 4, but not in 12, 13, 14; and ‘msgstr[2]’ is used 9877in all other cases. With this knowledge, you can refine the 9878translations: 9879 9880 #, c-format 9881 msgid "One file removed" 9882 msgid_plural "%d files removed" 9883 msgstr[0] "%d slika je uklonjena" 9884 msgstr[1] "%d datoteke uklonjenih" 9885 msgstr[2] "%d slika uklonjenih" 9886 9887 You noticed that in the English singular form (‘msgid’) the number 9888placeholder could be omitted and replaced by the numeral word “one”. 9889Can you do this in your translation as well? 9890 9891 msgstr[0] "jednom datotekom je uklonjen" 9892 9893Well, it depends on whether ‘msgstr[0]’ applies only to the number 1, or 9894to other numbers as well. If, according to the plural formula, 9895‘msgstr[0]’ applies only to ‘n == 1’, then you can use the specialized 9896translation without the number placeholder. In our case, however, 9897‘msgstr[0]’ also applies to the numbers 21, 31, 41, etc., and therefore 9898you cannot omit the placeholder. 9899 9900 9901File: gettext.info, Node: Prioritizing messages, Prev: Translating plural forms, Up: Translators 9902 990312.7 Prioritizing messages: How to determine which messages to translate first 9904============================================================================== 9905 9906 A translator sometimes has only a limited amount of time per week to 9907spend on a package, and some packages have quite large message catalogs 9908(over 1000 messages). Therefore she wishes to translate the messages 9909first that are the most visible to the user, or that occur most 9910frequently. This section describes how to determine these "most urgent" 9911messages. It also applies to determine the "next most urgent" messages 9912after the message catalog has already been partially translated. 9913 9914 In a first step, she uses the programs like a user would do. While 9915she does this, the GNU ‘gettext’ library logs into a file the not yet 9916translated messages for which a translation was requested from the 9917program. 9918 9919 In a second step, she uses the PO mode to translate precisely this 9920set of messages. 9921 9922 Here are more details. The GNU ‘libintl’ library (but not the 9923corresponding functions in GNU ‘libc’) supports an environment variable 9924‘GETTEXT_LOG_UNTRANSLATED’. The GNU ‘libintl’ library will log into 9925this file the messages for which ‘gettext()’ and related functions 9926couldn’t find the translation. If the file doesn’t exist, it will be 9927created as needed. On systems with GNU ‘libc’ a shared library 9928‘preloadable_libintl.so’ is provided that can be used with the ELF 9929‘LD_PRELOAD’ mechanism. 9930 9931 So, in the first step, the translator uses these commands on systems 9932with GNU ‘libc’: 9933 9934 $ LD_PRELOAD=/usr/local/lib/preloadable_libintl.so 9935 $ export LD_PRELOAD 9936 $ GETTEXT_LOG_UNTRANSLATED=$HOME/gettextlogused 9937 $ export GETTEXT_LOG_UNTRANSLATED 9938 9939and these commands on other systems: 9940 9941 $ GETTEXT_LOG_UNTRANSLATED=$HOME/gettextlogused 9942 $ export GETTEXT_LOG_UNTRANSLATED 9943 9944 Then she uses and peruses the programs. (It is a good and 9945recommended practice to use the programs for which you provide 9946translations: it gives you the needed context.) When done, she removes 9947the environment variables: 9948 9949 $ unset LD_PRELOAD 9950 $ unset GETTEXT_LOG_UNTRANSLATED 9951 9952 The second step starts with removing duplicates: 9953 9954 $ msguniq $HOME/gettextlogused > missing.po 9955 9956 The result is a PO file, but needs some preprocessing before a PO 9957file editor can be used with it. First, it is a multi-domain PO file, 9958containing messages from many translation domains. Second, it lacks all 9959translator comments and source references. Here is how to get a list of 9960the affected translation domains: 9961 9962 $ sed -n -e 's,^domain "\(.*\)"$,\1,p' < missing.po | sort | uniq 9963 9964 Then the translator can handle the domains one by one. For 9965simplicity, let’s use environment variables to denote the language, 9966domain and source package. 9967 9968 $ lang=nl # your language 9969 $ domain=coreutils # the name of the domain to be handled 9970 $ package=/usr/src/gnu/coreutils-4.5.4 # the package where it comes from 9971 9972 She takes the latest copy of ‘$lang.po’ from the Translation Project, 9973or from the package (in most cases, ‘$package/po/$lang.po’), or creates 9974a fresh one if she’s the first translator (see *note Creating::). She 9975then uses the following commands to mark the not urgent messages as 9976"obsolete". (This doesn’t mean that these messages - translated and 9977untranslated ones - will go away. It simply means that the PO file 9978editor will ignore them in the following editing session.) 9979 9980 $ msggrep --domain=$domain missing.po | grep -v '^domain' \ 9981 > $domain-missing.po 9982 $ msgattrib --set-obsolete --ignore-file $domain-missing.po $domain.$lang.po \ 9983 > $domain.$lang-urgent.po 9984 9985 The she translates ‘$domain.$lang-urgent.po’ by use of a PO file 9986editor (*note Editing::). (FIXME: I don’t know whether ‘KBabel’ and 9987‘gtranslator’ also preserve obsolete messages, as they should.) Finally 9988she restores the not urgent messages (with their earlier translations, 9989for those which were already translated) through this command: 9990 9991 $ msgmerge --no-fuzzy-matching $domain.$lang-urgent.po $package/po/$domain.pot \ 9992 > $domain.$lang.po 9993 9994 Then she can submit ‘$domain.$lang.po’ and proceed to the next 9995domain. 9996 9997 9998File: gettext.info, Node: Maintainers, Next: Installers, Prev: Translators, Up: Top 9999 1000013 The Maintainer’s View 10001************************ 10002 10003 The maintainer of a package has many responsibilities. One of them 10004is ensuring that the package will install easily on many platforms, and 10005that the magic we described earlier (*note Users::) will work for 10006installers and end users. 10007 10008 Of course, there are many possible ways by which GNU ‘gettext’ might 10009be integrated in a distribution, and this chapter does not cover them in 10010all generality. Instead, it details one possible approach which is 10011especially adequate for many free software distributions following GNU 10012standards, or even better, Gnits standards, because GNU ‘gettext’ is 10013purposely for helping the internationalization of the whole GNU project, 10014and as many other good free packages as possible. So, the maintainer’s 10015view presented here presumes that the package already has a 10016‘configure.ac’ file and uses GNU Autoconf. 10017 10018 Nevertheless, GNU ‘gettext’ may surely be useful for free packages 10019not following GNU standards and conventions, but the maintainers of such 10020packages might have to show imagination and initiative in organizing 10021their distributions so ‘gettext’ work for them in all situations. There 10022are surely many, out there. 10023 10024 Even if ‘gettext’ methods are now stabilizing, slight adjustments 10025might be needed between successive ‘gettext’ versions, so you should 10026ideally revise this chapter in subsequent releases, looking for changes. 10027 10028* Menu: 10029 10030* Flat and Non-Flat:: Flat or Non-Flat Directory Structures 10031* Prerequisites:: Prerequisite Works 10032* gettextize Invocation:: Invoking the ‘gettextize’ Program 10033* Adjusting Files:: Files You Must Create or Alter 10034* autoconf macros:: Autoconf macros for use in ‘configure.ac’ 10035* Version Control Issues:: 10036* Release Management:: Creating a Distribution Tarball 10037 10038 10039File: gettext.info, Node: Flat and Non-Flat, Next: Prerequisites, Up: Maintainers 10040 1004113.1 Flat or Non-Flat Directory Structures 10042========================================== 10043 10044 Some free software packages are distributed as ‘tar’ files which 10045unpack in a single directory, these are said to be “flat” distributions. 10046Other free software packages have a one level hierarchy of 10047subdirectories, using for example a subdirectory named ‘doc/’ for the 10048Texinfo manual and man pages, another called ‘lib/’ for holding 10049functions meant to replace or complement C libraries, and a subdirectory 10050‘src/’ for holding the proper sources for the package. These other 10051distributions are said to be “non-flat”. 10052 10053 We cannot say much about flat distributions. A flat directory 10054structure has the disadvantage of increasing the difficulty of updating 10055to a new version of GNU ‘gettext’. Also, if you have many PO files, 10056this could somewhat pollute your single directory. Also, GNU 10057‘gettext’’s libintl sources consist of C sources, shell scripts, ‘sed’ 10058scripts and complicated Makefile rules, which don’t fit well into an 10059existing flat structure. For these reasons, we recommend to use 10060non-flat approach in this case as well. 10061 10062 Maybe because GNU ‘gettext’ itself has a non-flat structure, we have 10063more experience with this approach, and this is what will be described 10064in the remaining of this chapter. Some maintainers might use this as an 10065opportunity to unflatten their package structure. 10066 10067 10068File: gettext.info, Node: Prerequisites, Next: gettextize Invocation, Prev: Flat and Non-Flat, Up: Maintainers 10069 1007013.2 Prerequisite Works 10071======================= 10072 10073 There are some works which are required for using GNU ‘gettext’ in 10074one of your package. These works have some kind of generality that 10075escape the point by point descriptions used in the remainder of this 10076chapter. So, we describe them here. 10077 10078 • Before attempting to use ‘gettextize’ you should install some other 10079 packages first. Ensure that recent versions of GNU ‘m4’, GNU 10080 Autoconf and GNU ‘gettext’ are already installed at your site, and 10081 if not, proceed to do this first. If you get to install these 10082 things, beware that GNU ‘m4’ must be fully installed before GNU 10083 Autoconf is even _configured_. 10084 10085 To further ease the task of a package maintainer the ‘automake’ 10086 package was designed and implemented. GNU ‘gettext’ now uses this 10087 tool and the ‘Makefile’ in the ‘po/’ directory therefore knows 10088 about all the goals necessary for using ‘automake’. 10089 10090 Those four packages are only needed by you, as a maintainer; the 10091 installers of your own package and end users do not really need any 10092 of GNU ‘m4’, GNU Autoconf, GNU ‘gettext’, or GNU ‘automake’ for 10093 successfully installing and running your package, with messages 10094 properly translated. But this is not completely true if you 10095 provide internationalized shell scripts within your own package: 10096 GNU ‘gettext’ shall then be installed at the user site if the end 10097 users want to see the translation of shell script messages. 10098 10099 • Your package should use Autoconf and have a ‘configure.ac’ or 10100 ‘configure.in’ file. If it does not, you have to learn how. The 10101 Autoconf documentation is quite well written, it is a good idea 10102 that you print it and get familiar with it. 10103 10104 • Your C sources should have already been modified according to 10105 instructions given earlier in this manual. *Note Sources::. 10106 10107 • Your ‘po/’ directory should receive all PO files submitted to you 10108 by the translator teams, each having ‘LL.po’ as a name. This is 10109 not usually easy to get translation work done before your package 10110 gets internationalized and available! Since the cycle has to start 10111 somewhere, the easiest for the maintainer is to start with 10112 absolutely no PO files, and wait until various translator teams get 10113 interested in your package, and submit PO files. 10114 10115 It is worth adding here a few words about how the maintainer should 10116ideally behave with PO files submissions. As a maintainer, your role is 10117to authenticate the origin of the submission as being the representative 10118of the appropriate translating teams of the Translation Project (forward 10119the submission to ‘coordinator@translationproject.org’ in case of 10120doubt), to ensure that the PO file format is not severely broken and 10121does not prevent successful installation, and for the rest, to merely 10122put these PO files in ‘po/’ for distribution. 10123 10124 As a maintainer, you do not have to take on your shoulders the 10125responsibility of checking if the translations are adequate or complete, 10126and should avoid diving into linguistic matters. Translation teams 10127drive themselves and are fully responsible of their linguistic choices 10128for the Translation Project. Keep in mind that translator teams are 10129_not_ driven by maintainers. You can help by carefully redirecting all 10130communications and reports from users about linguistic matters to the 10131appropriate translation team, or explain users how to reach or join 10132their team. 10133 10134 Maintainers should _never ever_ apply PO file bug reports themselves, 10135short-cutting translation teams. If some translator has difficulty to 10136get some of her points through her team, it should not be an option for 10137her to directly negotiate translations with maintainers. Teams ought to 10138settle their problems themselves, if any. If you, as a maintainer, ever 10139think there is a real problem with a team, please never try to _solve_ a 10140team’s problem on your own. 10141 10142 10143File: gettext.info, Node: gettextize Invocation, Next: Adjusting Files, Prev: Prerequisites, Up: Maintainers 10144 1014513.3 Invoking the ‘gettextize’ Program 10146====================================== 10147 10148 The ‘gettextize’ program is an interactive tool that helps the 10149maintainer of a package internationalized through GNU ‘gettext’. It is 10150used for two purposes: 10151 10152 • As a wizard, when a package is modified to use GNU ‘gettext’ for 10153 the first time. 10154 10155 • As a migration tool, for upgrading the GNU ‘gettext’ support in a 10156 package from a previous to a newer version of GNU ‘gettext’. 10157 10158 This program performs the following tasks: 10159 10160 • It copies into the package some files that are consistently and 10161 identically needed in every package internationalized through GNU 10162 ‘gettext’. 10163 10164 • It performs as many of the tasks mentioned in the next section 10165 *note Adjusting Files:: as can be performed automatically. 10166 10167 • It removes obsolete files and idioms used for previous GNU 10168 ‘gettext’ versions to the form recommended for the current GNU 10169 ‘gettext’ version. 10170 10171 • It prints a summary of the tasks that ought to be done manually and 10172 could not be done automatically by ‘gettextize’. 10173 10174 It can be invoked as follows: 10175 10176 gettextize [ OPTION... ] [ DIRECTORY ] 10177 10178and accepts the following options: 10179 10180‘-f’ 10181‘--force’ 10182 Force replacement of files which already exist. 10183 10184‘--po-dir=DIR’ 10185 Specify a directory containing PO files. Such a directory contains 10186 the translations into various languages of a particular POT file. 10187 This option can be specified multiple times, once for each 10188 translation domain. If it is not specified, the directory named 10189 ‘po/’ is updated. 10190 10191‘--no-changelog’ 10192 Don’t update or create ChangeLog files. By default, ‘gettextize’ 10193 logs all changes (file additions, modifications and removals) in a 10194 file called ‘ChangeLog’ in each affected directory. 10195 10196‘--symlink’ 10197 Make symbolic links instead of copying the needed files. This can 10198 be useful to save a few kilobytes of disk space, but it requires 10199 extra effort to create self-contained tarballs, it may disturb some 10200 mechanism the maintainer applies to the sources, and it is likely 10201 to introduce bugs when a newer version of ‘gettext’ is installed on 10202 the system. 10203 10204‘-n’ 10205‘--dry-run’ 10206 Print modifications but don’t perform them. All actions that 10207 ‘gettextize’ would normally execute are inhibited and instead only 10208 listed on standard output. 10209 10210‘--help’ 10211 Display this help and exit. 10212 10213‘--version’ 10214 Output version information and exit. 10215 10216 If DIRECTORY is given, this is the top level directory of a package 10217to prepare for using GNU ‘gettext’. If not given, it is assumed that 10218the current directory is the top level directory of such a package. 10219 10220 The program ‘gettextize’ provides the following files. However, no 10221existing file will be replaced unless the option ‘--force’ (‘-f’) is 10222specified. 10223 10224 1. The ‘ABOUT-NLS’ file is copied in the main directory of your 10225 package, the one being at the top level. This file contains a 10226 reference to the GNU gettext documentation. It also avoids an 10227 error from Automake in packages that use the Automake option ‘gnu’ 10228 or ‘gnits’: “error: required file ’./ABOUT-NLS’ not found”. 10229 10230 2. A ‘po/’ directory is created for eventually holding all translation 10231 files, but initially only containing the file ‘po/Makefile.in.in’ 10232 from the GNU ‘gettext’ distribution (beware the double ‘.in’ in the 10233 file name) and a few auxiliary files. If the ‘po/’ directory 10234 already exists, it will be preserved along with the files it 10235 contains, and only ‘Makefile.in.in’ and the auxiliary files will be 10236 overwritten. 10237 10238 If ‘--po-dir’ has been specified, this holds for every directory 10239 specified through ‘--po-dir’, instead of ‘po/’. 10240 10241 3. The file ‘config.rpath’ is copied into the directory containing 10242 configuration support files. It is needed by the ‘AM_GNU_GETTEXT’ 10243 autoconf macro. 10244 10245 4. Only if the project is using GNU ‘automake’: A set of ‘autoconf’ 10246 macro files is copied into the package’s ‘autoconf’ macro 10247 repository, usually in a directory called ‘m4/’. 10248 10249 If your site support symbolic links, ‘gettextize’ will not actually 10250copy the files into your package, but establish symbolic links instead. 10251This avoids duplicating the disk space needed in all packages. Merely 10252using the ‘-h’ option while creating the ‘tar’ archive of your 10253distribution will resolve each link by an actual copy in the 10254distribution archive. So, to insist, you really should use ‘-h’ option 10255with ‘tar’ within your ‘dist’ goal of your main ‘Makefile.in’. 10256 10257 Furthermore, ‘gettextize’ will update all ‘Makefile.am’ files in each 10258affected directory, as well as the top level ‘configure.ac’ or 10259‘configure.in’ file. 10260 10261 It is interesting to understand that most new files for supporting 10262GNU ‘gettext’ facilities in one package go in ‘po/’ and ‘m4/’ 10263subdirectories. Still, these directories will mostly contain package 10264dependent files. 10265 10266 The ‘gettextize’ program makes backup files for all files it replaces 10267or changes, and also write ChangeLog entries about these changes. This 10268way, the careful maintainer can check after running ‘gettextize’ whether 10269its changes are acceptable to him, and possibly adjust them. An 10270exception to this rule is the ‘intl/’ directory, which is removed as a 10271whole if it still existed. 10272 10273 It is important to understand that ‘gettextize’ can not do the entire 10274job of adapting a package for using GNU ‘gettext’. The amount of 10275remaining work depends on whether the package uses GNU ‘automake’ or 10276not. But in any case, the maintainer should still read the section 10277*note Adjusting Files:: after invoking ‘gettextize’. 10278 10279 In particular, if after using ‘gettexize’, you get an error 10280‘AC_COMPILE_IFELSE was called before AC_GNU_SOURCE’ or ‘AC_RUN_IFELSE 10281was called before AC_GNU_SOURCE’, you can fix it by modifying 10282‘configure.ac’, as described in *note configure.ac::. 10283 10284 It is also important to understand that ‘gettextize’ is not part of 10285the GNU build system, in the sense that it should not be invoked 10286automatically, and not be invoked by someone who doesn’t assume the 10287responsibilities of a package maintainer. For the latter purpose, a 10288separate tool is provided, see *note autopoint Invocation::. 10289 10290 10291File: gettext.info, Node: Adjusting Files, Next: autoconf macros, Prev: gettextize Invocation, Up: Maintainers 10292 1029313.4 Files You Must Create or Alter 10294=================================== 10295 10296 Besides files which are automatically added through ‘gettextize’, 10297there are many files needing revision for properly interacting with GNU 10298‘gettext’. If you are closely following GNU standards for Makefile 10299engineering and auto-configuration, the adaptations should be easier to 10300achieve. Here is a point by point description of the changes needed in 10301each. 10302 10303 So, here comes a list of files, each one followed by a description of 10304all alterations it needs. Many examples are taken out from the GNU 10305‘gettext’ 0.21 distribution itself, or from the GNU ‘hello’ distribution 10306(<https://www.gnu.org/software/hello>). You may indeed refer to the 10307source code of the GNU ‘gettext’ and GNU ‘hello’ packages, as they are 10308intended to be good examples for using GNU gettext functionality. 10309 10310* Menu: 10311 10312* po/POTFILES.in:: ‘POTFILES.in’ in ‘po/’ 10313* po/LINGUAS:: ‘LINGUAS’ in ‘po/’ 10314* po/Makevars:: ‘Makevars’ in ‘po/’ 10315* po/Rules-*:: Extending ‘Makefile’ in ‘po/’ 10316* configure.ac:: ‘configure.ac’ at top level 10317* config.guess:: ‘config.guess’, ‘config.sub’ at top level 10318* mkinstalldirs:: ‘mkinstalldirs’ at top level 10319* aclocal:: ‘aclocal.m4’ at top level 10320* config.h.in:: ‘config.h.in’ at top level 10321* Makefile:: ‘Makefile.in’ at top level 10322* src/Makefile:: ‘Makefile.in’ in ‘src/’ 10323* lib/gettext.h:: ‘gettext.h’ in ‘lib/’ 10324 10325 10326File: gettext.info, Node: po/POTFILES.in, Next: po/LINGUAS, Up: Adjusting Files 10327 1032813.4.1 ‘POTFILES.in’ in ‘po/’ 10329----------------------------- 10330 10331 The ‘po/’ directory should receive a file named ‘POTFILES.in’. This 10332file tells which files, among all program sources, have marked strings 10333needing translation. Here is an example of such a file: 10334 10335 # List of source files containing translatable strings. 10336 # Copyright (C) 1995 Free Software Foundation, Inc. 10337 10338 # Common library files 10339 lib/error.c 10340 lib/getopt.c 10341 lib/xmalloc.c 10342 10343 # Package source files 10344 src/gettext.c 10345 src/msgfmt.c 10346 src/xgettext.c 10347 10348Hash-marked comments and white lines are ignored. All other lines list 10349those source files containing strings marked for translation (*note Mark 10350Keywords::), in a notation relative to the top level of your whole 10351distribution, rather than the location of the ‘POTFILES.in’ file itself. 10352 10353 When a C file is automatically generated by a tool, like ‘flex’ or 10354‘bison’, that doesn’t introduce translatable strings by itself, it is 10355recommended to list in ‘po/POTFILES.in’ the real source file (ending in 10356‘.l’ in the case of ‘flex’, or in ‘.y’ in the case of ‘bison’), not the 10357generated C file. 10358 10359 10360File: gettext.info, Node: po/LINGUAS, Next: po/Makevars, Prev: po/POTFILES.in, Up: Adjusting Files 10361 1036213.4.2 ‘LINGUAS’ in ‘po/’ 10363------------------------- 10364 10365 The ‘po/’ directory should also receive a file named ‘LINGUAS’. This 10366file contains the list of available translations. It is a whitespace 10367separated list. Hash-marked comments and white lines are ignored. Here 10368is an example file: 10369 10370 # Set of available languages. 10371 de fr 10372 10373This example means that German and French PO files are available, so 10374that these languages are currently supported by your package. If you 10375want to further restrict, at installation time, the set of installed 10376languages, this should not be done by modifying the ‘LINGUAS’ file, but 10377rather by using the ‘LINGUAS’ environment variable (*note Installers::). 10378 10379 It is recommended that you add the "languages" ‘en@quot’ and 10380‘en@boldquot’ to the ‘LINGUAS’ file. ‘en@quot’ is a variant of English 10381message catalogs (‘en’) which uses real quotation marks instead of the 10382ugly looking asymmetric ASCII substitutes ‘`’ and ‘'’. ‘en@boldquot’ is 10383a variant of ‘en@quot’ that additionally outputs quoted pieces of text 10384in a bold font, when used in a terminal emulator which supports the 10385VT100 escape sequences (such as ‘xterm’ or the Linux console, but not 10386Emacs in ‘M-x shell’ mode). 10387 10388 These extra message catalogs ‘en@quot’ and ‘en@boldquot’ are 10389constructed automatically, not by translators; to support them, you need 10390the files ‘Rules-quot’, ‘quot.sed’, ‘boldquot.sed’, ‘en@quot.header’, 10391‘en@boldquot.header’, ‘insert-header.sin’ in the ‘po/’ directory. You 10392can copy them from GNU gettext’s ‘po/’ directory; they are also 10393installed by running ‘gettextize’. 10394 10395 10396File: gettext.info, Node: po/Makevars, Next: po/Rules-*, Prev: po/LINGUAS, Up: Adjusting Files 10397 1039813.4.3 ‘Makevars’ in ‘po/’ 10399-------------------------- 10400 10401 The ‘po/’ directory also has a file named ‘Makevars’. It contains 10402variables that are specific to your project. ‘po/Makevars’ gets 10403inserted into the ‘po/Makefile’ when the latter is created. The 10404variables thus take effect when the POT file is created or updated, and 10405when the message catalogs get installed. 10406 10407 The first three variables can be left unmodified if your package has 10408a single message domain and, accordingly, a single ‘po/’ directory. 10409Only packages which have multiple ‘po/’ directories at different 10410locations need to adjust the three first variables defined in 10411‘Makevars’. 10412 10413 As an alternative to the ‘XGETTEXT_OPTIONS’ variable, it is also 10414possible to specify ‘xgettext’ options through the ‘AM_XGETTEXT_OPTION’ 10415autoconf macro. See *note AM_XGETTEXT_OPTION::. 10416 10417 10418File: gettext.info, Node: po/Rules-*, Next: configure.ac, Prev: po/Makevars, Up: Adjusting Files 10419 1042013.4.4 Extending ‘Makefile’ in ‘po/’ 10421------------------------------------ 10422 10423 All files called ‘Rules-*’ in the ‘po/’ directory get appended to the 10424‘po/Makefile’ when it is created. They present an opportunity to add 10425rules for special PO files to the Makefile, without needing to mess with 10426‘po/Makefile.in.in’. 10427 10428 GNU gettext comes with a ‘Rules-quot’ file, containing rules for 10429building catalogs ‘en@quot.po’ and ‘en@boldquot.po’. The effect of 10430‘en@quot.po’ is that people who set their ‘LANGUAGE’ environment 10431variable to ‘en@quot’ will get messages with proper looking symmetric 10432Unicode quotation marks instead of abusing the ASCII grave accent and 10433the ASCII apostrophe for indicating quotations. To enable this catalog, 10434simply add ‘en@quot’ to the ‘po/LINGUAS’ file. The effect of 10435‘en@boldquot.po’ is that people who set ‘LANGUAGE’ to ‘en@boldquot’ will 10436get not only proper quotation marks, but also the quoted text will be 10437shown in a bold font on terminals and consoles. This catalog is useful 10438only for command-line programs, not GUI programs. To enable it, 10439similarly add ‘en@boldquot’ to the ‘po/LINGUAS’ file. 10440 10441 Similarly, you can create rules for building message catalogs for the 10442‘sr@latin’ locale – Serbian written with the Latin alphabet – from those 10443for the ‘sr’ locale – Serbian written with Cyrillic letters. See *note 10444msgfilter Invocation::. 10445 10446 10447File: gettext.info, Node: configure.ac, Next: config.guess, Prev: po/Rules-*, Up: Adjusting Files 10448 1044913.4.5 ‘configure.ac’ at top level 10450---------------------------------- 10451 10452 ‘configure.ac’ or ‘configure.in’ - this is the source from which 10453‘autoconf’ generates the ‘configure’ script. 10454 10455 1. Declare the package and version. 10456 10457 This is done by a set of lines like these: 10458 10459 PACKAGE=gettext 10460 VERSION=0.21 10461 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") 10462 AC_DEFINE_UNQUOTED(VERSION, "$VERSION") 10463 AC_SUBST(PACKAGE) 10464 AC_SUBST(VERSION) 10465 10466 or, if you are using GNU ‘automake’, by a line like this: 10467 10468 AM_INIT_AUTOMAKE(gettext, 0.21) 10469 10470 Of course, you replace ‘gettext’ with the name of your package, and 10471 ‘0.21’ by its version numbers, exactly as they should appear in the 10472 packaged ‘tar’ file name of your distribution 10473 (‘gettext-0.21.tar.gz’, here). 10474 10475 2. Check for internationalization support. 10476 10477 Here is the main ‘m4’ macro for triggering internationalization 10478 support. Just add this line to ‘configure.ac’: 10479 10480 AM_GNU_GETTEXT([external]) 10481 10482 This call is purposely simple, even if it generates a lot of 10483 configure time checking and actions. 10484 10485 3. Have output files created. 10486 10487 The ‘AC_OUTPUT’ directive, at the end of your ‘configure.ac’ file, 10488 needs to be modified in two ways: 10489 10490 AC_OUTPUT([EXISTING CONFIGURATION FILES po/Makefile.in], 10491 [EXISTING ADDITIONAL ACTIONS]) 10492 10493 The modification to the first argument to ‘AC_OUTPUT’ asks for 10494 substitution in the ‘po/’ directory. Note the ‘.in’ suffix used 10495 for ‘po/’ only. This is because the distributed file is really 10496 ‘po/Makefile.in.in’. 10497 10498 10499File: gettext.info, Node: config.guess, Next: mkinstalldirs, Prev: configure.ac, Up: Adjusting Files 10500 1050113.4.6 ‘config.guess’, ‘config.sub’ at top level 10502------------------------------------------------ 10503 10504 You need to add the GNU ‘config.guess’ and ‘config.sub’ files to your 10505distribution. They are needed because the ‘AM_ICONV’ macro contains 10506knowledge about specific platforms and therefore needs to identify the 10507platform. 10508 10509 You can obtain the newest version of ‘config.guess’ and ‘config.sub’ 10510from the ‘config’ project at ‘https://savannah.gnu.org/’. The commands 10511to fetch them are 10512 $ wget -O config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' 10513 $ wget -O config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' 10514Less recent versions are also contained in the GNU ‘automake’ and GNU 10515‘libtool’ packages. 10516 10517 Normally, ‘config.guess’ and ‘config.sub’ are put at the top level of 10518a distribution. But it is also possible to put them in a subdirectory, 10519altogether with other configuration support files like ‘install-sh’, 10520‘ltconfig’, ‘ltmain.sh’ or ‘missing’. All you need to do, other than 10521moving the files, is to add the following line to your ‘configure.ac’. 10522 10523 AC_CONFIG_AUX_DIR([SUBDIR]) 10524 10525 10526File: gettext.info, Node: mkinstalldirs, Next: aclocal, Prev: config.guess, Up: Adjusting Files 10527 1052813.4.7 ‘mkinstalldirs’ at top level 10529----------------------------------- 10530 10531 With earlier versions of GNU gettext, you needed to add the GNU 10532‘mkinstalldirs’ script to your distribution. This is not needed any 10533more. You can remove it. 10534 10535 10536File: gettext.info, Node: aclocal, Next: config.h.in, Prev: mkinstalldirs, Up: Adjusting Files 10537 1053813.4.8 ‘aclocal.m4’ at top level 10539-------------------------------- 10540 10541 If you do not have an ‘aclocal.m4’ file in your distribution, the 10542simplest is to concatenate the files ‘gettext.m4’, ‘host-cpu-c-abi.m4’, 10543‘intlmacosx.m4’, ‘iconv.m4’, ‘lib-ld.m4’, ‘lib-link.m4’, 10544‘lib-prefix.m4’, ‘nls.m4’, ‘po.m4’, ‘progtest.m4’ from GNU ‘gettext’’s 10545‘m4/’ directory into a single file. 10546 10547 If you already have an ‘aclocal.m4’ file, then you will have to merge 10548the said macro files into your ‘aclocal.m4’. Note that if you are 10549upgrading from a previous release of GNU ‘gettext’, you should most 10550probably _replace_ the macros (‘AM_GNU_GETTEXT’, etc.), as they usually 10551change a little from one release of GNU ‘gettext’ to the next. Their 10552contents may vary as we get more experience with strange systems out 10553there. 10554 10555 You should be using GNU ‘automake’ 1.9 or newer. With it, you need 10556to copy the files ‘gettext.m4’, ‘host-cpu-c-abi.m4’, ‘intlmacosx.m4’, 10557‘iconv.m4’, ‘lib-ld.m4’, ‘lib-link.m4’, ‘lib-prefix.m4’, ‘nls.m4’, 10558‘po.m4’, ‘progtest.m4’ from GNU ‘gettext’’s ‘m4/’ directory to a 10559subdirectory named ‘m4/’ and add the line 10560 10561 ACLOCAL_AMFLAGS = -I m4 10562 10563to your top level ‘Makefile.am’. 10564 10565 If you are using GNU ‘automake’ 1.10 or newer, it is even easier: Add 10566the line 10567 10568 ACLOCAL_AMFLAGS = --install -I m4 10569 10570to your top level ‘Makefile.am’, and run ‘aclocal --install -I m4’. 10571This will copy the needed files to the ‘m4/’ subdirectory automatically, 10572before updating ‘aclocal.m4’. 10573 10574 These macros check for the internationalization support functions and 10575related informations. Hopefully, once stabilized, these macros might be 10576integrated in the standard Autoconf set, because this piece of ‘m4’ code 10577will be the same for all projects using GNU ‘gettext’. 10578 10579 10580File: gettext.info, Node: config.h.in, Next: Makefile, Prev: aclocal, Up: Adjusting Files 10581 1058213.4.9 ‘config.h.in’ at top level 10583--------------------------------- 10584 10585 The include file template that holds the C macros to be defined by 10586‘configure’ is usually called ‘config.h.in’ and may be maintained either 10587manually or automatically. 10588 10589 If it is maintained automatically, by use of the ‘autoheader’ 10590program, you need to do nothing about it. This is the case in 10591particular if you are using GNU ‘automake’. 10592 10593 If it is maintained manually, you can get away by adding the 10594following lines to ‘config.h.in’: 10595 10596 /* Define to 1 if translation of program messages to the user's 10597 native language is requested. */ 10598 #undef ENABLE_NLS 10599 10600 10601File: gettext.info, Node: Makefile, Next: src/Makefile, Prev: config.h.in, Up: Adjusting Files 10602 1060313.4.10 ‘Makefile.in’ at top level 10604---------------------------------- 10605 10606 Here are a few modifications you need to make to your main, top-level 10607‘Makefile.in’ file. 10608 10609 1. Add the following lines near the beginning of your ‘Makefile.in’, 10610 so the ‘dist:’ goal will work properly (as explained further down): 10611 10612 PACKAGE = @PACKAGE@ 10613 VERSION = @VERSION@ 10614 10615 2. Wherever you process subdirectories in your ‘Makefile.in’, be sure 10616 you also process the subdirectory ‘po’. Special rules in the 10617 ‘Makefiles’ take care for the case where no internationalization is 10618 wanted. 10619 10620 If you are using Makefiles, either generated by automake, or 10621 hand-written so they carefully follow the GNU coding standards, the 10622 effected goals for which the new subdirectories must be handled 10623 include ‘installdirs’, ‘install’, ‘uninstall’, ‘clean’, 10624 ‘distclean’. 10625 10626 Here is an example of a canonical order of processing. In this 10627 example, we also define ‘SUBDIRS’ in ‘Makefile.in’ for it to be 10628 further used in the ‘dist:’ goal. 10629 10630 SUBDIRS = doc lib src po 10631 10632 3. A delicate point is the ‘dist:’ goal, as ‘po/Makefile’ will later 10633 assume that the proper directory has been set up from the main 10634 ‘Makefile’. Here is an example at what the ‘dist:’ goal might look 10635 like: 10636 10637 distdir = $(PACKAGE)-$(VERSION) 10638 dist: Makefile 10639 rm -fr $(distdir) 10640 mkdir $(distdir) 10641 chmod 777 $(distdir) 10642 for file in $(DISTFILES); do \ 10643 ln $$file $(distdir) 2>/dev/null || cp -p $$file $(distdir); \ 10644 done 10645 for subdir in $(SUBDIRS); do \ 10646 mkdir $(distdir)/$$subdir || exit 1; \ 10647 chmod 777 $(distdir)/$$subdir; \ 10648 (cd $$subdir && $(MAKE) $@) || exit 1; \ 10649 done 10650 tar chozf $(distdir).tar.gz $(distdir) 10651 rm -fr $(distdir) 10652 10653 Note that if you are using GNU ‘automake’, ‘Makefile.in’ is 10654automatically generated from ‘Makefile.am’, and all needed changes to 10655‘Makefile.am’ are already made by running ‘gettextize’. 10656 10657 10658File: gettext.info, Node: src/Makefile, Next: lib/gettext.h, Prev: Makefile, Up: Adjusting Files 10659 1066013.4.11 ‘Makefile.in’ in ‘src/’ 10661------------------------------- 10662 10663 Some of the modifications made in the main ‘Makefile.in’ will also be 10664needed in the ‘Makefile.in’ from your package sources, which we assume 10665here to be in the ‘src/’ subdirectory. Here are all the modifications 10666needed in ‘src/Makefile.in’: 10667 10668 1. In view of the ‘dist:’ goal, you should have these lines near the 10669 beginning of ‘src/Makefile.in’: 10670 10671 PACKAGE = @PACKAGE@ 10672 VERSION = @VERSION@ 10673 10674 2. If not done already, you should guarantee that ‘top_srcdir’ gets 10675 defined. This will serve for ‘cpp’ include files. Just add the 10676 line: 10677 10678 top_srcdir = @top_srcdir@ 10679 10680 3. You might also want to define ‘subdir’ as ‘src’, later allowing for 10681 almost uniform ‘dist:’ goals in all your ‘Makefile.in’. At list, 10682 the ‘dist:’ goal below assume that you used: 10683 10684 subdir = src 10685 10686 4. The ‘main’ function of your program will normally call 10687 ‘bindtextdomain’ (see *note Triggering::), like this: 10688 10689 bindtextdomain (PACKAGE, LOCALEDIR); 10690 textdomain (PACKAGE); 10691 10692 On native Windows platforms, the ‘main’ function may call 10693 ‘wbindtextdomain’ instead of ‘bindtextdomain’. 10694 10695 To make LOCALEDIR known to the program, add the following lines to 10696 ‘Makefile.in’: 10697 10698 datadir = @datadir@ 10699 datarootdir= @datarootdir@ 10700 localedir = @localedir@ 10701 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ 10702 10703 Note that ‘@datadir@’ defaults to ‘$(prefix)/share’, and 10704 ‘$(localedir)’ defaults to ‘$(prefix)/share/locale’. 10705 10706 5. You should ensure that the final linking will use ‘@LIBINTL@’ or 10707 ‘@LTLIBINTL@’ as a library. ‘@LIBINTL@’ is for use without 10708 ‘libtool’, ‘@LTLIBINTL@’ is for use with ‘libtool’. An easy way to 10709 achieve this is to manage that it gets into ‘LIBS’, like this: 10710 10711 LIBS = @LIBINTL@ @LIBS@ 10712 10713 In most packages internationalized with GNU ‘gettext’, one will 10714 find a directory ‘lib/’ in which a library containing some helper 10715 functions will be build. (You need at least the few functions 10716 which the GNU ‘gettext’ Library itself needs.) However some of the 10717 functions in the ‘lib/’ also give messages to the user which of 10718 course should be translated, too. Taking care of this, the support 10719 library (say ‘libsupport.a’) should be placed before ‘@LIBINTL@’ 10720 and ‘@LIBS@’ in the above example. So one has to write this: 10721 10722 LIBS = ../lib/libsupport.a @LIBINTL@ @LIBS@ 10723 10724 6. Your ‘dist:’ goal has to conform with others. Here is a reasonable 10725 definition for it: 10726 10727 distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) 10728 dist: Makefile $(DISTFILES) 10729 for file in $(DISTFILES); do \ 10730 ln $$file $(distdir) 2>/dev/null || cp -p $$file $(distdir) || exit 1; \ 10731 done 10732 10733 Note that if you are using GNU ‘automake’, ‘Makefile.in’ is 10734automatically generated from ‘Makefile.am’, and the first three changes 10735and the last change are not necessary. The remaining needed 10736‘Makefile.am’ modifications are the following: 10737 10738 1. To make LOCALEDIR known to the program, add the following to 10739 ‘Makefile.am’: 10740 10741 <module>_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" 10742 10743 for each specific module or compilation unit, or 10744 10745 AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" 10746 10747 for all modules and compilation units together. Furthermore, if 10748 you are using an Autoconf version older then 2.60, add this line to 10749 define ‘localedir’: 10750 10751 localedir = $(datadir)/locale 10752 10753 2. To ensure that the final linking will use ‘@LIBINTL@’ or 10754 ‘@LTLIBINTL@’ as a library, add the following to ‘Makefile.am’: 10755 10756 <program>_LDADD = @LIBINTL@ 10757 10758 for each specific program, or 10759 10760 LDADD = @LIBINTL@ 10761 10762 for all programs together. Remember that when you use ‘libtool’ to 10763 link a program, you need to use @LTLIBINTL@ instead of @LIBINTL@ 10764 for that program. 10765 10766 10767File: gettext.info, Node: lib/gettext.h, Prev: src/Makefile, Up: Adjusting Files 10768 1076913.4.12 ‘gettext.h’ in ‘lib/’ 10770----------------------------- 10771 10772 Internationalization of packages, as provided by GNU ‘gettext’, is 10773optional. It can be turned off in two situations: 10774 10775 • When the installer has specified ‘./configure --disable-nls’. This 10776 can be useful when small binaries are more important than features, 10777 for example when building utilities for boot diskettes. It can 10778 also be useful in order to get some specific C compiler warnings 10779 about code quality with some older versions of GCC (older than 10780 3.0). 10781 10782 • When the libintl.h header (with its associated libintl library, if 10783 any) is not already installed on the system, it is preferable that 10784 the package builds without internationalization support, rather 10785 than to give a compilation error. 10786 10787 A C preprocessor macro can be used to detect these two cases. 10788Usually, when ‘libintl.h’ was found and not explicitly disabled, the 10789‘ENABLE_NLS’ macro will be defined to 1 in the autoconf generated 10790configuration file (usually called ‘config.h’). In the two negative 10791situations, however, this macro will not be defined, thus it will 10792evaluate to 0 in C preprocessor expressions. 10793 10794 ‘gettext.h’ is a convenience header file for conditional use of 10795‘<libintl.h>’, depending on the ‘ENABLE_NLS’ macro. If ‘ENABLE_NLS’ is 10796set, it includes ‘<libintl.h>’; otherwise it defines no-op substitutes 10797for the libintl.h functions. We recommend the use of ‘"gettext.h"’ over 10798direct use of ‘<libintl.h>’, so that portability to older systems is 10799guaranteed and installers can turn off internationalization if they want 10800to. In the C code, you will then write 10801 10802 #include "gettext.h" 10803 10804instead of 10805 10806 #include <libintl.h> 10807 10808 The location of ‘gettext.h’ is usually in a directory containing 10809auxiliary include files. In many GNU packages, there is a directory 10810‘lib/’ containing helper functions; ‘gettext.h’ fits there. In other 10811packages, it can go into the ‘src’ directory. 10812 10813 Do not install the ‘gettext.h’ file in public locations. Every 10814package that needs it should contain a copy of it on its own. 10815 10816 10817File: gettext.info, Node: autoconf macros, Next: Version Control Issues, Prev: Adjusting Files, Up: Maintainers 10818 1081913.5 Autoconf macros for use in ‘configure.ac’ 10820============================================== 10821 10822 GNU ‘gettext’ installs macros for use in a package’s ‘configure.ac’ 10823or ‘configure.in’. *Note Introduction: (autoconf)Top. The primary 10824macro is, of course, ‘AM_GNU_GETTEXT’. 10825 10826* Menu: 10827 10828* AM_GNU_GETTEXT:: AM_GNU_GETTEXT in ‘gettext.m4’ 10829* AM_GNU_GETTEXT_VERSION:: AM_GNU_GETTEXT_VERSION in ‘gettext.m4’ 10830* AM_GNU_GETTEXT_NEED:: AM_GNU_GETTEXT_NEED in ‘gettext.m4’ 10831* AM_PO_SUBDIRS:: AM_PO_SUBDIRS in ‘po.m4’ 10832* AM_XGETTEXT_OPTION:: AM_XGETTEXT_OPTION in ‘po.m4’ 10833* AM_ICONV:: AM_ICONV in ‘iconv.m4’ 10834 10835 10836File: gettext.info, Node: AM_GNU_GETTEXT, Next: AM_GNU_GETTEXT_VERSION, Up: autoconf macros 10837 1083813.5.1 AM_GNU_GETTEXT in ‘gettext.m4’ 10839------------------------------------- 10840 10841 The ‘AM_GNU_GETTEXT’ macro tests for the presence of the GNU gettext 10842function family in either the C library or a separate ‘libintl’ library 10843(shared or static libraries are both supported). It also invokes 10844‘AM_PO_SUBDIRS’, thus preparing the ‘po/’ directories of the package for 10845building. 10846 10847 ‘AM_GNU_GETTEXT’ accepts up to three optional arguments. The general 10848syntax is 10849 10850 AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL]) 10851 10852 INTLSYMBOL should always be ‘external’. 10853 10854 If NEEDSYMBOL is specified and is ‘need-ngettext’, then GNU gettext 10855implementations (in libc or libintl) without the ‘ngettext()’ function 10856will be ignored. If NEEDSYMBOL is specified and is 10857‘need-formatstring-macros’, then GNU gettext implementations that don’t 10858support the ISO C 99 ‘<inttypes.h>’ formatstring macros will be ignored. 10859Only one NEEDSYMBOL can be specified. These requirements can also be 10860specified by using the macro ‘AM_GNU_GETTEXT_NEED’ elsewhere. To 10861specify more than one requirement, just specify the strongest one among 10862them, or invoke the ‘AM_GNU_GETTEXT_NEED’ macro several times. The 10863hierarchy among the various alternatives is as follows: 10864‘need-formatstring-macros’ implies ‘need-ngettext’. 10865 10866 The ‘AM_GNU_GETTEXT’ macro determines whether GNU gettext is 10867available and should be used. If so, it sets the ‘USE_NLS’ variable to 10868‘yes’; it defines ‘ENABLE_NLS’ to 1 in the autoconf generated 10869configuration file (usually called ‘config.h’); it sets the variables 10870‘LIBINTL’ and ‘LTLIBINTL’ to the linker options for use in a Makefile 10871(‘LIBINTL’ for use without libtool, ‘LTLIBINTL’ for use with libtool); 10872it adds an ‘-I’ option to ‘CPPFLAGS’ if necessary. In the negative 10873case, it sets ‘USE_NLS’ to ‘no’; it sets ‘LIBINTL’ and ‘LTLIBINTL’ to 10874empty and doesn’t change ‘CPPFLAGS’. 10875 10876 The complexities that ‘AM_GNU_GETTEXT’ deals with are the following: 10877 10878 • Some operating systems have ‘gettext’ in the C library, for example 10879 glibc. Some have it in a separate library ‘libintl’. GNU 10880 ‘libintl’ might have been installed as part of the GNU ‘gettext’ 10881 package. 10882 10883 • GNU ‘libintl’, if installed, is not necessarily already in the 10884 search path (‘CPPFLAGS’ for the include file search path, ‘LDFLAGS’ 10885 for the library search path). 10886 10887 • Except for glibc, the operating system’s native ‘gettext’ cannot 10888 exploit the GNU mo files, doesn’t have the necessary locale 10889 dependency features, and cannot convert messages from the catalog’s 10890 text encoding to the user’s locale encoding. 10891 10892 • GNU ‘libintl’, if installed, is not necessarily already in the run 10893 time library search path. To avoid the need for setting an 10894 environment variable like ‘LD_LIBRARY_PATH’, the macro adds the 10895 appropriate run time search path options to the ‘LIBINTL’ and 10896 ‘LTLIBINTL’ variables. This works on most systems, but not on some 10897 operating systems with limited shared library support, like SCO. 10898 10899 • GNU ‘libintl’ relies on POSIX/XSI ‘iconv’. The macro checks for 10900 linker options needed to use iconv and appends them to the 10901 ‘LIBINTL’ and ‘LTLIBINTL’ variables. 10902 10903 10904File: gettext.info, Node: AM_GNU_GETTEXT_VERSION, Next: AM_GNU_GETTEXT_NEED, Prev: AM_GNU_GETTEXT, Up: autoconf macros 10905 1090613.5.2 AM_GNU_GETTEXT_VERSION in ‘gettext.m4’ 10907--------------------------------------------- 10908 10909 The ‘AM_GNU_GETTEXT_VERSION’ macro declares the version number of the 10910GNU gettext infrastructure that is used by the package. 10911 10912 The use of this macro is optional; only the ‘autopoint’ program makes 10913use of it (*note Version Control Issues::). 10914 10915 10916File: gettext.info, Node: AM_GNU_GETTEXT_NEED, Next: AM_PO_SUBDIRS, Prev: AM_GNU_GETTEXT_VERSION, Up: autoconf macros 10917 1091813.5.3 AM_GNU_GETTEXT_NEED in ‘gettext.m4’ 10919------------------------------------------ 10920 10921 The ‘AM_GNU_GETTEXT_NEED’ macro declares a constraint regarding the 10922GNU gettext implementation. The syntax is 10923 10924 AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) 10925 10926 If NEEDSYMBOL is ‘need-ngettext’, then GNU gettext implementations 10927(in libc or libintl) without the ‘ngettext()’ function will be ignored. 10928If NEEDSYMBOL is ‘need-formatstring-macros’, then GNU gettext 10929implementations that don’t support the ISO C 99 ‘<inttypes.h>’ 10930formatstring macros will be ignored. 10931 10932 The optional second argument of ‘AM_GNU_GETTEXT’ is also taken into 10933account. 10934 10935 The ‘AM_GNU_GETTEXT_NEED’ invocations can occur before or after the 10936‘AM_GNU_GETTEXT’ invocation; the order doesn’t matter. 10937 10938 10939File: gettext.info, Node: AM_PO_SUBDIRS, Next: AM_XGETTEXT_OPTION, Prev: AM_GNU_GETTEXT_NEED, Up: autoconf macros 10940 1094113.5.4 AM_PO_SUBDIRS in ‘po.m4’ 10942------------------------------- 10943 10944 The ‘AM_PO_SUBDIRS’ macro prepares the ‘po/’ directories of the 10945package for building. This macro should be used in internationalized 10946programs written in other programming languages than C, C++, Objective 10947C, for example ‘sh’, ‘Python’, ‘Lisp’. See *note Programming 10948Languages:: for a list of programming languages that support 10949localization through PO files. 10950 10951 The ‘AM_PO_SUBDIRS’ macro determines whether internationalization 10952should be used. If so, it sets the ‘USE_NLS’ variable to ‘yes’, 10953otherwise to ‘no’. It also determines the right values for Makefile 10954variables in each ‘po/’ directory. 10955 10956 10957File: gettext.info, Node: AM_XGETTEXT_OPTION, Next: AM_ICONV, Prev: AM_PO_SUBDIRS, Up: autoconf macros 10958 1095913.5.5 AM_XGETTEXT_OPTION in ‘po.m4’ 10960------------------------------------ 10961 10962 The ‘AM_XGETTEXT_OPTION’ macro registers a command-line option to be 10963used in the invocations of ‘xgettext’ in the ‘po/’ directories of the 10964package. 10965 10966 For example, if you have a source file that defines a function 10967‘error_at_line’ whose fifth argument is a format string, you can use 10968 AM_XGETTEXT_OPTION([--flag=error_at_line:5:c-format]) 10969to instruct ‘xgettext’ to mark all translatable strings in ‘gettext’ 10970invocations that occur as fifth argument to this function as ‘c-format’. 10971 10972 See *note xgettext Invocation:: for the list of options that 10973‘xgettext’ accepts. 10974 10975 The use of this macro is an alternative to the use of the 10976‘XGETTEXT_OPTIONS’ variable in ‘po/Makevars’. 10977 10978 10979File: gettext.info, Node: AM_ICONV, Prev: AM_XGETTEXT_OPTION, Up: autoconf macros 10980 1098113.5.6 AM_ICONV in ‘iconv.m4’ 10982----------------------------- 10983 10984 The ‘AM_ICONV’ macro tests for the presence of the POSIX/XSI ‘iconv’ 10985function family in either the C library or a separate ‘libiconv’ 10986library. If found, it sets the ‘am_cv_func_iconv’ variable to ‘yes’; it 10987defines ‘HAVE_ICONV’ to 1 in the autoconf generated configuration file 10988(usually called ‘config.h’); it defines ‘ICONV_CONST’ to ‘const’ or to 10989empty, depending on whether the second argument of ‘iconv()’ is of type 10990‘const char **’ or ‘char **’; it sets the variables ‘LIBICONV’ and 10991‘LTLIBICONV’ to the linker options for use in a Makefile (‘LIBICONV’ for 10992use without libtool, ‘LTLIBICONV’ for use with libtool); it adds an ‘-I’ 10993option to ‘CPPFLAGS’ if necessary. If not found, it sets ‘LIBICONV’ and 10994‘LTLIBICONV’ to empty and doesn’t change ‘CPPFLAGS’. 10995 10996 The complexities that ‘AM_ICONV’ deals with are the following: 10997 10998 • Some operating systems have ‘iconv’ in the C library, for example 10999 glibc. Some have it in a separate library ‘libiconv’, for example 11000 OSF/1 or FreeBSD. Regardless of the operating system, GNU 11001 ‘libiconv’ might have been installed. In that case, it should be 11002 used instead of the operating system’s native ‘iconv’. 11003 11004 • GNU ‘libiconv’, if installed, is not necessarily already in the 11005 search path (‘CPPFLAGS’ for the include file search path, ‘LDFLAGS’ 11006 for the library search path). 11007 11008 • GNU ‘libiconv’ is binary incompatible with some operating system’s 11009 native ‘iconv’, for example on FreeBSD. Use of an ‘iconv.h’ and 11010 ‘libiconv.so’ that don’t fit together would produce program 11011 crashes. 11012 11013 • GNU ‘libiconv’, if installed, is not necessarily already in the run 11014 time library search path. To avoid the need for setting an 11015 environment variable like ‘LD_LIBRARY_PATH’, the macro adds the 11016 appropriate run time search path options to the ‘LIBICONV’ 11017 variable. This works on most systems, but not on some operating 11018 systems with limited shared library support, like SCO. 11019 11020 ‘iconv.m4’ is distributed with the GNU gettext package because 11021‘gettext.m4’ relies on it. 11022 11023 11024File: gettext.info, Node: Version Control Issues, Next: Release Management, Prev: autoconf macros, Up: Maintainers 11025 1102613.6 Integrating with Version Control Systems 11027============================================= 11028 11029 Many projects use version control systems for distributed development 11030and source backup. This section gives some advice how to manage the 11031uses of ‘gettextize’, ‘autopoint’ and ‘autoconf’ on version controlled 11032files. 11033 11034* Menu: 11035 11036* Distributed Development:: Avoiding version mismatch in distributed development 11037* Files under Version Control:: Files to put under version control 11038* Translations under Version Control:: Put PO Files under Version Control 11039* autopoint Invocation:: Invoking the ‘autopoint’ Program 11040 11041 11042File: gettext.info, Node: Distributed Development, Next: Files under Version Control, Up: Version Control Issues 11043 1104413.6.1 Avoiding version mismatch in distributed development 11045----------------------------------------------------------- 11046 11047 In a project development with multiple developers, there should be a 11048single developer who occasionally - when there is desire to upgrade to a 11049new ‘gettext’ version - runs ‘gettextize’ and performs the changes 11050listed in *note Adjusting Files::, and then commits his changes to the 11051repository. 11052 11053 It is highly recommended that all developers on a project use the 11054same version of GNU ‘gettext’ in the package. In other words, if a 11055developer runs ‘gettextize’, he should go the whole way, make the 11056necessary remaining changes and commit his changes to the repository. 11057Otherwise the following damages will likely occur: 11058 11059 • Apparent version mismatch between developers. Since some ‘gettext’ 11060 specific portions in ‘configure.ac’, ‘configure.in’ and 11061 ‘Makefile.am’, ‘Makefile.in’ files depend on the ‘gettext’ version, 11062 the use of infrastructure files belonging to different ‘gettext’ 11063 versions can easily lead to build errors. 11064 11065 • Hidden version mismatch. Such version mismatch can also lead to 11066 malfunctioning of the package, that may be undiscovered by the 11067 developers. The worst case of hidden version mismatch is that 11068 internationalization of the package doesn’t work at all. 11069 11070 • Release risks. All developers implicitly perform constant testing 11071 on a package. This is important in the days and weeks before a 11072 release. If the guy who makes the release tar files uses a 11073 different version of GNU ‘gettext’ than the other developers, the 11074 distribution will be less well tested than if all had been using 11075 the same ‘gettext’ version. For example, it is possible that a 11076 platform specific bug goes undiscovered due to this constellation. 11077 11078 11079File: gettext.info, Node: Files under Version Control, Next: Translations under Version Control, Prev: Distributed Development, Up: Version Control Issues 11080 1108113.6.2 Files to put under version control 11082----------------------------------------- 11083 11084 There are basically three ways to deal with generated files in the 11085context of a version controlled repository, such as ‘configure’ 11086generated from ‘configure.ac’, ‘PARSER.c’ generated from ‘PARSER.y’, or 11087‘po/Makefile.in.in’ autoinstalled by ‘gettextize’ or ‘autopoint’. 11088 11089 1. All generated files are always committed into the repository. 11090 11091 2. All generated files are committed into the repository occasionally, 11092 for example each time a release is made. 11093 11094 3. Generated files are never committed into the repository. 11095 11096 Each of these three approaches has different advantages and 11097drawbacks. 11098 11099 1. The advantage is that anyone can check out the source at any moment 11100 and gets a working build. The drawbacks are: 1a. It requires some 11101 frequent "push" actions by the maintainers. 1b. The repository 11102 grows in size quite fast. 11103 11104 2. The advantage is that anyone can check out the source, and the 11105 usual "./configure; make" will work. The drawbacks are: 2a. The 11106 one who checks out the repository needs tools like GNU ‘automake’, 11107 GNU ‘autoconf’, GNU ‘m4’ installed in his PATH; sometimes he even 11108 needs particular versions of them. 2b. When a release is made and 11109 a commit is made on the generated files, the other developers get 11110 conflicts on the generated files when merging the local work back 11111 to the repository. Although these conflicts are easy to resolve, 11112 they are annoying. 11113 11114 3. The advantage is less work for the maintainers. The drawback is 11115 that anyone who checks out the source not only needs tools like GNU 11116 ‘automake’, GNU ‘autoconf’, GNU ‘m4’ installed in his PATH, but 11117 also that he needs to perform a package specific pre-build step 11118 before being able to "./configure; make". 11119 11120 For the first and second approach, all files modified or brought in 11121by the occasional ‘gettextize’ invocation and update should be committed 11122into the repository. 11123 11124 For the third approach, the maintainer can omit from the repository 11125all the files that ‘gettextize’ mentions as "copy". Instead, he adds to 11126the ‘configure.ac’ or ‘configure.in’ a line of the form 11127 11128 AM_GNU_GETTEXT_VERSION(0.21) 11129 11130and adds to the package’s pre-build script an invocation of ‘autopoint’. 11131For everyone who checks out the source, this ‘autopoint’ invocation will 11132copy into the right place the ‘gettext’ infrastructure files that have 11133been omitted from the repository. 11134 11135 The version number used as argument to ‘AM_GNU_GETTEXT_VERSION’ is 11136the version of the ‘gettext’ infrastructure that the package wants to 11137use. It is also the minimum version number of the ‘autopoint’ program. 11138So, if you write ‘AM_GNU_GETTEXT_VERSION(0.11.5)’ then the developers 11139can have any version >= 0.11.5 installed; the package will work with the 111400.11.5 infrastructure in all developers’ builds. When the maintainer 11141then runs gettextize from, say, version 0.12.1 on the package, the 11142occurrence of ‘AM_GNU_GETTEXT_VERSION(0.11.5)’ will be changed into 11143‘AM_GNU_GETTEXT_VERSION(0.12.1)’, and all other developers that use the 11144CVS will henceforth need to have GNU ‘gettext’ 0.12.1 or newer 11145installed. 11146 11147 11148File: gettext.info, Node: Translations under Version Control, Next: autopoint Invocation, Prev: Files under Version Control, Up: Version Control Issues 11149 1115013.6.3 Put PO Files under Version Control 11151----------------------------------------- 11152 11153 Since translations are valuable assets as well as the source code, it 11154would make sense to put them under version control. The GNU gettext 11155infrastructure supports two ways to deal with translations in the 11156context of a version controlled repository. 11157 11158 1. Both POT file and PO files are committed into the repository. 11159 11160 2. Only PO files are committed into the repository. 11161 11162 If a POT file is absent when building, it will be generated by 11163scanning the source files with ‘xgettext’, and then the PO files are 11164regenerated as a dependency. On the other hand, some maintainers want 11165to keep the POT file unchanged during the development phase. So, even 11166if a POT file is present and older than the source code, it won’t be 11167updated automatically. You can manually update it with ‘make 11168$(DOMAIN).pot-update’, and commit it at certain point. 11169 11170 Special advices for particular version control systems: 11171 11172 • Recent version control systems, Git for instance, ignore file’s 11173 timestamp. In that case, PO files can be accidentally updated even 11174 if a POT file is not updated. To prevent this, you can set 11175 ‘PO_DEPENDS_ON_POT’ variable to ‘no’ in the ‘Makevars’ file and do 11176 ‘make update-po’ manually. 11177 11178 • Location comments such as ‘#: lib/error.c:116’ are sometimes 11179 annoying, since these comments are volatile and may introduce 11180 unwanted change to the working copy when building. To mitigate 11181 this, you can decide to omit those comments from the PO files in 11182 the repository. 11183 11184 This is possible with the ‘--no-location’ option of the ‘msgmerge’ 11185 command (1). The drawback is that, if the location information is 11186 needed, translators have to recover the location comments by 11187 running ‘msgmerge’ again. 11188 11189 ---------- Footnotes ---------- 11190 11191 (1) you can also use it through the ‘MSGMERGE_OPTIONS’ option from 11192‘Makevars’ 11193 11194 11195File: gettext.info, Node: autopoint Invocation, Prev: Translations under Version Control, Up: Version Control Issues 11196 1119713.6.4 Invoking the ‘autopoint’ Program 11198--------------------------------------- 11199 11200 autopoint [OPTION]... 11201 11202 The ‘autopoint’ program copies standard gettext infrastructure files 11203into a source package. It extracts from a macro call of the form 11204‘AM_GNU_GETTEXT_VERSION(VERSION)’, found in the package’s ‘configure.in’ 11205or ‘configure.ac’ file, the gettext version used by the package, and 11206copies the infrastructure files belonging to this version into the 11207package. 11208 11209 To extract the latest available infrastructure which satisfies a 11210version requirement, then you can use the form 11211‘AM_GNU_GETTEXT_REQUIRE_VERSION(VERSION)’ instead. For example, if 11212gettext 0.21 is installed on your system and ‘0.19.1’ is requested, then 11213the infrastructure files of version 0.21 will be copied into a source 11214package. 11215 1121613.6.4.1 Options 11217................ 11218 11219‘-f’ 11220‘--force’ 11221 Force overwriting of files that already exist. 11222 11223‘-n’ 11224‘--dry-run’ 11225 Print modifications but don’t perform them. All file copying 11226 actions that ‘autopoint’ would normally execute are inhibited and 11227 instead only listed on standard output. 11228 1122913.6.4.2 Informative output 11230........................... 11231 11232‘--help’ 11233 Display this help and exit. 11234 11235‘--version’ 11236 Output version information and exit. 11237 11238 ‘autopoint’ supports the GNU ‘gettext’ versions from 0.10.35 to the 11239current one, 0.21. In order to apply ‘autopoint’ to a package using a 11240‘gettext’ version newer than 0.21, you need to install this same version 11241of GNU ‘gettext’ at least. 11242 11243 In packages using GNU ‘automake’, an invocation of ‘autopoint’ should 11244be followed by invocations of ‘aclocal’ and then ‘autoconf’ and 11245‘autoheader’. The reason is that ‘autopoint’ installs some autoconf 11246macro files, which are used by ‘aclocal’ to create ‘aclocal.m4’, and the 11247latter is used by ‘autoconf’ to create the package’s ‘configure’ script 11248and by ‘autoheader’ to create the package’s ‘config.h.in’ include file 11249template. 11250 11251 The name ‘autopoint’ is an abbreviation of ‘auto-po-intl-m4’; in 11252earlier versions, the tool copied or updated mostly files in the ‘po’, 11253‘intl’, ‘m4’ directories. 11254 11255 11256File: gettext.info, Node: Release Management, Prev: Version Control Issues, Up: Maintainers 11257 1125813.7 Creating a Distribution Tarball 11259==================================== 11260 11261 In projects that use GNU ‘automake’, the usual commands for creating 11262a distribution tarball, ‘make dist’ or ‘make distcheck’, automatically 11263update the PO files as needed. 11264 11265 If GNU ‘automake’ is not used, the maintainer needs to perform this 11266update before making a release: 11267 11268 $ ./configure 11269 $ (cd po; make update-po) 11270 $ make distclean 11271 11272 11273File: gettext.info, Node: Installers, Next: Programming Languages, Prev: Maintainers, Up: Top 11274 1127514 The Installer’s and Distributor’s View 11276***************************************** 11277 11278 By default, packages fully using GNU ‘gettext’, internally, are 11279installed in such a way as to allow translation of messages. At 11280_configuration_ time, those packages should automatically detect whether 11281the underlying host system already provides the GNU ‘gettext’ functions. 11282If not, the GNU ‘gettext’ library should be automatically prepared and 11283used. Installers may use special options at configuration time for 11284changing this behavior. The command ‘./configure 11285--with-included-gettext’ bypasses system ‘gettext’ to use the included 11286GNU ‘gettext’ instead, while ‘./configure --disable-nls’ produces 11287programs totally unable to translate messages. 11288 11289 Internationalized packages have usually many ‘LL.po’ files. Unless 11290translations are disabled, all those available are installed together 11291with the package. However, the environment variable ‘LINGUAS’ may be 11292set, prior to configuration, to limit the installed set. ‘LINGUAS’ 11293should then contain a space separated list of two-letter codes, stating 11294which languages are allowed. 11295 11296 11297File: gettext.info, Node: Programming Languages, Next: Data Formats, Prev: Installers, Up: Top 11298 1129915 Other Programming Languages 11300****************************** 11301 11302 While the presentation of ‘gettext’ focuses mostly on C and 11303implicitly applies to C++ as well, its scope is far broader than that: 11304Many programming languages, scripting languages and other textual data 11305like GUI resources or package descriptions can make use of the gettext 11306approach. 11307 11308* Menu: 11309 11310* Language Implementors:: The Language Implementor’s View 11311* Programmers for other Languages:: The Programmer’s View 11312* Translators for other Languages:: The Translator’s View 11313* Maintainers for other Languages:: The Maintainer’s View 11314* List of Programming Languages:: Individual Programming Languages 11315 11316 11317File: gettext.info, Node: Language Implementors, Next: Programmers for other Languages, Up: Programming Languages 11318 1131915.1 The Language Implementor’s View 11320==================================== 11321 11322 All programming and scripting languages that have the notion of 11323strings are eligible to supporting ‘gettext’. Supporting ‘gettext’ 11324means the following: 11325 11326 1. You should add to the language a syntax for translatable strings. 11327 In principle, a function call of ‘gettext’ would do, but a 11328 shorthand syntax helps keeping the legibility of internationalized 11329 programs. For example, in C we use the syntax ‘_("string")’, and 11330 in GNU awk we use the shorthand ‘_"string"’. 11331 11332 2. You should arrange that evaluation of such a translatable string at 11333 runtime calls the ‘gettext’ function, or performs equivalent 11334 processing. 11335 11336 3. Similarly, you should make the functions ‘ngettext’, ‘dcgettext’, 11337 ‘dcngettext’ available from within the language. These functions 11338 are less often used, but are nevertheless necessary for particular 11339 purposes: ‘ngettext’ for correct plural handling, and ‘dcgettext’ 11340 and ‘dcngettext’ for obeying other locale-related environment 11341 variables than ‘LC_MESSAGES’, such as ‘LC_TIME’ or ‘LC_MONETARY’. 11342 For these latter functions, you need to make the ‘LC_*’ constants, 11343 available in the C header ‘<locale.h>’, referenceable from within 11344 the language, usually either as enumeration values or as strings. 11345 11346 4. You should allow the programmer to designate a message domain, 11347 either by making the ‘textdomain’ function available from within 11348 the language, or by introducing a magic variable called 11349 ‘TEXTDOMAIN’. Similarly, you should allow the programmer to 11350 designate where to search for message catalogs, by providing access 11351 to the ‘bindtextdomain’ function or — on native Windows platforms — 11352 to the ‘wbindtextdomain’ function. 11353 11354 5. You should either perform a ‘setlocale (LC_ALL, "")’ call during 11355 the startup of your language runtime, or allow the programmer to do 11356 so. Remember that gettext will act as a no-op if the ‘LC_MESSAGES’ 11357 and ‘LC_CTYPE’ locale categories are not both set. 11358 11359 6. A programmer should have a way to extract translatable strings from 11360 a program into a PO file. The GNU ‘xgettext’ program is being 11361 extended to support very different programming languages. Please 11362 contact the GNU ‘gettext’ maintainers to help them doing this. The 11363 GNU ‘gettext’ maintainers will need from you a formal description 11364 of the lexical structure of source files. It should answer the 11365 questions: 11366 • What does a token look like? 11367 • What does a string literal look like? What escape characters 11368 exist inside a string? 11369 • What escape characters exist outside of strings? If Unicode 11370 escapes are supported, are they applied before or after 11371 tokenization? 11372 • What is the syntax for function calls? How are consecutive 11373 arguments in the same function call separated? 11374 • What is the syntax for comments? 11375 Based on this description, the GNU ‘gettext’ maintainers can add 11376 support to ‘xgettext’. 11377 11378 If the string extractor is best integrated into your language’s 11379 parser, GNU ‘xgettext’ can function as a front end to your string 11380 extractor. 11381 11382 7. The language’s library should have a string formatting facility. 11383 Additionally: 11384 1. There must be a way, in the format string, to denote the 11385 arguments by a positional number or a name. This is needed 11386 because for some languages and some messages with more than 11387 one substitutable argument, the translation will need to 11388 output the substituted arguments in different order. *Note 11389 c-format Flag::. 11390 2. The syntax of format strings must be documented in a way that 11391 translators can understand. The GNU ‘gettext’ manual will be 11392 extended to include a pointer to this documentation. 11393 Based on this, the GNU ‘gettext’ maintainers can add a format 11394 string equivalence checker to ‘msgfmt’, so that translators get 11395 told immediately when they have made a mistake during the 11396 translation of a format string. 11397 11398 8. If the language has more than one implementation, and not all of 11399 the implementations use ‘gettext’, but the programs should be 11400 portable across implementations, you should provide a no-i18n 11401 emulation, that makes the other implementations accept programs 11402 written for yours, without actually translating the strings. 11403 11404 9. To help the programmer in the task of marking translatable strings, 11405 which is sometimes performed using the Emacs PO mode (*note 11406 Marking::), you are welcome to contact the GNU ‘gettext’ 11407 maintainers, so they can add support for your language to 11408 ‘po-mode.el’. 11409 11410 On the implementation side, two approaches are possible, with 11411different effects on portability and copyright: 11412 11413 • You may link against GNU ‘gettext’ functions if they are found in 11414 the C library. For example, an autoconf test for ‘gettext()’ and 11415 ‘ngettext()’ will detect this situation. For the moment, this test 11416 will succeed on GNU systems and on Solaris 11 platforms. No severe 11417 copyright restrictions apply, except if you want to distribute 11418 statically linked binaries. 11419 11420 • You may emulate or reimplement the GNU ‘gettext’ functionality. 11421 This has the advantage of full portability and no copyright 11422 restrictions, but also the drawback that you have to reimplement 11423 the GNU ‘gettext’ features (such as the ‘LANGUAGE’ environment 11424 variable, the locale aliases database, the automatic charset 11425 conversion, and plural handling). 11426 11427 11428File: gettext.info, Node: Programmers for other Languages, Next: Translators for other Languages, Prev: Language Implementors, Up: Programming Languages 11429 1143015.2 The Programmer’s View 11431========================== 11432 11433 For the programmer, the general procedure is the same as for the C 11434language. The Emacs PO mode marking supports other languages, and the 11435GNU ‘xgettext’ string extractor recognizes other languages based on the 11436file extension or a command-line option. In some languages, ‘setlocale’ 11437is not needed because it is already performed by the underlying language 11438runtime. 11439 11440 11441File: gettext.info, Node: Translators for other Languages, Next: Maintainers for other Languages, Prev: Programmers for other Languages, Up: Programming Languages 11442 1144315.3 The Translator’s View 11444========================== 11445 11446 The translator works exactly as in the C language case. The only 11447difference is that when translating format strings, she has to be aware 11448of the language’s particular syntax for positional arguments in format 11449strings. 11450 11451* Menu: 11452 11453* c-format:: C Format Strings 11454* objc-format:: Objective C Format Strings 11455* python-format:: Python Format Strings 11456* java-format:: Java Format Strings 11457* csharp-format:: C# Format Strings 11458* javascript-format:: JavaScript Format Strings 11459* scheme-format:: Scheme Format Strings 11460* lisp-format:: Lisp Format Strings 11461* elisp-format:: Emacs Lisp Format Strings 11462* librep-format:: librep Format Strings 11463* ruby-format:: Ruby Format Strings 11464* sh-format:: Shell Format Strings 11465* awk-format:: awk Format Strings 11466* lua-format:: Lua Format Strings 11467* object-pascal-format:: Object Pascal Format Strings 11468* smalltalk-format:: Smalltalk Format Strings 11469* qt-format:: Qt Format Strings 11470* qt-plural-format:: Qt Plural Format Strings 11471* kde-format:: KDE Format Strings 11472* kde-kuit-format:: KUIT Format Strings 11473* boost-format:: Boost Format Strings 11474* tcl-format:: Tcl Format Strings 11475* perl-format:: Perl Format Strings 11476* php-format:: PHP Format Strings 11477* gcc-internal-format:: GCC internal Format Strings 11478* gfc-internal-format:: GFC internal Format Strings 11479* ycp-format:: YCP Format Strings 11480 11481 11482File: gettext.info, Node: c-format, Next: objc-format, Up: Translators for other Languages 11483 1148415.3.1 C Format Strings 11485----------------------- 11486 11487 C format strings are described in POSIX (IEEE P1003.1 2001), section 11488XSH 3 fprintf(), 11489<http://www.opengroup.org/onlinepubs/007904975/functions/fprintf.html>. 11490See also the fprintf() manual page, 11491<http://www.linuxvalley.it/encyclopedia/ldp/manpage/man3/printf.3.php>, 11492<http://informatik.fh-wuerzburg.de/student/i510/man/printf.html>. 11493 11494 Although format strings with positions that reorder arguments, such 11495as 11496 11497 "Only %2$d bytes free on '%1$s'." 11498 11499which is semantically equivalent to 11500 11501 "'%s' has only %d bytes free." 11502 11503are a POSIX/XSI feature and not specified by ISO C 99, translators can 11504rely on this reordering ability: On the few platforms where ‘printf()’, 11505‘fprintf()’ etc. don’t support this feature natively, ‘libintl.a’ or 11506‘libintl.so’ provides replacement functions, and GNU ‘<libintl.h>’ 11507activates these replacement functions automatically. 11508 11509 As a special feature for Farsi (Persian) and maybe Arabic, 11510translators can insert an ‘I’ flag into numeric format directives. For 11511example, the translation of ‘"%d"’ can be ‘"%Id"’. The effect of this 11512flag, on systems with GNU ‘libc’, is that in the output, the ASCII 11513digits are replaced with the ‘outdigits’ defined in the ‘LC_CTYPE’ 11514locale category. On other systems, the ‘gettext’ function removes this 11515flag, so that it has no effect. 11516 11517 Note that the programmer should _not_ put this flag into the 11518untranslated string. (Putting the ‘I’ format directive flag into an 11519MSGID string would lead to undefined behaviour on platforms without 11520glibc when NLS is disabled.) 11521 11522 11523File: gettext.info, Node: objc-format, Next: python-format, Prev: c-format, Up: Translators for other Languages 11524 1152515.3.2 Objective C Format Strings 11526--------------------------------- 11527 11528 Objective C format strings are like C format strings. They support 11529an additional format directive: "%@", which when executed consumes an 11530argument of type ‘Object *’. 11531 11532 11533File: gettext.info, Node: python-format, Next: java-format, Prev: objc-format, Up: Translators for other Languages 11534 1153515.3.3 Python Format Strings 11536---------------------------- 11537 11538 There are two kinds of format strings in Python: those acceptable to 11539the Python built-in format operator ‘%’, labelled as ‘python-format’, 11540and those acceptable to the ‘format’ method of the ‘str’ object. 11541 11542 Python ‘%’ format strings are described in Python Library reference / 115435. Built-in Types / 5.6. Sequence Types / 115445.6.2. String Formatting Operations. 11545<https://docs.python.org/2/library/stdtypes.html#string-formatting-operations>. 11546 11547 Python brace format strings are described in 11548PEP 3101 – Advanced String Formatting, 11549<https://www.python.org/dev/peps/pep-3101/>. 11550 11551 11552File: gettext.info, Node: java-format, Next: csharp-format, Prev: python-format, Up: Translators for other Languages 11553 1155415.3.4 Java Format Strings 11555-------------------------- 11556 11557 There are two kinds of format strings in Java: those acceptable to 11558the ‘MessageFormat.format’ function, labelled as ‘java-format’, and 11559those acceptable to the ‘String.format’ and ‘PrintStream.printf’ 11560functions, labelled as ‘java-printf-format’. 11561 11562 Java format strings are described in the JDK documentation for class 11563‘java.text.MessageFormat’, 11564<https://docs.oracle.com/javase/7/docs/api/java/text/MessageFormat.html>. 11565See also the ICU documentation 11566<http://icu-project.org/apiref/icu4j/com/ibm/icu/text/MessageFormat.html>. 11567 11568 Java ‘printf’ format strings are described in the JDK documentation 11569for class ‘java.util.Formatter’, 11570<https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html>. 11571 11572 11573File: gettext.info, Node: csharp-format, Next: javascript-format, Prev: java-format, Up: Translators for other Languages 11574 1157515.3.5 C# Format Strings 11576------------------------ 11577 11578 C# format strings are described in the .NET documentation for class 11579‘System.String’ and in 11580<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpConFormattingOverview.asp>. 11581 11582 11583File: gettext.info, Node: javascript-format, Next: scheme-format, Prev: csharp-format, Up: Translators for other Languages 11584 1158515.3.6 JavaScript Format Strings 11586-------------------------------- 11587 11588 Although JavaScript specification itself does not define any format 11589strings, many JavaScript implementations provide printf-like functions. 11590‘xgettext’ understands a set of common format strings used in popular 11591JavaScript implementations including Gjs, Seed, and Node.JS. In such a 11592format string, a directive starts with ‘%’ and is finished by a 11593specifier: ‘%’ denotes a literal percent sign, ‘c’ denotes a character, 11594‘s’ denotes a string, ‘b’, ‘d’, ‘o’, ‘x’, ‘X’ denote an integer, ‘f’ 11595denotes floating-point number, ‘j’ denotes a JSON object. 11596 11597 11598File: gettext.info, Node: scheme-format, Next: lisp-format, Prev: javascript-format, Up: Translators for other Languages 11599 1160015.3.7 Scheme Format Strings 11601---------------------------- 11602 11603 Scheme format strings are documented in the SLIB manual, section 11604Format Specification. 11605 11606 11607File: gettext.info, Node: lisp-format, Next: elisp-format, Prev: scheme-format, Up: Translators for other Languages 11608 1160915.3.8 Lisp Format Strings 11610-------------------------- 11611 11612 Lisp format strings are described in the Common Lisp HyperSpec, 11613chapter 22.3 Formatted Output, 11614<http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/sec_22-3.html>. 11615 11616 11617File: gettext.info, Node: elisp-format, Next: librep-format, Prev: lisp-format, Up: Translators for other Languages 11618 1161915.3.9 Emacs Lisp Format Strings 11620-------------------------------- 11621 11622 Emacs Lisp format strings are documented in the Emacs Lisp reference, 11623section Formatting Strings, 11624<https://www.gnu.org/manual/elisp-manual-21-2.8/html_chapter/elisp_4.html#SEC75>. 11625Note that as of version 21, XEmacs supports numbered argument 11626specifications in format strings while FSF Emacs doesn’t. 11627 11628 11629File: gettext.info, Node: librep-format, Next: ruby-format, Prev: elisp-format, Up: Translators for other Languages 11630 1163115.3.10 librep Format Strings 11632----------------------------- 11633 11634 librep format strings are documented in the librep manual, section 11635Formatted Output, 11636<http://librep.sourceforge.net/librep-manual.html#Formatted%20Output>, 11637<http://www.gwinnup.org/research/docs/librep.html#SEC122>. 11638 11639 11640File: gettext.info, Node: ruby-format, Next: sh-format, Prev: librep-format, Up: Translators for other Languages 11641 1164215.3.11 Ruby Format Strings 11643--------------------------- 11644 11645 Ruby format strings are described in the documentation of the Ruby 11646functions ‘format’ and ‘sprintf’, in 11647<https://ruby-doc.org/core-2.7.1/Kernel.html#method-i-sprintf>. 11648 11649 There are two kinds of format strings in Ruby: 11650 • Those that take a list of arguments without names. They support 11651 argument reordering by use of the ‘%N$’ syntax. Note that if one 11652 argument uses this syntax, all must use this syntax. 11653 • Those that take a hash table, containing named arguments. The 11654 syntax is ‘%<NAME>’. Note that ‘%{NAME}’ is equivalent to 11655 ‘%<NAME>s’. 11656 11657 11658File: gettext.info, Node: sh-format, Next: awk-format, Prev: ruby-format, Up: Translators for other Languages 11659 1166015.3.12 Shell Format Strings 11661---------------------------- 11662 11663 Shell format strings, as supported by GNU gettext and the ‘envsubst’ 11664program, are strings with references to shell variables in the form 11665‘$VARIABLE’ or ‘${VARIABLE}’. References of the form 11666‘${VARIABLE-DEFAULT}’, ‘${VARIABLE:-DEFAULT}’, ‘${VARIABLE=DEFAULT}’, 11667‘${VARIABLE:=DEFAULT}’, ‘${VARIABLE+REPLACEMENT}’, 11668‘${VARIABLE:+REPLACEMENT}’, ‘${VARIABLE?IGNORED}’, 11669‘${VARIABLE:?IGNORED}’, that would be valid inside shell scripts, are 11670not supported. The VARIABLE names must consist solely of alphanumeric 11671or underscore ASCII characters, not start with a digit and be nonempty; 11672otherwise such a variable reference is ignored. 11673 11674 11675File: gettext.info, Node: awk-format, Next: lua-format, Prev: sh-format, Up: Translators for other Languages 11676 1167715.3.13 awk Format Strings 11678-------------------------- 11679 11680 awk format strings are described in the gawk documentation, section 11681Printf, <https://www.gnu.org/manual/gawk/html_node/Printf.html#Printf>. 11682 11683 11684File: gettext.info, Node: lua-format, Next: object-pascal-format, Prev: awk-format, Up: Translators for other Languages 11685 1168615.3.14 Lua Format Strings 11687-------------------------- 11688 11689 Lua format strings are described in the Lua reference manual, section 11690String Manipulation, 11691<https://www.lua.org/manual/5.1/manual.html#pdf-string.format>. 11692 11693 11694File: gettext.info, Node: object-pascal-format, Next: smalltalk-format, Prev: lua-format, Up: Translators for other Languages 11695 1169615.3.15 Object Pascal Format Strings 11697------------------------------------ 11698 11699 Object Pascal format strings are described in the documentation of 11700the Free Pascal runtime library, section Format, 11701<https://www.freepascal.org/docs-html/rtl/sysutils/format.html>. 11702 11703 11704File: gettext.info, Node: smalltalk-format, Next: qt-format, Prev: object-pascal-format, Up: Translators for other Languages 11705 1170615.3.16 Smalltalk Format Strings 11707-------------------------------- 11708 11709 Smalltalk format strings are described in the GNU Smalltalk 11710documentation, class ‘CharArray’, methods ‘bindWith:’ and 11711‘bindWithArguments:’. 11712<https://www.gnu.org/software/smalltalk/gst-manual/gst_68.html#SEC238>. 11713In summary, a directive starts with ‘%’ and is followed by ‘%’ or a 11714nonzero digit (‘1’ to ‘9’). 11715 11716 11717File: gettext.info, Node: qt-format, Next: qt-plural-format, Prev: smalltalk-format, Up: Translators for other Languages 11718 1171915.3.17 Qt Format Strings 11720------------------------- 11721 11722 Qt format strings are described in the documentation of the QString 11723class <file:/usr/lib/qt-4.3.0/doc/html/qstring.html>. In summary, a 11724directive consists of a ‘%’ followed by a digit. The same directive 11725cannot occur more than once in a format string. 11726 11727 11728File: gettext.info, Node: qt-plural-format, Next: kde-format, Prev: qt-format, Up: Translators for other Languages 11729 1173015.3.18 Qt Format Strings 11731------------------------- 11732 11733 Qt format strings are described in the documentation of the 11734QObject::tr method <file:/usr/lib/qt-4.3.0/doc/html/qobject.html>. In 11735summary, the only allowed directive is ‘%n’. 11736 11737 11738File: gettext.info, Node: kde-format, Next: kde-kuit-format, Prev: qt-plural-format, Up: Translators for other Languages 11739 1174015.3.19 KDE Format Strings 11741-------------------------- 11742 11743 KDE 4 format strings are defined as follows: A directive consists of 11744a ‘%’ followed by a non-zero decimal number. If a ‘%n’ occurs in a 11745format strings, all of ‘%1’, ..., ‘%(n-1)’ must occur as well, except 11746possibly one of them. 11747 11748 11749File: gettext.info, Node: kde-kuit-format, Next: boost-format, Prev: kde-format, Up: Translators for other Languages 11750 1175115.3.20 KUIT Format Strings 11752--------------------------- 11753 11754 KUIT (KDE User Interface Text) is compatible with KDE 4 format 11755strings, while it also allows programmers to add semantic information to 11756a format string, through XML markup tags. For example, if the first 11757format directive in a string is a filename, programmers could indicate 11758that with a ‘filename’ tag, like ‘<filename>%1</filename>’. 11759 11760 KUIT format strings are described in 11761<https://api.kde.org/frameworks/ki18n/html/prg_guide.html#kuit_markup>. 11762 11763 11764File: gettext.info, Node: boost-format, Next: tcl-format, Prev: kde-kuit-format, Up: Translators for other Languages 11765 1176615.3.21 Boost Format Strings 11767---------------------------- 11768 11769 Boost format strings are described in the documentation of the 11770‘boost::format’ class, at 11771<https://www.boost.org/libs/format/doc/format.html>. In summary, a 11772directive has either the same syntax as in a C format string, such as 11773‘%1$+5d’, or may be surrounded by vertical bars, such as ‘%|1$+5d|’ or 11774‘%|1$+5|’, or consists of just an argument number between percent signs, 11775such as ‘%1%’. 11776 11777 11778File: gettext.info, Node: tcl-format, Next: perl-format, Prev: boost-format, Up: Translators for other Languages 11779 1178015.3.22 Tcl Format Strings 11781-------------------------- 11782 11783 Tcl format strings are described in the ‘format.n’ manual page, 11784<http://www.scriptics.com/man/tcl8.3/TclCmd/format.htm>. 11785 11786 11787File: gettext.info, Node: perl-format, Next: php-format, Prev: tcl-format, Up: Translators for other Languages 11788 1178915.3.23 Perl Format Strings 11790--------------------------- 11791 11792 There are two kinds of format strings in Perl: those acceptable to 11793the Perl built-in function ‘printf’, labelled as ‘perl-format’, and 11794those acceptable to the ‘libintl-perl’ function ‘__x’, labelled as 11795‘perl-brace-format’. 11796 11797 Perl ‘printf’ format strings are described in the ‘sprintf’ section 11798of ‘man perlfunc’. 11799 11800 Perl brace format strings are described in the 11801‘Locale::TextDomain(3pm)’ manual page of the CPAN package libintl-perl. 11802In brief, Perl format uses placeholders put between braces (‘{’ and 11803‘}’). The placeholder must have the syntax of simple identifiers. 11804 11805 11806File: gettext.info, Node: php-format, Next: gcc-internal-format, Prev: perl-format, Up: Translators for other Languages 11807 1180815.3.24 PHP Format Strings 11809-------------------------- 11810 11811 PHP format strings are described in the documentation of the PHP 11812function ‘sprintf’, in ‘phpdoc/manual/function.sprintf.html’ or 11813<http://www.php.net/manual/en/function.sprintf.php>. 11814 11815 11816File: gettext.info, Node: gcc-internal-format, Next: gfc-internal-format, Prev: php-format, Up: Translators for other Languages 11817 1181815.3.25 GCC internal Format Strings 11819----------------------------------- 11820 11821 These format strings are used inside the GCC sources. In such a 11822format string, a directive starts with ‘%’, is optionally followed by a 11823size specifier ‘l’, an optional flag ‘+’, another optional flag ‘#’, and 11824is finished by a specifier: ‘%’ denotes a literal percent sign, ‘c’ 11825denotes a character, ‘s’ denotes a string, ‘i’ and ‘d’ denote an 11826integer, ‘o’, ‘u’, ‘x’ denote an unsigned integer, ‘.*s’ denotes a 11827string preceded by a width specification, ‘H’ denotes a ‘location_t *’ 11828pointer, ‘D’ denotes a general declaration, ‘F’ denotes a function 11829declaration, ‘T’ denotes a type, ‘A’ denotes a function argument, ‘C’ 11830denotes a tree code, ‘E’ denotes an expression, ‘L’ denotes a 11831programming language, ‘O’ denotes a binary operator, ‘P’ denotes a 11832function parameter, ‘Q’ denotes an assignment operator, ‘V’ denotes a 11833const/volatile qualifier. 11834 11835 11836File: gettext.info, Node: gfc-internal-format, Next: ycp-format, Prev: gcc-internal-format, Up: Translators for other Languages 11837 1183815.3.26 GFC internal Format Strings 11839----------------------------------- 11840 11841 These format strings are used inside the GNU Fortran Compiler 11842sources, that is, the Fortran frontend in the GCC sources. In such a 11843format string, a directive starts with ‘%’ and is finished by a 11844specifier: ‘%’ denotes a literal percent sign, ‘C’ denotes the current 11845source location, ‘L’ denotes a source location, ‘c’ denotes a character, 11846‘s’ denotes a string, ‘i’ and ‘d’ denote an integer, ‘u’ denotes an 11847unsigned integer. ‘i’, ‘d’, and ‘u’ may be preceded by a size specifier 11848‘l’. 11849 11850 11851File: gettext.info, Node: ycp-format, Prev: gfc-internal-format, Up: Translators for other Languages 11852 1185315.3.27 YCP Format Strings 11854-------------------------- 11855 11856 YCP sformat strings are described in the libycp documentation 11857<file:/usr/share/doc/packages/libycp/YCP-builtins.html>. In summary, a 11858directive starts with ‘%’ and is followed by ‘%’ or a nonzero digit (‘1’ 11859to ‘9’). 11860 11861 11862File: gettext.info, Node: Maintainers for other Languages, Next: List of Programming Languages, Prev: Translators for other Languages, Up: Programming Languages 11863 1186415.4 The Maintainer’s View 11865========================== 11866 11867 For the maintainer, the general procedure differs from the C language 11868case: 11869 11870 • If only a single programming language is used, the 11871 ‘XGETTEXT_OPTIONS’ variable in ‘po/Makevars’ (*note po/Makevars::) 11872 should be adjusted to match the ‘xgettext’ options for that 11873 particular programming language. If the package uses more than one 11874 programming language with ‘gettext’ support, it becomes necessary 11875 to change the POT file construction rule in ‘po/Makefile.in.in’. 11876 It is recommended to make one ‘xgettext’ invocation per programming 11877 language, each with the options appropriate for that language, and 11878 to combine the resulting files using ‘msgcat’. 11879 11880 11881File: gettext.info, Node: List of Programming Languages, Prev: Maintainers for other Languages, Up: Programming Languages 11882 1188315.5 Individual Programming Languages 11884===================================== 11885 11886* Menu: 11887 11888* C:: C, C++, Objective C 11889* Python:: Python 11890* Java:: Java 11891* C#:: C# 11892* JavaScript:: JavaScript 11893* Scheme:: GNU guile - Scheme 11894* Common Lisp:: GNU clisp - Common Lisp 11895* clisp C:: GNU clisp C sources 11896* Emacs Lisp:: Emacs Lisp 11897* librep:: librep 11898* Ruby:: Ruby 11899* sh:: sh - Shell Script 11900* bash:: bash - Bourne-Again Shell Script 11901* gawk:: GNU awk 11902* Lua:: Lua 11903* Pascal:: Pascal - Free Pascal Compiler 11904* Smalltalk:: GNU Smalltalk 11905* Vala:: Vala 11906* wxWidgets:: wxWidgets library 11907* Tcl:: Tcl - Tk’s scripting language 11908* Perl:: Perl 11909* PHP:: PHP Hypertext Preprocessor 11910* Pike:: Pike 11911* GCC-source:: GNU Compiler Collection sources 11912* YCP:: YCP - YaST2 scripting language 11913 11914 11915File: gettext.info, Node: C, Next: Python, Up: List of Programming Languages 11916 1191715.5.1 C, C++, Objective C 11918-------------------------- 11919 11920RPMs 11921 gcc, gpp, gobjc, glibc, gettext 11922 11923Ubuntu packages 11924 gcc, g++, gobjc, libc6-dev, libasprintf-dev 11925 11926File extension 11927 For C: ‘c’, ‘h’. 11928 For C++: ‘C’, ‘c++’, ‘cc’, ‘cxx’, ‘cpp’, ‘hpp’. 11929 For Objective C: ‘m’. 11930 11931String syntax 11932 ‘"abc"’ 11933 11934gettext shorthand 11935 ‘_("abc")’ 11936 11937gettext/ngettext functions 11938 ‘gettext’, ‘dgettext’, ‘dcgettext’, ‘ngettext’, ‘dngettext’, 11939 ‘dcngettext’ 11940 11941textdomain 11942 ‘textdomain’ function 11943 11944bindtextdomain 11945 ‘bindtextdomain’ and ‘wbindtextdomain’ functions 11946 11947setlocale 11948 Programmer must call ‘setlocale (LC_ALL, "")’ 11949 11950Prerequisite 11951 ‘#include <libintl.h>’ 11952 ‘#include <locale.h>’ 11953 ‘#define _(string) gettext (string)’ 11954 11955Use or emulate GNU gettext 11956 Use 11957 11958Extractor 11959 ‘xgettext -k_’ 11960 11961Formatting with positions 11962 ‘fprintf "%2$d %1$d"’ 11963 In C++: ‘autosprintf "%2$d %1$d"’ (*note Introduction: 11964 (autosprintf)Top.) 11965 11966Portability 11967 autoconf (gettext.m4) and #if ENABLE_NLS 11968 11969po-mode marking 11970 yes 11971 11972 The following examples are available in the ‘examples’ directory: 11973‘hello-c’, ‘hello-c-gnome’, ‘hello-c++’, ‘hello-c++-qt’, 11974‘hello-c++-kde’, ‘hello-c++-gnome’, ‘hello-c++-wxwidgets’, ‘hello-objc’, 11975‘hello-objc-gnustep’, ‘hello-objc-gnome’. 11976 11977 11978File: gettext.info, Node: Python, Next: Java, Prev: C, Up: List of Programming Languages 11979 1198015.5.2 Python 11981------------- 11982 11983RPMs 11984 python 11985 11986Ubuntu packages 11987 python 11988 11989File extension 11990 ‘py’ 11991 11992String syntax 11993 ‘'abc'’, ‘u'abc'’, ‘r'abc'’, ‘ur'abc'’, 11994 ‘"abc"’, ‘u"abc"’, ‘r"abc"’, ‘ur"abc"’, 11995 ‘'''abc'''’, ‘u'''abc'''’, ‘r'''abc'''’, ‘ur'''abc'''’, 11996 ‘"""abc"""’, ‘u"""abc"""’, ‘r"""abc"""’, ‘ur"""abc"""’ 11997 11998gettext shorthand 11999 ‘_('abc')’ etc. 12000 12001gettext/ngettext functions 12002 ‘gettext.gettext’, ‘gettext.dgettext’, ‘gettext.ngettext’, 12003 ‘gettext.dngettext’, also ‘ugettext’, ‘ungettext’ 12004 12005textdomain 12006 ‘gettext.textdomain’ function, or ‘gettext.install(DOMAIN)’ 12007 function 12008 12009bindtextdomain 12010 ‘gettext.bindtextdomain’ function, or 12011 ‘gettext.install(DOMAIN,LOCALEDIR)’ function 12012 12013setlocale 12014 not used by the gettext emulation 12015 12016Prerequisite 12017 ‘import gettext’ 12018 12019Use or emulate GNU gettext 12020 emulate 12021 12022Extractor 12023 ‘xgettext’ 12024 12025Formatting with positions 12026 ‘'...%(ident)d...' % { 'ident': value }’ 12027 12028Portability 12029 fully portable 12030 12031po-mode marking 12032 — 12033 12034 An example is available in the ‘examples’ directory: ‘hello-python’. 12035 12036 A note about format strings: Python supports format strings with 12037unnamed arguments, such as ‘'...%d...'’, and format strings with named 12038arguments, such as ‘'...%(ident)d...'’. The latter are preferable for 12039internationalized programs, for two reasons: 12040 12041 • When a format string takes more than one argument, the translator 12042 can provide a translation that uses the arguments in a different 12043 order, if the format string uses named arguments. For example, the 12044 translator can reformulate 12045 "'%(volume)s' has only %(freespace)d bytes free." 12046 to 12047 "Only %(freespace)d bytes free on '%(volume)s'." 12048 Additionally, the identifiers also provide some context to the 12049 translator. 12050 12051 • In the context of plural forms, the format string used for the 12052 singular form does not use the numeric argument in many languages. 12053 Even in English, one prefers to write ‘"one hour"’ instead of ‘"1 12054 hour"’. Omitting individual arguments from format strings like 12055 this is only possible with the named argument syntax. (With 12056 unnamed arguments, Python – unlike C – verifies that the format 12057 string uses all supplied arguments.) 12058 12059 12060File: gettext.info, Node: Java, Next: C#, Prev: Python, Up: List of Programming Languages 12061 1206215.5.3 Java 12063----------- 12064 12065RPMs 12066 java, java2 12067 12068Ubuntu packages 12069 default-jdk 12070 12071File extension 12072 ‘java’ 12073 12074String syntax 12075 "abc", """text block""" 12076 12077gettext shorthand 12078 i18n("abc") 12079 12080gettext/ngettext functions 12081 ‘GettextResource.gettext’, ‘GettextResource.ngettext’, 12082 ‘GettextResource.pgettext’, ‘GettextResource.npgettext’ 12083 12084textdomain 12085 —, use ‘ResourceBundle.getResource’ instead 12086 12087bindtextdomain 12088 —, use CLASSPATH instead 12089 12090setlocale 12091 automatic 12092 12093Prerequisite 12094 — 12095 12096Use or emulate GNU gettext 12097 —, uses a Java specific message catalog format 12098 12099Extractor 12100 ‘xgettext -ki18n’ 12101 12102Formatting with positions 12103 ‘MessageFormat.format "{1,number} {0,number}"’ or ‘String.format 12104 "%2$d %1$d"’ 12105 12106Portability 12107 fully portable 12108 12109po-mode marking 12110 — 12111 12112 Before marking strings as internationalizable, uses of the string 12113concatenation operator need to be converted to ‘MessageFormat’ 12114applications. For example, ‘"file "+filename+" not found"’ becomes 12115‘MessageFormat.format("file {0} not found", new Object[] { filename })’. 12116Only after this is done, can the strings be marked and extracted. 12117 12118 GNU gettext uses the native Java internationalization mechanism, 12119namely ‘ResourceBundle’s. There are two formats of ‘ResourceBundle’s: 12120‘.properties’ files and ‘.class’ files. The ‘.properties’ format is a 12121text file which the translators can directly edit, like PO files, but 12122which doesn’t support plural forms. Whereas the ‘.class’ format is 12123compiled from ‘.java’ source code and can support plural forms (provided 12124it is accessed through an appropriate API, see below). 12125 12126 To convert a PO file to a ‘.properties’ file, the ‘msgcat’ program 12127can be used with the option ‘--properties-output’. To convert a 12128‘.properties’ file back to a PO file, the ‘msgcat’ program can be used 12129with the option ‘--properties-input’. All the tools that manipulate PO 12130files can work with ‘.properties’ files as well, if given the 12131‘--properties-input’ and/or ‘--properties-output’ option. 12132 12133 To convert a PO file to a ResourceBundle class, the ‘msgfmt’ program 12134can be used with the option ‘--java’ or ‘--java2’. To convert a 12135ResourceBundle back to a PO file, the ‘msgunfmt’ program can be used 12136with the option ‘--java’. 12137 12138 Two different programmatic APIs can be used to access 12139ResourceBundles. Note that both APIs work with all kinds of 12140ResourceBundles, whether GNU gettext generated classes, or other 12141‘.class’ or ‘.properties’ files. 12142 12143 1. The ‘java.util.ResourceBundle’ API. 12144 12145 In particular, its ‘getString’ function returns a string 12146 translation. Note that a missing translation yields a 12147 ‘MissingResourceException’. 12148 12149 This has the advantage of being the standard API. And it does not 12150 require any additional libraries, only the ‘msgcat’ generated 12151 ‘.properties’ files or the ‘msgfmt’ generated ‘.class’ files. But 12152 it cannot do plural handling, even if the resource was generated by 12153 ‘msgfmt’ from a PO file with plural handling. 12154 12155 2. The ‘gnu.gettext.GettextResource’ API. 12156 12157 Reference documentation in Javadoc 1.1 style format is in the 12158 javadoc2 directory (javadoc2/index.html). 12159 12160 Its ‘gettext’ function returns a string translation. Note that 12161 when a translation is missing, the MSGID argument is returned 12162 unchanged. 12163 12164 This has the advantage of having the ‘ngettext’ function for plural 12165 handling and the ‘pgettext’ and ‘npgettext’ for strings constraint 12166 to a particular context. 12167 12168 To use this API, one needs the ‘libintl.jar’ file which is part of 12169 the GNU gettext package and distributed under the LGPL. 12170 12171 Four examples, using the second API, are available in the ‘examples’ 12172directory: ‘hello-java’, ‘hello-java-awt’, ‘hello-java-swing’, 12173‘hello-java-qtjambi’. 12174 12175 Now, to make use of the API and define a shorthand for ‘getString’, 12176there are three idioms that you can choose from: 12177 12178 • (This one assumes Java 1.5 or newer.) In a unique class of your 12179 project, say ‘Util’, define a static variable holding the 12180 ‘ResourceBundle’ instance and the shorthand: 12181 12182 private static ResourceBundle myResources = 12183 ResourceBundle.getBundle("domain-name"); 12184 public static String i18n(String s) { 12185 return myResources.getString(s); 12186 } 12187 12188 All classes containing internationalized strings then contain 12189 12190 import static Util.i18n; 12191 12192 and the shorthand is used like this: 12193 12194 System.out.println(i18n("Operation completed.")); 12195 12196 • In a unique class of your project, say ‘Util’, define a static 12197 variable holding the ‘ResourceBundle’ instance: 12198 12199 public static ResourceBundle myResources = 12200 ResourceBundle.getBundle("domain-name"); 12201 12202 All classes containing internationalized strings then contain 12203 12204 private static ResourceBundle res = Util.myResources; 12205 private static String i18n(String s) { return res.getString(s); } 12206 12207 and the shorthand is used like this: 12208 12209 System.out.println(i18n("Operation completed.")); 12210 12211 • You add a class with a very short name, say ‘S’, containing just 12212 the definition of the resource bundle and of the shorthand: 12213 12214 public class S { 12215 public static ResourceBundle myResources = 12216 ResourceBundle.getBundle("domain-name"); 12217 public static String i18n(String s) { 12218 return myResources.getString(s); 12219 } 12220 } 12221 12222 and the shorthand is used like this: 12223 12224 System.out.println(S.i18n("Operation completed.")); 12225 12226 Which of the three idioms you choose, will depend on whether your 12227project requires portability to Java versions prior to Java 1.5 and, if 12228so, whether copying two lines of codes into every class is more 12229acceptable in your project than a class with a single-letter name. 12230 12231 12232File: gettext.info, Node: C#, Next: JavaScript, Prev: Java, Up: List of Programming Languages 12233 1223415.5.4 C# 12235--------- 12236 12237RPMs 12238 mono 12239 12240Ubuntu packages 12241 mono-mcs 12242 12243File extension 12244 ‘cs’ 12245 12246String syntax 12247 ‘"abc"’, ‘@"abc"’ 12248 12249gettext shorthand 12250 _("abc") 12251 12252gettext/ngettext functions 12253 ‘GettextResourceManager.GetString’, 12254 ‘GettextResourceManager.GetPluralString’ 12255 ‘GettextResourceManager.GetParticularString’ 12256 ‘GettextResourceManager.GetParticularPluralString’ 12257 12258textdomain 12259 ‘new GettextResourceManager(domain)’ 12260 12261bindtextdomain 12262 —, compiled message catalogs are located in subdirectories of the 12263 directory containing the executable 12264 12265setlocale 12266 automatic 12267 12268Prerequisite 12269 — 12270 12271Use or emulate GNU gettext 12272 —, uses a C# specific message catalog format 12273 12274Extractor 12275 ‘xgettext -k_’ 12276 12277Formatting with positions 12278 ‘String.Format "{1} {0}"’ 12279 12280Portability 12281 fully portable 12282 12283po-mode marking 12284 — 12285 12286 Before marking strings as internationalizable, uses of the string 12287concatenation operator need to be converted to ‘String.Format’ 12288invocations. For example, ‘"file "+filename+" not found"’ becomes 12289‘String.Format("file {0} not found", filename)’. Only after this is 12290done, can the strings be marked and extracted. 12291 12292 GNU gettext uses the native C#/.NET internationalization mechanism, 12293namely the classes ‘ResourceManager’ and ‘ResourceSet’. Applications 12294use the ‘ResourceManager’ methods to retrieve the native language 12295translation of strings. An instance of ‘ResourceSet’ is the in-memory 12296representation of a message catalog file. The ‘ResourceManager’ loads 12297and accesses ‘ResourceSet’ instances as needed to look up the 12298translations. 12299 12300 There are two formats of ‘ResourceSet’s that can be directly loaded 12301by the C# runtime: ‘.resources’ files and ‘.dll’ files. 12302 12303 • The ‘.resources’ format is a binary file usually generated through 12304 the ‘resgen’ or ‘monoresgen’ utility, but which doesn’t support 12305 plural forms. ‘.resources’ files can also be embedded in .NET 12306 ‘.exe’ files. This only affects whether a file system access is 12307 performed to load the message catalog; it doesn’t affect the 12308 contents of the message catalog. 12309 12310 • On the other hand, the ‘.dll’ format is a binary file that is 12311 compiled from ‘.cs’ source code and can support plural forms 12312 (provided it is accessed through the GNU gettext API, see below). 12313 12314 Note that these .NET ‘.dll’ and ‘.exe’ files are not tied to a 12315particular platform; their file format and GNU gettext for C# can be 12316used on any platform. 12317 12318 To convert a PO file to a ‘.resources’ file, the ‘msgfmt’ program can 12319be used with the option ‘--csharp-resources’. To convert a ‘.resources’ 12320file back to a PO file, the ‘msgunfmt’ program can be used with the 12321option ‘--csharp-resources’. You can also, in some cases, use the 12322‘monoresgen’ program (from the ‘mono’/‘mcs’ package). This program can 12323also convert a ‘.resources’ file back to a PO file. But beware: as of 12324this writing (January 2004), the ‘monoresgen’ converter is quite buggy. 12325 12326 To convert a PO file to a ‘.dll’ file, the ‘msgfmt’ program can be 12327used with the option ‘--csharp’. The result will be a ‘.dll’ file 12328containing a subclass of ‘GettextResourceSet’, which itself is a 12329subclass of ‘ResourceSet’. To convert a ‘.dll’ file containing a 12330‘GettextResourceSet’ subclass back to a PO file, the ‘msgunfmt’ program 12331can be used with the option ‘--csharp’. 12332 12333 The advantages of the ‘.dll’ format over the ‘.resources’ format are: 12334 12335 1. Freedom to localize: Users can add their own translations to an 12336 application after it has been built and distributed. Whereas when 12337 the programmer uses a ‘ResourceManager’ constructor provided by the 12338 system, the set of ‘.resources’ files for an application must be 12339 specified when the application is built and cannot be extended 12340 afterwards. 12341 12342 2. Plural handling: A message catalog in ‘.dll’ format supports the 12343 plural handling function ‘GetPluralString’. Whereas ‘.resources’ 12344 files can only contain data and only support lookups that depend on 12345 a single string. 12346 12347 3. Context handling: A message catalog in ‘.dll’ format supports the 12348 query-with-context functions ‘GetParticularString’ and 12349 ‘GetParticularPluralString’. Whereas ‘.resources’ files can only 12350 contain data and only support lookups that depend on a single 12351 string. 12352 12353 4. The ‘GettextResourceManager’ that loads the message catalogs in 12354 ‘.dll’ format also provides for inheritance on a per-message basis. 12355 For example, in Austrian (‘de_AT’) locale, translations from the 12356 German (‘de’) message catalog will be used for messages not found 12357 in the Austrian message catalog. This has the consequence that the 12358 Austrian translators need only translate those few messages for 12359 which the translation into Austrian differs from the German one. 12360 Whereas when working with ‘.resources’ files, each message catalog 12361 must provide the translations of all messages by itself. 12362 12363 5. The ‘GettextResourceManager’ that loads the message catalogs in 12364 ‘.dll’ format also provides for a fallback: The English MSGID is 12365 returned when no translation can be found. Whereas when working 12366 with ‘.resources’ files, a language-neutral ‘.resources’ file must 12367 explicitly be provided as a fallback. 12368 12369 On the side of the programmatic APIs, the programmer can use either 12370the standard ‘ResourceManager’ API and the GNU ‘GettextResourceManager’ 12371API. The latter is an extension of the former, because 12372‘GettextResourceManager’ is a subclass of ‘ResourceManager’. 12373 12374 1. The ‘System.Resources.ResourceManager’ API. 12375 12376 This API works with resources in ‘.resources’ format. 12377 12378 The creation of the ‘ResourceManager’ is done through 12379 new ResourceManager(domainname, Assembly.GetExecutingAssembly()) 12380 12381 The ‘GetString’ function returns a string’s translation. Note that 12382 this function returns null when a translation is missing (i.e. not 12383 even found in the fallback resource file). 12384 12385 2. The ‘GNU.Gettext.GettextResourceManager’ API. 12386 12387 This API works with resources in ‘.dll’ format. 12388 12389 Reference documentation is in the csharpdoc directory 12390 (csharpdoc/index.html). 12391 12392 The creation of the ‘ResourceManager’ is done through 12393 new GettextResourceManager(domainname) 12394 12395 The ‘GetString’ function returns a string’s translation. Note that 12396 when a translation is missing, the MSGID argument is returned 12397 unchanged. 12398 12399 The ‘GetPluralString’ function returns a string translation with 12400 plural handling, like the ‘ngettext’ function in C. 12401 12402 The ‘GetParticularString’ function returns a string’s translation, 12403 specific to a particular context, like the ‘pgettext’ function in 12404 C. Note that when a translation is missing, the MSGID argument is 12405 returned unchanged. 12406 12407 The ‘GetParticularPluralString’ function returns a string 12408 translation, specific to a particular context, with plural 12409 handling, like the ‘npgettext’ function in C. 12410 12411 To use this API, one needs the ‘GNU.Gettext.dll’ file which is part 12412 of the GNU gettext package and distributed under the LGPL. 12413 12414 You can also mix both approaches: use the 12415‘GNU.Gettext.GettextResourceManager’ constructor, but otherwise use only 12416the ‘ResourceManager’ type and only the ‘GetString’ method. This is 12417appropriate when you want to profit from the tools for PO files, but 12418don’t want to change an existing source code that uses ‘ResourceManager’ 12419and don’t (yet) need the ‘GetPluralString’ method. 12420 12421 Two examples, using the second API, are available in the ‘examples’ 12422directory: ‘hello-csharp’, ‘hello-csharp-forms’. 12423 12424 Now, to make use of the API and define a shorthand for ‘GetString’, 12425there are two idioms that you can choose from: 12426 12427 • In a unique class of your project, say ‘Util’, define a static 12428 variable holding the ‘ResourceManager’ instance: 12429 12430 public static GettextResourceManager MyResourceManager = 12431 new GettextResourceManager("domain-name"); 12432 12433 All classes containing internationalized strings then contain 12434 12435 private static GettextResourceManager Res = Util.MyResourceManager; 12436 private static String _(String s) { return Res.GetString(s); } 12437 12438 and the shorthand is used like this: 12439 12440 Console.WriteLine(_("Operation completed.")); 12441 12442 • You add a class with a very short name, say ‘S’, containing just 12443 the definition of the resource manager and of the shorthand: 12444 12445 public class S { 12446 public static GettextResourceManager MyResourceManager = 12447 new GettextResourceManager("domain-name"); 12448 public static String _(String s) { 12449 return MyResourceManager.GetString(s); 12450 } 12451 } 12452 12453 and the shorthand is used like this: 12454 12455 Console.WriteLine(S._("Operation completed.")); 12456 12457 Which of the two idioms you choose, will depend on whether copying 12458two lines of codes into every class is more acceptable in your project 12459than a class with a single-letter name. 12460 12461 12462File: gettext.info, Node: JavaScript, Next: Scheme, Prev: C#, Up: List of Programming Languages 12463 1246415.5.5 JavaScript 12465----------------- 12466 12467RPMs 12468 js 12469 12470Ubuntu packages 12471 gjs 12472 12473File extension 12474 ‘js’ 12475 12476String syntax 12477 12478 • ‘"abc"’ 12479 12480 • ‘'abc'’ 12481 12482 • ‘`abc`’ 12483 12484gettext shorthand 12485 ‘_("abc")’ 12486 12487gettext/ngettext functions 12488 ‘gettext’, ‘dgettext’, ‘dcgettext’, ‘ngettext’, ‘dngettext’ 12489 12490textdomain 12491 ‘textdomain’ function 12492 12493bindtextdomain 12494 ‘bindtextdomain’ function 12495 12496setlocale 12497 automatic 12498 12499Prerequisite 12500 — 12501 12502Use or emulate GNU gettext 12503 use, or emulate 12504 12505Extractor 12506 ‘xgettext’ 12507 12508Formatting with positions 12509 — 12510 12511Portability 12512 On platforms without gettext, the functions are not available. 12513 12514po-mode marking 12515 — 12516 12517 12518File: gettext.info, Node: Scheme, Next: Common Lisp, Prev: JavaScript, Up: List of Programming Languages 12519 1252015.5.6 GNU guile - Scheme 12521------------------------- 12522 12523RPMs 12524 guile 12525 12526Ubuntu packages 12527 guile-2.0 12528 12529File extension 12530 ‘scm’ 12531 12532String syntax 12533 ‘"abc"’ 12534 12535gettext shorthand 12536 ‘(_ "abc")’, ‘_"abc"’ (GIMP script-fu extension) 12537 12538gettext/ngettext functions 12539 ‘gettext’, ‘ngettext’ 12540 12541textdomain 12542 ‘textdomain’ 12543 12544bindtextdomain 12545 ‘bindtextdomain’ 12546 12547setlocale 12548 ‘(catch #t (lambda () (setlocale LC_ALL "")) (lambda args #f))’ 12549 12550Prerequisite 12551 ‘(use-modules (ice-9 format))’ 12552 12553Use or emulate GNU gettext 12554 use 12555 12556Extractor 12557 ‘xgettext -k_’ 12558 12559Formatting with positions 12560 — 12561 12562Portability 12563 On platforms without gettext, no translation. 12564 12565po-mode marking 12566 — 12567 12568 An example is available in the ‘examples’ directory: ‘hello-guile’. 12569 12570 12571File: gettext.info, Node: Common Lisp, Next: clisp C, Prev: Scheme, Up: List of Programming Languages 12572 1257315.5.7 GNU clisp - Common Lisp 12574------------------------------ 12575 12576RPMs 12577 clisp 2.28 or newer 12578 12579Ubuntu packages 12580 clisp 12581 12582File extension 12583 ‘lisp’ 12584 12585String syntax 12586 ‘"abc"’ 12587 12588gettext shorthand 12589 ‘(_ "abc")’, ‘(ENGLISH "abc")’ 12590 12591gettext/ngettext functions 12592 ‘i18n:gettext’, ‘i18n:ngettext’ 12593 12594textdomain 12595 ‘i18n:textdomain’ 12596 12597bindtextdomain 12598 ‘i18n:textdomaindir’ 12599 12600setlocale 12601 automatic 12602 12603Prerequisite 12604 — 12605 12606Use or emulate GNU gettext 12607 use 12608 12609Extractor 12610 ‘xgettext -k_ -kENGLISH’ 12611 12612Formatting with positions 12613 ‘format "~1@*~D ~0@*~D"’ 12614 12615Portability 12616 On platforms without gettext, no translation. 12617 12618po-mode marking 12619 — 12620 12621 An example is available in the ‘examples’ directory: ‘hello-clisp’. 12622 12623 12624File: gettext.info, Node: clisp C, Next: Emacs Lisp, Prev: Common Lisp, Up: List of Programming Languages 12625 1262615.5.8 GNU clisp C sources 12627-------------------------- 12628 12629RPMs 12630 clisp 12631 12632Ubuntu packages 12633 clisp 12634 12635File extension 12636 ‘d’ 12637 12638String syntax 12639 ‘"abc"’ 12640 12641gettext shorthand 12642 ‘ENGLISH ? "abc" : ""’ 12643 ‘GETTEXT("abc")’ 12644 ‘GETTEXTL("abc")’ 12645 12646gettext/ngettext functions 12647 ‘clgettext’, ‘clgettextl’ 12648 12649textdomain 12650 — 12651 12652bindtextdomain 12653 — 12654 12655setlocale 12656 automatic 12657 12658Prerequisite 12659 ‘#include "lispbibl.c"’ 12660 12661Use or emulate GNU gettext 12662 use 12663 12664Extractor 12665 ‘clisp-xgettext’ 12666 12667Formatting with positions 12668 ‘fprintf "%2$d %1$d"’ 12669 12670Portability 12671 On platforms without gettext, no translation. 12672 12673po-mode marking 12674 — 12675 12676 12677File: gettext.info, Node: Emacs Lisp, Next: librep, Prev: clisp C, Up: List of Programming Languages 12678 1267915.5.9 Emacs Lisp 12680----------------- 12681 12682RPMs 12683 emacs, xemacs 12684 12685Ubuntu packages 12686 emacs, xemacs21 12687 12688File extension 12689 ‘el’ 12690 12691String syntax 12692 ‘"abc"’ 12693 12694gettext shorthand 12695 ‘(_"abc")’ 12696 12697gettext/ngettext functions 12698 ‘gettext’, ‘dgettext’ (xemacs only) 12699 12700textdomain 12701 ‘domain’ special form (xemacs only) 12702 12703bindtextdomain 12704 ‘bind-text-domain’ function (xemacs only) 12705 12706setlocale 12707 automatic 12708 12709Prerequisite 12710 — 12711 12712Use or emulate GNU gettext 12713 use 12714 12715Extractor 12716 ‘xgettext’ 12717 12718Formatting with positions 12719 ‘format "%2$d %1$d"’ 12720 12721Portability 12722 Only XEmacs. Without ‘I18N3’ defined at build time, no 12723 translation. 12724 12725po-mode marking 12726 — 12727 12728 12729File: gettext.info, Node: librep, Next: Ruby, Prev: Emacs Lisp, Up: List of Programming Languages 12730 1273115.5.10 librep 12732-------------- 12733 12734RPMs 12735 librep 0.15.3 or newer 12736 12737Ubuntu packages 12738 librep16 12739 12740File extension 12741 ‘jl’ 12742 12743String syntax 12744 ‘"abc"’ 12745 12746gettext shorthand 12747 ‘(_"abc")’ 12748 12749gettext/ngettext functions 12750 ‘gettext’ 12751 12752textdomain 12753 ‘textdomain’ function 12754 12755bindtextdomain 12756 ‘bindtextdomain’ function 12757 12758setlocale 12759 — 12760 12761Prerequisite 12762 ‘(require 'rep.i18n.gettext)’ 12763 12764Use or emulate GNU gettext 12765 use 12766 12767Extractor 12768 ‘xgettext’ 12769 12770Formatting with positions 12771 ‘format "%2$d %1$d"’ 12772 12773Portability 12774 On platforms without gettext, no translation. 12775 12776po-mode marking 12777 — 12778 12779 An example is available in the ‘examples’ directory: ‘hello-librep’. 12780 12781 12782File: gettext.info, Node: Ruby, Next: sh, Prev: librep, Up: List of Programming Languages 12783 1278415.5.11 Ruby 12785------------ 12786 12787RPMs 12788 ruby, ruby-gettext 12789 12790Ubuntu packages 12791 ruby, ruby-gettext 12792 12793File extension 12794 ‘rb’ 12795 12796String syntax 12797 ‘"abc"’, ‘'abc'’, ‘%q/abc/’ etc., ‘%q(abc)’, ‘%q[abc]’, ‘%q{abc}’ 12798 12799gettext shorthand 12800 ‘_("abc")’ 12801 12802gettext/ngettext functions 12803 ‘gettext’, ‘ngettext’ 12804 12805textdomain 12806 — 12807 12808bindtextdomain 12809 ‘bindtextdomain’ function 12810 12811setlocale 12812 — 12813 12814Prerequisite 12815 ‘require 'gettext'’ ‘include GetText’ 12816 12817Use or emulate GNU gettext 12818 emulate 12819 12820Extractor 12821 ‘xgettext’ 12822 12823Formatting with positions 12824 ‘sprintf("%2$d %1$d", x, y)’ 12825 ‘"%{new} replaces %{old}" % {:old => oldvalue, :new => newvalue}’ 12826 12827Portability 12828 fully portable 12829 12830po-mode marking 12831 — 12832 12833 12834File: gettext.info, Node: sh, Next: bash, Prev: Ruby, Up: List of Programming Languages 12835 1283615.5.12 sh - Shell Script 12837------------------------- 12838 12839RPMs 12840 bash, gettext 12841 12842Ubuntu packages 12843 bash, gettext-base 12844 12845File extension 12846 ‘sh’ 12847 12848String syntax 12849 ‘"abc"’, ‘'abc'’, ‘abc’ 12850 12851gettext shorthand 12852 ‘"`gettext \"abc\"`"’ 12853 12854gettext/ngettext functions 12855 ‘gettext’, ‘ngettext’ programs 12856 ‘eval_gettext’, ‘eval_ngettext’, ‘eval_pgettext’, ‘eval_npgettext’ 12857 shell functions 12858 12859textdomain 12860 environment variable ‘TEXTDOMAIN’ 12861 12862bindtextdomain 12863 environment variable ‘TEXTDOMAINDIR’ 12864 12865setlocale 12866 automatic 12867 12868Prerequisite 12869 ‘. gettext.sh’ 12870 12871Use or emulate GNU gettext 12872 use 12873 12874Extractor 12875 ‘xgettext’ 12876 12877Formatting with positions 12878 — 12879 12880Portability 12881 fully portable 12882 12883po-mode marking 12884 — 12885 12886 An example is available in the ‘examples’ directory: ‘hello-sh’. 12887 12888* Menu: 12889 12890* Preparing Shell Scripts:: Preparing Shell Scripts for Internationalization 12891* gettext.sh:: Contents of ‘gettext.sh’ 12892* gettext Invocation:: Invoking the ‘gettext’ program 12893* ngettext Invocation:: Invoking the ‘ngettext’ program 12894* envsubst Invocation:: Invoking the ‘envsubst’ program 12895* eval_gettext Invocation:: Invoking the ‘eval_gettext’ function 12896* eval_ngettext Invocation:: Invoking the ‘eval_ngettext’ function 12897* eval_pgettext Invocation:: Invoking the ‘eval_pgettext’ function 12898* eval_npgettext Invocation:: Invoking the ‘eval_npgettext’ function 12899 12900 12901File: gettext.info, Node: Preparing Shell Scripts, Next: gettext.sh, Up: sh 12902 1290315.5.12.1 Preparing Shell Scripts for Internationalization 12904.......................................................... 12905 12906 Preparing a shell script for internationalization is conceptually 12907similar to the steps described in *note Sources::. The concrete steps 12908for shell scripts are as follows. 12909 12910 1. Insert the line 12911 12912 . gettext.sh 12913 12914 near the top of the script. ‘gettext.sh’ is a shell function 12915 library that provides the functions ‘eval_gettext’ (see *note 12916 eval_gettext Invocation::), ‘eval_ngettext’ (see *note 12917 eval_ngettext Invocation::), ‘eval_pgettext’ (see *note 12918 eval_pgettext Invocation::), and ‘eval_npgettext’ (see *note 12919 eval_npgettext Invocation::). You have to ensure that ‘gettext.sh’ 12920 can be found in the ‘PATH’. 12921 12922 2. Set and export the ‘TEXTDOMAIN’ and ‘TEXTDOMAINDIR’ environment 12923 variables. Usually ‘TEXTDOMAIN’ is the package or program name, 12924 and ‘TEXTDOMAINDIR’ is the absolute pathname corresponding to 12925 ‘$prefix/share/locale’, where ‘$prefix’ is the installation 12926 location. 12927 12928 TEXTDOMAIN=@PACKAGE@ 12929 export TEXTDOMAIN 12930 TEXTDOMAINDIR=@LOCALEDIR@ 12931 export TEXTDOMAINDIR 12932 12933 3. Prepare the strings for translation, as described in *note 12934 Preparing Strings::. 12935 12936 4. Simplify translatable strings so that they don’t contain command 12937 substitution (‘"`...`"’ or ‘"$(...)"’), variable access with 12938 defaulting (like ‘${VARIABLE-DEFAULT}’), access to positional 12939 arguments (like ‘$0’, ‘$1’, ...) or highly volatile shell 12940 variables (like ‘$?’). This can always be done through simple 12941 local code restructuring. For example, 12942 12943 echo "Usage: $0 [OPTION] FILE..." 12944 12945 becomes 12946 12947 program_name=$0 12948 echo "Usage: $program_name [OPTION] FILE..." 12949 12950 Similarly, 12951 12952 echo "Remaining files: `ls | wc -l`" 12953 12954 becomes 12955 12956 filecount="`ls | wc -l`" 12957 echo "Remaining files: $filecount" 12958 12959 5. For each translatable string, change the output command ‘echo’ or 12960 ‘$echo’ to ‘gettext’ (if the string contains no references to shell 12961 variables) or to ‘eval_gettext’ (if it refers to shell variables), 12962 followed by a no-argument ‘echo’ command (to account for the 12963 terminating newline). Similarly, for cases with plural handling, 12964 replace a conditional ‘echo’ command with an invocation of 12965 ‘ngettext’ or ‘eval_ngettext’, followed by a no-argument ‘echo’ 12966 command. 12967 12968 When doing this, you also need to add an extra backslash before the 12969 dollar sign in references to shell variables, so that the 12970 ‘eval_gettext’ function receives the translatable string before the 12971 variable values are substituted into it. For example, 12972 12973 echo "Remaining files: $filecount" 12974 12975 becomes 12976 12977 eval_gettext "Remaining files: \$filecount"; echo 12978 12979 If the output command is not ‘echo’, you can make it use ‘echo’ 12980 nevertheless, through the use of backquotes. However, note that 12981 inside backquotes, backslashes must be doubled to be effective 12982 (because the backquoting eats one level of backslashes). For 12983 example, assuming that ‘error’ is a shell function that signals an 12984 error, 12985 12986 error "file not found: $filename" 12987 12988 is first transformed into 12989 12990 error "`echo \"file not found: \$filename\"`" 12991 12992 which then becomes 12993 12994 error "`eval_gettext \"file not found: \\\$filename\"`" 12995 12996 12997File: gettext.info, Node: gettext.sh, Next: gettext Invocation, Prev: Preparing Shell Scripts, Up: sh 12998 1299915.5.12.2 Contents of ‘gettext.sh’ 13000.................................. 13001 13002 ‘gettext.sh’, contained in the run-time package of GNU gettext, 13003provides the following: 13004 13005 • $echo The variable ‘echo’ is set to a command that outputs its 13006 first argument and a newline, without interpreting backslashes in 13007 the argument string. 13008 13009 • eval_gettext See *note eval_gettext Invocation::. 13010 13011 • eval_ngettext See *note eval_ngettext Invocation::. 13012 13013 • eval_pgettext See *note eval_pgettext Invocation::. 13014 13015 • eval_npgettext See *note eval_npgettext Invocation::. 13016 13017 13018File: gettext.info, Node: gettext Invocation, Next: ngettext Invocation, Prev: gettext.sh, Up: sh 13019 1302015.5.12.3 Invoking the ‘gettext’ program 13021........................................ 13022 13023 gettext [OPTION] [[TEXTDOMAIN] MSGID] 13024 gettext [OPTION] -s [MSGID]... 13025 13026 The ‘gettext’ program displays the native language translation of a 13027textual message. 13028 13029*Arguments* 13030 13031‘-c CONTEXT’ 13032‘--context=CONTEXT’ 13033 Specify the context for the messages to be translated. See *note 13034 Contexts:: for details. 13035 13036‘-d TEXTDOMAIN’ 13037‘--domain=TEXTDOMAIN’ 13038 Retrieve translated messages from TEXTDOMAIN. Usually a TEXTDOMAIN 13039 corresponds to a package, a program, or a module of a program. 13040 13041‘-e’ 13042 Enable expansion of some escape sequences. This option is for 13043 compatibility with the ‘echo’ program or shell built-in. The 13044 escape sequences ‘\a’, ‘\b’, ‘\c’, ‘\f’, ‘\n’, ‘\r’, ‘\t’, ‘\v’, 13045 ‘\\’, and ‘\’ followed by one to three octal digits, are 13046 interpreted like the System V ‘echo’ program did. 13047 13048‘-E’ 13049 This option is only for compatibility with the ‘echo’ program or 13050 shell built-in. It has no effect. 13051 13052‘-h’ 13053‘--help’ 13054 Display this help and exit. 13055 13056‘-n’ 13057 This option has only an effect if the ‘-s’ option is given. It 13058 suppresses the additional newline at the end. 13059 13060‘-V’ 13061‘--version’ 13062 Output version information and exit. 13063 13064‘[TEXTDOMAIN] MSGID’ 13065 Retrieve translated message corresponding to MSGID from TEXTDOMAIN. 13066 13067 If the TEXTDOMAIN parameter is not given, the domain is determined 13068from the environment variable ‘TEXTDOMAIN’. If the message catalog is 13069not found in the regular directory, another location can be specified 13070with the environment variable ‘TEXTDOMAINDIR’. 13071 13072 When used with the ‘-s’ option the program behaves like the ‘echo’ 13073command. But it does not simply copy its arguments to stdout. Instead 13074those messages found in the selected catalog are translated. Also, a 13075newline is added at the end, unless either the option ‘-n’ is specified 13076or the option ‘-e’ is specified and some of the argument strings 13077contains a ‘\c’ escape sequence. 13078 13079 Note: ‘xgettext’ supports only the one-argument form of the ‘gettext’ 13080invocation, where no options are present and the TEXTDOMAIN is implicit, 13081from the environment. 13082 13083 13084File: gettext.info, Node: ngettext Invocation, Next: envsubst Invocation, Prev: gettext Invocation, Up: sh 13085 1308615.5.12.4 Invoking the ‘ngettext’ program 13087......................................... 13088 13089 ngettext [OPTION] [TEXTDOMAIN] MSGID MSGID-PLURAL COUNT 13090 13091 The ‘ngettext’ program displays the native language translation of a 13092textual message whose grammatical form depends on a number. 13093 13094*Arguments* 13095 13096‘-c CONTEXT’ 13097‘--context=CONTEXT’ 13098 Specify the context for the messages to be translated. See *note 13099 Contexts:: for details. 13100 13101‘-d TEXTDOMAIN’ 13102‘--domain=TEXTDOMAIN’ 13103 Retrieve translated messages from TEXTDOMAIN. Usually a TEXTDOMAIN 13104 corresponds to a package, a program, or a module of a program. 13105 13106‘-e’ 13107 Enable expansion of some escape sequences. This option is for 13108 compatibility with the ‘gettext’ program. The escape sequences 13109 ‘\a’, ‘\b’, ‘\f’, ‘\n’, ‘\r’, ‘\t’, ‘\v’, ‘\\’, and ‘\’ followed by 13110 one to three octal digits, are interpreted like the System V ‘echo’ 13111 program did. 13112 13113‘-E’ 13114 This option is only for compatibility with the ‘gettext’ program. 13115 It has no effect. 13116 13117‘-h’ 13118‘--help’ 13119 Display this help and exit. 13120 13121‘-V’ 13122‘--version’ 13123 Output version information and exit. 13124 13125‘TEXTDOMAIN’ 13126 Retrieve translated message from TEXTDOMAIN. 13127 13128‘MSGID MSGID-PLURAL’ 13129 Translate MSGID (English singular) / MSGID-PLURAL (English plural). 13130 13131‘COUNT’ 13132 Choose singular/plural form based on this value. 13133 13134 If the TEXTDOMAIN parameter is not given, the domain is determined 13135from the environment variable ‘TEXTDOMAIN’. If the message catalog is 13136not found in the regular directory, another location can be specified 13137with the environment variable ‘TEXTDOMAINDIR’. 13138 13139 Note: ‘xgettext’ supports only the three-arguments form of the 13140‘ngettext’ invocation, where no options are present and the TEXTDOMAIN 13141is implicit, from the environment. 13142 13143 13144File: gettext.info, Node: envsubst Invocation, Next: eval_gettext Invocation, Prev: ngettext Invocation, Up: sh 13145 1314615.5.12.5 Invoking the ‘envsubst’ program 13147......................................... 13148 13149 envsubst [OPTION] [SHELL-FORMAT] 13150 13151 The ‘envsubst’ program substitutes the values of environment 13152variables. 13153 13154*Operation mode* 13155 13156‘-v’ 13157‘--variables’ 13158 Output the variables occurring in SHELL-FORMAT. 13159 13160*Informative output* 13161 13162‘-h’ 13163‘--help’ 13164 Display this help and exit. 13165 13166‘-V’ 13167‘--version’ 13168 Output version information and exit. 13169 13170 In normal operation mode, standard input is copied to standard 13171output, with references to environment variables of the form ‘$VARIABLE’ 13172or ‘${VARIABLE}’ being replaced with the corresponding values. If a 13173SHELL-FORMAT is given, only those environment variables that are 13174referenced in SHELL-FORMAT are substituted; otherwise all environment 13175variables references occurring in standard input are substituted. 13176 13177 These substitutions are a subset of the substitutions that a shell 13178performs on unquoted and double-quoted strings. Other kinds of 13179substitutions done by a shell, such as ‘${VARIABLE-DEFAULT}’ or 13180‘$(COMMAND-LIST)’ or ‘`COMMAND-LIST`’, are not performed by the 13181‘envsubst’ program, due to security reasons. 13182 13183 When ‘--variables’ is used, standard input is ignored, and the output 13184consists of the environment variables that are referenced in 13185SHELL-FORMAT, one per line. 13186 13187 13188File: gettext.info, Node: eval_gettext Invocation, Next: eval_ngettext Invocation, Prev: envsubst Invocation, Up: sh 13189 1319015.5.12.6 Invoking the ‘eval_gettext’ function 13191.............................................. 13192 13193 eval_gettext MSGID 13194 13195 This function outputs the native language translation of a textual 13196message, performing dollar-substitution on the result. Note that only 13197shell variables mentioned in MSGID will be dollar-substituted in the 13198result. 13199 13200 13201File: gettext.info, Node: eval_ngettext Invocation, Next: eval_pgettext Invocation, Prev: eval_gettext Invocation, Up: sh 13202 1320315.5.12.7 Invoking the ‘eval_ngettext’ function 13204............................................... 13205 13206 eval_ngettext MSGID MSGID-PLURAL COUNT 13207 13208 This function outputs the native language translation of a textual 13209message whose grammatical form depends on a number, performing 13210dollar-substitution on the result. Note that only shell variables 13211mentioned in MSGID or MSGID-PLURAL will be dollar-substituted in the 13212result. 13213 13214 13215File: gettext.info, Node: eval_pgettext Invocation, Next: eval_npgettext Invocation, Prev: eval_ngettext Invocation, Up: sh 13216 1321715.5.12.8 Invoking the ‘eval_pgettext’ function 13218............................................... 13219 13220 eval_pgettext MSGCTXT MSGID 13221 13222 This function outputs the native language translation of a textual 13223message in the given context MSGCTXT (see *note Contexts::), performing 13224dollar-substitution on the result. Note that only shell variables 13225mentioned in MSGID will be dollar-substituted in the result. 13226 13227 13228File: gettext.info, Node: eval_npgettext Invocation, Prev: eval_pgettext Invocation, Up: sh 13229 1323015.5.12.9 Invoking the ‘eval_npgettext’ function 13231................................................ 13232 13233 eval_npgettext MSGCTXT MSGID MSGID-PLURAL COUNT 13234 13235 This function outputs the native language translation of a textual 13236message whose grammatical form depends on a number in the given context 13237MSGCTXT (see *note Contexts::), performing dollar-substitution on the 13238result. Note that only shell variables mentioned in MSGID or 13239MSGID-PLURAL will be dollar-substituted in the result. 13240 13241 13242File: gettext.info, Node: bash, Next: gawk, Prev: sh, Up: List of Programming Languages 13243 1324415.5.13 bash - Bourne-Again Shell Script 13245---------------------------------------- 13246 13247 GNU ‘bash’ 2.0 or newer has a special shorthand for translating a 13248string and substituting variable values in it: ‘$"msgid"’. But the use 13249of this construct is *discouraged*, due to the security holes it opens 13250and due to its portability problems. 13251 13252 The security holes of ‘$"..."’ come from the fact that after looking 13253up the translation of the string, ‘bash’ processes it like it processes 13254any double-quoted string: dollar and backquote processing, like ‘eval’ 13255does. 13256 13257 1. In a locale whose encoding is one of BIG5, BIG5-HKSCS, GBK, 13258 GB18030, SHIFT_JIS, JOHAB, some double-byte characters have a 13259 second byte whose value is ‘0x60’. For example, the byte sequence 13260 ‘\xe0\x60’ is a single character in these locales. Many versions 13261 of ‘bash’ (all versions up to bash-2.05, and newer versions on 13262 platforms without ‘mbsrtowcs()’ function) don’t know about 13263 character boundaries and see a backquote character where there is 13264 only a particular Chinese character. Thus it can start executing 13265 part of the translation as a command list. This situation can 13266 occur even without the translator being aware of it: if the 13267 translator provides translations in the UTF-8 encoding, it is the 13268 ‘gettext()’ function which will, during its conversion from the 13269 translator’s encoding to the user’s locale’s encoding, produce the 13270 dangerous ‘\x60’ bytes. 13271 13272 2. A translator could - voluntarily or inadvertently - use backquotes 13273 ‘"`...`"’ or dollar-parentheses ‘"$(...)"’ in her translations. 13274 The enclosed strings would be executed as command lists by the 13275 shell. 13276 13277 The portability problem is that ‘bash’ must be built with 13278internationalization support; this is normally not the case on systems 13279that don’t have the ‘gettext()’ function in libc. 13280 13281 13282File: gettext.info, Node: gawk, Next: Lua, Prev: bash, Up: List of Programming Languages 13283 1328415.5.14 GNU awk 13285--------------- 13286 13287RPMs 13288 gawk 3.1 or newer 13289 13290Ubuntu packages 13291 gawk 13292 13293File extension 13294 ‘awk’, ‘gawk’, ‘twjr’. The file extension ‘twjr’ is used by 13295 TexiWeb Jr (<https://github.com/arnoldrobbins/texiwebjr>). 13296 13297String syntax 13298 ‘"abc"’ 13299 13300gettext shorthand 13301 ‘_"abc"’ 13302 13303gettext/ngettext functions 13304 ‘dcgettext’, missing ‘dcngettext’ in gawk-3.1.0 13305 13306textdomain 13307 ‘TEXTDOMAIN’ variable 13308 13309bindtextdomain 13310 ‘bindtextdomain’ function 13311 13312setlocale 13313 automatic, but missing ‘setlocale (LC_MESSAGES, "")’ in gawk-3.1.0 13314 13315Prerequisite 13316 — 13317 13318Use or emulate GNU gettext 13319 use 13320 13321Extractor 13322 ‘xgettext’ 13323 13324Formatting with positions 13325 ‘printf "%2$d %1$d"’ (GNU awk only) 13326 13327Portability 13328 On platforms without gettext, no translation. On non-GNU awks, you 13329 must define ‘dcgettext’, ‘dcngettext’ and ‘bindtextdomain’ 13330 yourself. 13331 13332po-mode marking 13333 — 13334 13335 An example is available in the ‘examples’ directory: ‘hello-gawk’. 13336 13337 13338File: gettext.info, Node: Lua, Next: Pascal, Prev: gawk, Up: List of Programming Languages 13339 1334015.5.15 Lua 13341----------- 13342 13343RPMs 13344 lua 13345 13346Ubuntu packages 13347 lua, lua-gettext 13348 You need to install the ‘lua-gettext’ package from 13349 <https://gitlab.com/sukhichev/lua-gettext/blob/master/README.us.md>. 13350 Debian and Ubuntu packages of it are available. Download the 13351 appropriate one, and install it through ‘sudo dpkg -i 13352 lua-gettext_0.0_amd64.deb’. 13353 13354File extension 13355 ‘lua’ 13356 13357String syntax 13358 13359 • ‘"abc"’ 13360 13361 • ‘'abc'’ 13362 13363 • ‘[[abc]]’ 13364 13365 • ‘[=[abc]=]’ 13366 13367 • ‘[==[abc]==]’ 13368 13369 • ... 13370 13371gettext shorthand 13372 ‘_("abc")’ 13373 13374gettext/ngettext functions 13375 ‘gettext.gettext’, ‘gettext.dgettext’, ‘gettext.dcgettext’, 13376 ‘gettext.ngettext’, ‘gettext.dngettext’, ‘gettext.dcngettext’ 13377 13378textdomain 13379 ‘textdomain’ function 13380 13381bindtextdomain 13382 ‘bindtextdomain’ function 13383 13384setlocale 13385 automatic 13386 13387Prerequisite 13388 ‘require 'gettext'’ or running lua interpreter with ‘-l gettext’ 13389 option 13390 13391Use or emulate GNU gettext 13392 use 13393 13394Extractor 13395 ‘xgettext’ 13396 13397Formatting with positions 13398 — 13399 13400Portability 13401 On platforms without gettext, the functions are not available. 13402 13403po-mode marking 13404 — 13405 13406 13407File: gettext.info, Node: Pascal, Next: Smalltalk, Prev: Lua, Up: List of Programming Languages 13408 1340915.5.16 Pascal - Free Pascal Compiler 13410------------------------------------- 13411 13412RPMs 13413 fpk 13414 13415Ubuntu packages 13416 fp-compiler, fp-units-fcl 13417 13418File extension 13419 ‘pp’, ‘pas’ 13420 13421String syntax 13422 ‘'abc'’ 13423 13424gettext shorthand 13425 automatic 13426 13427gettext/ngettext functions 13428 —, use ‘ResourceString’ data type instead 13429 13430textdomain 13431 —, use ‘TranslateResourceStrings’ function instead 13432 13433bindtextdomain 13434 —, use ‘TranslateResourceStrings’ function instead 13435 13436setlocale 13437 automatic, but uses only LANG, not LC_MESSAGES or LC_ALL 13438 13439Prerequisite 13440 ‘{$mode delphi}’ or ‘{$mode objfpc}’ 13441 ‘uses gettext;’ 13442 13443Use or emulate GNU gettext 13444 emulate partially 13445 13446Extractor 13447 ‘ppc386’ followed by ‘xgettext’ or ‘rstconv’ 13448 13449Formatting with positions 13450 ‘uses sysutils;’ 13451 ‘format "%1:d %0:d"’ 13452 13453Portability 13454 ? 13455 13456po-mode marking 13457 — 13458 13459 The Pascal compiler has special support for the ‘ResourceString’ data 13460type. It generates a ‘.rst’ file. This is then converted to a ‘.pot’ 13461file by use of ‘xgettext’ or ‘rstconv’. At runtime, a ‘.mo’ file 13462corresponding to translations of this ‘.pot’ file can be loaded using 13463the ‘TranslateResourceStrings’ function in the ‘gettext’ unit. 13464 13465 An example is available in the ‘examples’ directory: ‘hello-pascal’. 13466 13467 13468File: gettext.info, Node: Smalltalk, Next: Vala, Prev: Pascal, Up: List of Programming Languages 13469 1347015.5.17 GNU Smalltalk 13471--------------------- 13472 13473RPMs 13474 smalltalk 13475 13476Ubuntu packages 13477 gnu-smalltalk 13478 13479File extension 13480 ‘st’ 13481 13482String syntax 13483 ‘'abc'’ 13484 13485gettext shorthand 13486 ‘NLS ? 'abc'’ 13487 13488gettext/ngettext functions 13489 ‘LcMessagesDomain>>#at:’, ‘LcMessagesDomain>>#at:plural:with:’ 13490 13491textdomain 13492 ‘LcMessages>>#domain:localeDirectory:’ (returns a 13493 ‘LcMessagesDomain’ object). 13494 Example: ‘I18N Locale default messages domain: 'gettext' 13495 localeDirectory: /usr/local/share/locale'’ 13496 13497bindtextdomain 13498 ‘LcMessages>>#domain:localeDirectory:’, see above. 13499 13500setlocale 13501 Automatic if you use ‘I18N Locale default’. 13502 13503Prerequisite 13504 ‘PackageLoader fileInPackage: 'I18N'!’ 13505 13506Use or emulate GNU gettext 13507 emulate 13508 13509Extractor 13510 ‘xgettext’ 13511 13512Formatting with positions 13513 ‘'%1 %2' bindWith: 'Hello' with: 'world'’ 13514 13515Portability 13516 fully portable 13517 13518po-mode marking 13519 — 13520 13521 An example is available in the ‘examples’ directory: 13522‘hello-smalltalk’. 13523 13524 13525File: gettext.info, Node: Vala, Next: wxWidgets, Prev: Smalltalk, Up: List of Programming Languages 13526 1352715.5.18 Vala 13528------------ 13529 13530RPMs 13531 vala 13532 13533Ubuntu packages 13534 valac 13535 13536File extension 13537 ‘vala’ 13538 13539String syntax 13540 13541 • ‘"abc"’ 13542 13543 • ‘"""abc"""’ 13544 13545gettext shorthand 13546 ‘_("abc")’ 13547 13548gettext/ngettext functions 13549 ‘gettext’, ‘dgettext’, ‘dcgettext’, ‘ngettext’, ‘dngettext’, 13550 ‘dpgettext’, ‘dpgettext2’ 13551 13552textdomain 13553 ‘textdomain’ function, defined under the ‘Intl’ namespace 13554 13555bindtextdomain 13556 ‘bindtextdomain’ function, defined under the ‘Intl’ namespace 13557 13558setlocale 13559 Programmer must call ‘Intl.setlocale (LocaleCategory.ALL, "")’ 13560 13561Prerequisite 13562 — 13563 13564Use or emulate GNU gettext 13565 Use 13566 13567Extractor 13568 ‘xgettext’ 13569 13570Formatting with positions 13571 Same as for the C language. 13572 13573Portability 13574 autoconf (gettext.m4) and #if ENABLE_NLS 13575 13576po-mode marking 13577 yes 13578 13579 13580File: gettext.info, Node: wxWidgets, Next: Tcl, Prev: Vala, Up: List of Programming Languages 13581 1358215.5.19 wxWidgets library 13583------------------------- 13584 13585RPMs 13586 wxGTK, gettext 13587 13588Ubuntu packages 13589 libwxgtk3.0-dev 13590 13591File extension 13592 ‘cpp’ 13593 13594String syntax 13595 ‘"abc"’ 13596 13597gettext shorthand 13598 ‘_("abc")’ 13599 13600gettext/ngettext functions 13601 ‘wxLocale::GetString’, ‘wxGetTranslation’ 13602 13603textdomain 13604 ‘wxLocale::AddCatalog’ 13605 13606bindtextdomain 13607 ‘wxLocale::AddCatalogLookupPathPrefix’ 13608 13609setlocale 13610 ‘wxLocale::Init’, ‘wxSetLocale’ 13611 13612Prerequisite 13613 ‘#include <wx/intl.h>’ 13614 13615Use or emulate GNU gettext 13616 emulate, see ‘include/wx/intl.h’ and ‘src/common/intl.cpp’ 13617 13618Extractor 13619 ‘xgettext’ 13620 13621Formatting with positions 13622 wxString::Format supports positions if and only if the system has 13623 ‘wprintf()’, ‘vswprintf()’ functions and they support positions 13624 according to POSIX. 13625 13626Portability 13627 fully portable 13628 13629po-mode marking 13630 yes 13631 13632 13633File: gettext.info, Node: Tcl, Next: Perl, Prev: wxWidgets, Up: List of Programming Languages 13634 1363515.5.20 Tcl - Tk’s scripting language 13636------------------------------------- 13637 13638RPMs 13639 tcl 13640 13641Ubuntu packages 13642 tcl 13643 13644File extension 13645 ‘tcl’ 13646 13647String syntax 13648 ‘"abc"’ 13649 13650gettext shorthand 13651 ‘[_ "abc"]’ 13652 13653gettext/ngettext functions 13654 ‘::msgcat::mc’ 13655 13656textdomain 13657 — 13658 13659bindtextdomain 13660 —, use ‘::msgcat::mcload’ instead 13661 13662setlocale 13663 automatic, uses LANG, but ignores LC_MESSAGES and LC_ALL 13664 13665Prerequisite 13666 ‘package require msgcat’ 13667 ‘proc _ {s} {return [::msgcat::mc $s]}’ 13668 13669Use or emulate GNU gettext 13670 —, uses a Tcl specific message catalog format 13671 13672Extractor 13673 ‘xgettext -k_’ 13674 13675Formatting with positions 13676 ‘format "%2\$d %1\$d"’ 13677 13678Portability 13679 fully portable 13680 13681po-mode marking 13682 — 13683 13684 Two examples are available in the ‘examples’ directory: ‘hello-tcl’, 13685‘hello-tcl-tk’. 13686 13687 Before marking strings as internationalizable, substitutions of 13688variables into the string need to be converted to ‘format’ applications. 13689For example, ‘"file $filename not found"’ becomes ‘[format "file %s not 13690found" $filename]’. Only after this is done, can the strings be marked 13691and extracted. After marking, this example becomes ‘[format [_ "file %s 13692not found"] $filename]’ or ‘[msgcat::mc "file %s not found" $filename]’. 13693Note that the ‘msgcat::mc’ function implicitly calls ‘format’ when more 13694than one argument is given. 13695 13696 13697File: gettext.info, Node: Perl, Next: PHP, Prev: Tcl, Up: List of Programming Languages 13698 1369915.5.21 Perl 13700------------ 13701 13702RPMs 13703 perl 13704 13705Ubuntu packages 13706 perl, libintl-perl 13707 13708File extension 13709 ‘pl’, ‘PL’, ‘pm’, ‘perl’, ‘cgi’ 13710 13711String syntax 13712 13713 • ‘"abc"’ 13714 13715 • ‘'abc'’ 13716 13717 • ‘qq (abc)’ 13718 13719 • ‘q (abc)’ 13720 13721 • ‘qr /abc/’ 13722 13723 • ‘qx (/bin/date)’ 13724 13725 • ‘/pattern match/’ 13726 13727 • ‘?pattern match?’ 13728 13729 • ‘s/substitution/operators/’ 13730 13731 • ‘$tied_hash{"message"}’ 13732 13733 • ‘$tied_hash_reference->{"message"}’ 13734 13735 • etc., issue the command ‘man perlsyn’ for details 13736 13737gettext shorthand 13738 ‘__’ (double underscore) 13739 13740gettext/ngettext functions 13741 ‘gettext’, ‘dgettext’, ‘dcgettext’, ‘ngettext’, ‘dngettext’, 13742 ‘dcngettext’, ‘pgettext’, ‘dpgettext’, ‘dcpgettext’, ‘npgettext’, 13743 ‘dnpgettext’, ‘dcnpgettext’ 13744 13745textdomain 13746 ‘textdomain’ function 13747 13748bindtextdomain 13749 ‘bindtextdomain’ function 13750 13751bind_textdomain_codeset 13752 ‘bind_textdomain_codeset’ function 13753 13754setlocale 13755 Use ‘setlocale (LC_ALL, "");’ 13756 13757Prerequisite 13758 ‘use POSIX;’ 13759 ‘use Locale::TextDomain;’ (included in the package libintl-perl 13760 which is available on the Comprehensive Perl Archive Network CPAN, 13761 https://www.cpan.org/). 13762 13763Use or emulate GNU gettext 13764 platform dependent: gettext_pp emulates, gettext_xs uses GNU 13765 gettext 13766 13767Extractor 13768 ‘xgettext -k__ -k\$__ -k%__ -k__x -k__n:1,2 -k__nx:1,2 -k__xn:1,2 13769 -kN__ -kN__n:1,2 -k__p:1c,2 -k__np:1c,2,3 -kN__p:1c,2 13770 -kN__np:1c,2,3’ 13771 13772Formatting with positions 13773 Both kinds of format strings support formatting with positions. 13774 ‘printf "%2\$d %1\$d", ...’ (requires Perl 5.8.0 or newer) 13775 ‘__expand("[new] replaces [old]", old => $oldvalue, new => 13776 $newvalue)’ 13777 13778Portability 13779 The ‘libintl-perl’ package is platform independent but is not part 13780 of the Perl core. The programmer is responsible for providing a 13781 dummy implementation of the required functions if the package is 13782 not installed on the target system. 13783 13784po-mode marking 13785 — 13786 13787Documentation 13788 Included in ‘libintl-perl’, available on CPAN 13789 (https://www.cpan.org/). 13790 13791 An example is available in the ‘examples’ directory: ‘hello-perl’. 13792 13793 The ‘xgettext’ parser backend for Perl differs significantly from the 13794parser backends for other programming languages, just as Perl itself 13795differs significantly from other programming languages. The Perl parser 13796backend offers many more string marking facilities than the other 13797backends but it also has some Perl specific limitations, the worst 13798probably being its imperfectness. 13799 13800* Menu: 13801 13802* General Problems:: General Problems Parsing Perl Code 13803* Default Keywords:: Which Keywords Will xgettext Look For? 13804* Special Keywords:: How to Extract Hash Keys 13805* Quote-like Expressions:: What are Strings And Quote-like Expressions? 13806* Interpolation I:: Invalid String Interpolation 13807* Interpolation II:: Valid String Interpolation 13808* Parentheses:: When To Use Parentheses 13809* Long Lines:: How To Grok with Long Lines 13810* Perl Pitfalls:: Bugs, Pitfalls, and Things That Do Not Work 13811 13812 13813File: gettext.info, Node: General Problems, Next: Default Keywords, Up: Perl 13814 1381515.5.21.1 General Problems Parsing Perl Code 13816............................................ 13817 13818 It is often heard that only Perl can parse Perl. This is not true. 13819Perl cannot be _parsed_ at all, it can only be _executed_. Perl has 13820various built-in ambiguities that can only be resolved at runtime. 13821 13822 The following example may illustrate one common problem: 13823 13824 print gettext "Hello World!"; 13825 13826 Although this example looks like a bullet-proof case of a function 13827invocation, it is not: 13828 13829 open gettext, ">testfile" or die; 13830 print gettext "Hello world!" 13831 13832 In this context, the string ‘gettext’ looks more like a file handle. 13833But not necessarily: 13834 13835 use Locale::Messages qw (:libintl_h); 13836 open gettext ">testfile" or die; 13837 print gettext "Hello world!"; 13838 13839 Now, the file is probably syntactically incorrect, provided that the 13840module ‘Locale::Messages’ found first in the Perl include path exports a 13841function ‘gettext’. But what if the module ‘Locale::Messages’ really 13842looks like this? 13843 13844 use vars qw (*gettext); 13845 13846 1; 13847 13848 In this case, the string ‘gettext’ will be interpreted as a file 13849handle again, and the above example will create a file ‘testfile’ and 13850write the string “Hello world!” into it. Even advanced control flow 13851analysis will not really help: 13852 13853 if (0.5 < rand) { 13854 eval "use Sane"; 13855 } else { 13856 eval "use InSane"; 13857 } 13858 print gettext "Hello world!"; 13859 13860 If the module ‘Sane’ exports a function ‘gettext’ that does what we 13861expect, and the module ‘InSane’ opens a file for writing and associates 13862the _handle_ ‘gettext’ with this output stream, we are clueless again 13863about what will happen at runtime. It is completely unpredictable. The 13864truth is that Perl has so many ways to fill its symbol table at runtime 13865that it is impossible to interpret a particular piece of code without 13866executing it. 13867 13868 Of course, ‘xgettext’ will not execute your Perl sources while 13869scanning for translatable strings, but rather use heuristics in order to 13870guess what you meant. 13871 13872 Another problem is the ambiguity of the slash and the question mark. 13873Their interpretation depends on the context: 13874 13875 # A pattern match. 13876 print "OK\n" if /foobar/; 13877 13878 # A division. 13879 print 1 / 2; 13880 13881 # Another pattern match. 13882 print "OK\n" if ?foobar?; 13883 13884 # Conditional. 13885 print $x ? "foo" : "bar"; 13886 13887 The slash may either act as the division operator or introduce a 13888pattern match, whereas the question mark may act as the ternary 13889conditional operator or as a pattern match, too. Other programming 13890languages like ‘awk’ present similar problems, but the consequences of a 13891misinterpretation are particularly nasty with Perl sources. In ‘awk’ 13892for instance, a statement can never exceed one line and the parser can 13893recover from a parsing error at the next newline and interpret the rest 13894of the input stream correctly. Perl is different, as a pattern match is 13895terminated by the next appearance of the delimiter (the slash or the 13896question mark) in the input stream, regardless of the semantic context. 13897If a slash is really a division sign but mis-interpreted as a pattern 13898match, the rest of the input file is most probably parsed incorrectly. 13899 13900 There are certain cases, where the ambiguity cannot be resolved at 13901all: 13902 13903 $x = wantarray ? 1 : 0; 13904 13905 The Perl built-in function ‘wantarray’ does not accept any arguments. 13906The Perl parser therefore knows that the question mark does not start a 13907regular expression but is the ternary conditional operator. 13908 13909 sub wantarrays {} 13910 $x = wantarrays ? 1 : 0; 13911 13912 Now the situation is different. The function ‘wantarrays’ takes a 13913variable number of arguments (like any non-prototyped Perl function). 13914The question mark is now the delimiter of a pattern match, and hence the 13915piece of code does not compile. 13916 13917 sub wantarrays() {} 13918 $x = wantarrays ? 1 : 0; 13919 13920 Now the function is prototyped, Perl knows that it does not accept 13921any arguments, and the question mark is therefore interpreted as the 13922ternaray operator again. But that unfortunately outsmarts ‘xgettext’. 13923 13924 The Perl parser in ‘xgettext’ cannot know whether a function has a 13925prototype and what that prototype would look like. It therefore makes 13926an educated guess. If a function is known to be a Perl built-in and 13927this function does not accept any arguments, a following question mark 13928or slash is treated as an operator, otherwise as the delimiter of a 13929following regular expression. The Perl built-ins that do not accept 13930arguments are ‘wantarray’, ‘fork’, ‘time’, ‘times’, ‘getlogin’, 13931‘getppid’, ‘getpwent’, ‘getgrent’, ‘gethostent’, ‘getnetent’, 13932‘getprotoent’, ‘getservent’, ‘setpwent’, ‘setgrent’, ‘endpwent’, 13933‘endgrent’, ‘endhostent’, ‘endnetent’, ‘endprotoent’, and ‘endservent’. 13934 13935 If you find that ‘xgettext’ fails to extract strings from portions of 13936your sources, you should therefore look out for slashes and/or question 13937marks preceding these sections. You may have come across a bug in 13938‘xgettext’’s Perl parser (and of course you should report that bug). In 13939the meantime you should consider to reformulate your code in a manner 13940less challenging to ‘xgettext’. 13941 13942 In particular, if the parser is too dumb to see that a function does 13943not accept arguments, use parentheses: 13944 13945 $x = somefunc() ? 1 : 0; 13946 $y = (somefunc) ? 1 : 0; 13947 13948 In fact the Perl parser itself has similar problems and warns you 13949about such constructs. 13950 13951 13952File: gettext.info, Node: Default Keywords, Next: Special Keywords, Prev: General Problems, Up: Perl 13953 1395415.5.21.2 Which keywords will xgettext look for? 13955................................................ 13956 13957 Unless you instruct ‘xgettext’ otherwise by invoking it with one of 13958the options ‘--keyword’ or ‘-k’, it will recognize the following 13959keywords in your Perl sources: 13960 13961 • ‘gettext’ 13962 13963 • ‘dgettext:2’ 13964 13965 The second argument will be extracted. 13966 13967 • ‘dcgettext:2’ 13968 13969 The second argument will be extracted. 13970 13971 • ‘ngettext:1,2’ 13972 13973 The first (singular) and the second (plural) argument will be 13974 extracted. 13975 13976 • ‘dngettext:2,3’ 13977 13978 The second (singular) and the third (plural) argument will be 13979 extracted. 13980 13981 • ‘dcngettext:2,3’ 13982 13983 The second (singular) and the third (plural) argument will be 13984 extracted. 13985 13986 • ‘pgettext:1c,2’ 13987 13988 The first (message context) and the second argument will be 13989 extracted. 13990 13991 • ‘dpgettext:2c,3’ 13992 13993 The second (message context) and the third argument will be 13994 extracted. 13995 13996 • ‘dcpgettext:2c,3’ 13997 13998 The second (message context) and the third argument will be 13999 extracted. 14000 14001 • ‘npgettext:1c,2,3’ 14002 14003 The first (message context), second (singular), and third (plural) 14004 argument will be extracted. 14005 14006 • ‘dnpgettext:2c,3,4’ 14007 14008 The second (message context), third (singular), and fourth (plural) 14009 argument will be extracted. 14010 14011 • ‘dcnpgettext:2c,3,4’ 14012 14013 The second (message context), third (singular), and fourth (plural) 14014 argument will be extracted. 14015 14016 • ‘gettext_noop’ 14017 14018 • ‘%gettext’ 14019 14020 The keys of lookups into the hash ‘%gettext’ will be extracted. 14021 14022 • ‘$gettext’ 14023 14024 The keys of lookups into the hash reference ‘$gettext’ will be 14025 extracted. 14026 14027 14028File: gettext.info, Node: Special Keywords, Next: Quote-like Expressions, Prev: Default Keywords, Up: Perl 14029 1403015.5.21.3 How to Extract Hash Keys 14031.................................. 14032 14033 Translating messages at runtime is normally performed by looking up 14034the original string in the translation database and returning the 14035translated version. The “natural” Perl implementation is a hash lookup, 14036and, of course, ‘xgettext’ supports such practice. 14037 14038 print __"Hello world!"; 14039 print $__{"Hello world!"}; 14040 print $__->{"Hello world!"}; 14041 print $$__{"Hello world!"}; 14042 14043 The above four lines all do the same thing. The Perl module 14044‘Locale::TextDomain’ exports by default a hash ‘%__’ that is tied to the 14045function ‘__()’. It also exports a reference ‘$__’ to ‘%__’. 14046 14047 If an argument to the ‘xgettext’ option ‘--keyword’, resp. ‘-k’ 14048starts with a percent sign, the rest of the keyword is interpreted as 14049the name of a hash. If it starts with a dollar sign, the rest of the 14050keyword is interpreted as a reference to a hash. 14051 14052 Note that you can omit the quotation marks (single or double) around 14053the hash key (almost) whenever Perl itself allows it: 14054 14055 print $gettext{Error}; 14056 14057 The exact rule is: You can omit the surrounding quotes, when the hash 14058key is a valid C (!) identifier, i.e. when it starts with an underscore 14059or an ASCII letter and is followed by an arbitrary number of 14060underscores, ASCII letters or digits. Other Unicode characters are 14061_not_ allowed, regardless of the ‘use utf8’ pragma. 14062 14063 14064File: gettext.info, Node: Quote-like Expressions, Next: Interpolation I, Prev: Special Keywords, Up: Perl 14065 1406615.5.21.4 What are Strings And Quote-like Expressions? 14067...................................................... 14068 14069 Perl offers a plethora of different string constructs. Those that 14070can be used either as arguments to functions or inside braces for hash 14071lookups are generally supported by ‘xgettext’. 14072 14073 • *double-quoted strings* 14074 print gettext "Hello World!"; 14075 14076 • *single-quoted strings* 14077 print gettext 'Hello World!'; 14078 14079 • *the operator qq* 14080 print gettext qq |Hello World!|; 14081 print gettext qq <E-mail: <guido\@imperia.net>>; 14082 14083 The operator ‘qq’ is fully supported. You can use arbitrary 14084 delimiters, including the four bracketing delimiters (round, angle, 14085 square, curly) that nest. 14086 14087 • *the operator q* 14088 print gettext q |Hello World!|; 14089 print gettext q <E-mail: <guido@imperia.net>>; 14090 14091 The operator ‘q’ is fully supported. You can use arbitrary 14092 delimiters, including the four bracketing delimiters (round, angle, 14093 square, curly) that nest. 14094 14095 • *the operator qx* 14096 print gettext qx ;LANGUAGE=C /bin/date; 14097 print gettext qx [/usr/bin/ls | grep '^[A-Z]*']; 14098 14099 The operator ‘qx’ is fully supported. You can use arbitrary 14100 delimiters, including the four bracketing delimiters (round, angle, 14101 square, curly) that nest. 14102 14103 The example is actually a useless use of ‘gettext’. It will invoke 14104 the ‘gettext’ function on the output of the command specified with 14105 the ‘qx’ operator. The feature was included in order to make the 14106 interface consistent (the parser will extract all strings and 14107 quote-like expressions). 14108 14109 • *here documents* 14110 print gettext <<'EOF'; 14111 program not found in $PATH 14112 EOF 14113 14114 print ngettext <<EOF, <<"EOF"; 14115 one file deleted 14116 EOF 14117 several files deleted 14118 EOF 14119 14120 Here-documents are recognized. If the delimiter is enclosed in 14121 single quotes, the string is not interpolated. If it is enclosed 14122 in double quotes or has no quotes at all, the string is 14123 interpolated. 14124 14125 Delimiters that start with a digit are not supported! 14126 14127 14128File: gettext.info, Node: Interpolation I, Next: Interpolation II, Prev: Quote-like Expressions, Up: Perl 14129 1413015.5.21.5 Invalid Uses Of String Interpolation 14131.............................................. 14132 14133 Perl is capable of interpolating variables into strings. This offers 14134some nice features in localized programs but can also lead to problems. 14135 14136 A common error is a construct like the following: 14137 14138 print gettext "This is the program $0!\n"; 14139 14140 Perl will interpolate at runtime the value of the variable ‘$0’ into 14141the argument of the ‘gettext()’ function. Hence, this argument is not a 14142string constant but a variable argument (‘$0’ is a global variable that 14143holds the name of the Perl script being executed). The interpolation is 14144performed by Perl before the string argument is passed to ‘gettext()’ 14145and will therefore depend on the name of the script which can only be 14146determined at runtime. Consequently, it is almost impossible that a 14147translation can be looked up at runtime (except if, by accident, the 14148interpolated string is found in the message catalog). 14149 14150 The ‘xgettext’ program will therefore terminate parsing with a fatal 14151error if it encounters a variable inside of an extracted string. In 14152general, this will happen for all kinds of string interpolations that 14153cannot be safely performed at compile time. If you absolutely know what 14154you are doing, you can always circumvent this behavior: 14155 14156 my $know_what_i_am_doing = "This is program $0!\n"; 14157 print gettext $know_what_i_am_doing; 14158 14159 Since the parser only recognizes strings and quote-like expressions, 14160but not variables or other terms, the above construct will be accepted. 14161You will have to find another way, however, to let your original string 14162make it into your message catalog. 14163 14164 If invoked with the option ‘--extract-all’, resp. ‘-a’, variable 14165interpolation will be accepted. Rationale: You will generally use this 14166option in order to prepare your sources for internationalization. 14167 14168 Please see the manual page ‘man perlop’ for details of strings and 14169quote-like expressions that are subject to interpolation and those that 14170are not. Safe interpolations (that will not lead to a fatal error) are: 14171 14172 • the escape sequences ‘\t’ (tab, HT, TAB), ‘\n’ (newline, NL), ‘\r’ 14173 (return, CR), ‘\f’ (form feed, FF), ‘\b’ (backspace, BS), ‘\a’ 14174 (alarm, bell, BEL), and ‘\e’ (escape, ESC). 14175 14176 • octal chars, like ‘\033’ 14177 Note that octal escapes in the range of 400-777 are translated into 14178 a UTF-8 representation, regardless of the presence of the ‘use 14179 utf8’ pragma. 14180 14181 • hex chars, like ‘\x1b’ 14182 14183 • wide hex chars, like ‘\x{263a}’ 14184 Note that this escape is translated into a UTF-8 representation, 14185 regardless of the presence of the ‘use utf8’ pragma. 14186 14187 • control chars, like ‘\c[’ (CTRL-[) 14188 14189 • named Unicode chars, like ‘\N{LATIN CAPITAL LETTER C WITH CEDILLA}’ 14190 14191 Note that this escape is translated into a UTF-8 representation, 14192 regardless of the presence of the ‘use utf8’ pragma. 14193 14194 The following escapes are considered partially safe: 14195 14196 • ‘\l’ lowercase next char 14197 14198 • ‘\u’ uppercase next char 14199 14200 • ‘\L’ lowercase till \E 14201 14202 • ‘\U’ uppercase till \E 14203 14204 • ‘\E’ end case modification 14205 14206 • ‘\Q’ quote non-word characters till \E 14207 14208 These escapes are only considered safe if the string consists of 14209ASCII characters only. Translation of characters outside the range 14210defined by ASCII is locale-dependent and can actually only be performed 14211at runtime; ‘xgettext’ doesn’t do these locale-dependent translations at 14212extraction time. 14213 14214 Except for the modifier ‘\Q’, these translations, albeit valid, are 14215generally useless and only obfuscate your sources. If a translation can 14216be safely performed at compile time you can just as well write what you 14217mean. 14218 14219 14220File: gettext.info, Node: Interpolation II, Next: Parentheses, Prev: Interpolation I, Up: Perl 14221 1422215.5.21.6 Valid Uses Of String Interpolation 14223............................................ 14224 14225 Perl is often used to generate sources for other programming 14226languages or arbitrary file formats. Web applications that output HTML 14227code make a prominent example for such usage. 14228 14229 You will often come across situations where you want to intersperse 14230code written in the target (programming) language with translatable 14231messages, like in the following HTML example: 14232 14233 print gettext <<EOF; 14234 <h1>My Homepage</h1> 14235 <script language="JavaScript"><!-- 14236 for (i = 0; i < 100; ++i) { 14237 alert ("Thank you so much for visiting my homepage!"); 14238 } 14239 //--></script> 14240 EOF 14241 14242 The parser will extract the entire here document, and it will appear 14243entirely in the resulting PO file, including the JavaScript snippet 14244embedded in the HTML code. If you exaggerate with constructs like the 14245above, you will run the risk that the translators of your package will 14246look out for a less challenging project. You should consider an 14247alternative expression here: 14248 14249 print <<EOF; 14250 <h1>$gettext{"My Homepage"}</h1> 14251 <script language="JavaScript"><!-- 14252 for (i = 0; i < 100; ++i) { 14253 alert ("$gettext{'Thank you so much for visiting my homepage!'}"); 14254 } 14255 //--></script> 14256 EOF 14257 14258 Only the translatable portions of the code will be extracted here, 14259and the resulting PO file will begrudgingly improve in terms of 14260readability. 14261 14262 You can interpolate hash lookups in all strings or quote-like 14263expressions that are subject to interpolation (see the manual page ‘man 14264perlop’ for details). Double interpolation is invalid, however: 14265 14266 # TRANSLATORS: Replace "the earth" with the name of your planet. 14267 print gettext qq{Welcome to $gettext->{"the earth"}}; 14268 14269 The ‘qq’-quoted string is recognized as an argument to ‘xgettext’ in 14270the first place, and checked for invalid variable interpolation. The 14271dollar sign of hash-dereferencing will therefore terminate the parser 14272with an “invalid interpolation” error. 14273 14274 It is valid to interpolate hash lookups in regular expressions: 14275 14276 if ($var =~ /$gettext{"the earth"}/) { 14277 print gettext "Match!\n"; 14278 } 14279 s/$gettext{"U. S. A."}/$gettext{"U. S. A."} $gettext{"(dial +0)"}/g; 14280 14281 14282File: gettext.info, Node: Parentheses, Next: Long Lines, Prev: Interpolation II, Up: Perl 14283 1428415.5.21.7 When To Use Parentheses 14285................................. 14286 14287 In Perl, parentheses around function arguments are mostly optional. 14288‘xgettext’ will always assume that all recognized keywords (except for 14289hashes and hash references) are names of properly prototyped functions, 14290and will (hopefully) only require parentheses where Perl itself requires 14291them. All constructs in the following example are therefore ok to use: 14292 14293 print gettext ("Hello World!\n"); 14294 print gettext "Hello World!\n"; 14295 print dgettext ($package => "Hello World!\n"); 14296 print dgettext $package, "Hello World!\n"; 14297 14298 # The "fat comma" => turns the left-hand side argument into a 14299 # single-quoted string! 14300 print dgettext smellovision => "Hello World!\n"; 14301 14302 # The following assignment only works with prototyped functions. 14303 # Otherwise, the functions will act as "greedy" list operators and 14304 # eat up all following arguments. 14305 my $anonymous_hash = { 14306 planet => gettext "earth", 14307 cakes => ngettext "one cake", "several cakes", $n, 14308 still => $works, 14309 }; 14310 # The same without fat comma: 14311 my $other_hash = { 14312 'planet', gettext "earth", 14313 'cakes', ngettext "one cake", "several cakes", $n, 14314 'still', $works, 14315 }; 14316 14317 # Parentheses are only significant for the first argument. 14318 print dngettext 'package', ("one cake", "several cakes", $n), $discarded; 14319 14320 14321File: gettext.info, Node: Long Lines, Next: Perl Pitfalls, Prev: Parentheses, Up: Perl 14322 1432315.5.21.8 How To Grok with Long Lines 14324..................................... 14325 14326 The necessity of long messages can often lead to a cumbersome or 14327unreadable coding style. Perl has several options that may prevent you 14328from writing unreadable code, and ‘xgettext’ does its best to do 14329likewise. This is where the dot operator (the string concatenation 14330operator) may come in handy: 14331 14332 print gettext ("This is a very long" 14333 . " message that is still" 14334 . " readable, because" 14335 . " it is split into" 14336 . " multiple lines.\n"); 14337 14338 Perl is smart enough to concatenate these constant string fragments 14339into one long string at compile time, and so is ‘xgettext’. You will 14340only find one long message in the resulting POT file. 14341 14342 Note that the future Perl 6 will probably use the underscore (‘_’) as 14343the string concatenation operator, and the dot (‘.’) for dereferencing. 14344This new syntax is not yet supported by ‘xgettext’. 14345 14346 If embedded newline characters are not an issue, or even desired, you 14347may also insert newline characters inside quoted strings wherever you 14348feel like it: 14349 14350 print gettext ("<em>In HTML output 14351 embedded newlines are generally no 14352 problem, since adjacent whitespace 14353 is always rendered into a single 14354 space character.</em>"); 14355 14356 You may also consider to use here documents: 14357 14358 print gettext <<EOF; 14359 <em>In HTML output 14360 embedded newlines are generally no 14361 problem, since adjacent whitespace 14362 is always rendered into a single 14363 space character.</em> 14364 EOF 14365 14366 Please do not forget that the line breaks are real, i.e. they 14367translate into newline characters that will consequently show up in the 14368resulting POT file. 14369 14370 14371File: gettext.info, Node: Perl Pitfalls, Prev: Long Lines, Up: Perl 14372 1437315.5.21.9 Bugs, Pitfalls, And Things That Do Not Work 14374..................................................... 14375 14376 The foregoing sections should have proven that ‘xgettext’ is quite 14377smart in extracting translatable strings from Perl sources. Yet, some 14378more or less exotic constructs that could be expected to work, actually 14379do not work. 14380 14381 One of the more relevant limitations can be found in the 14382implementation of variable interpolation inside quoted strings. Only 14383simple hash lookups can be used there: 14384 14385 print <<EOF; 14386 $gettext{"The dot operator" 14387 . " does not work" 14388 . "here!"} 14389 Likewise, you cannot @{[ gettext ("interpolate function calls") ]} 14390 inside quoted strings or quote-like expressions. 14391 EOF 14392 14393 This is valid Perl code and will actually trigger invocations of the 14394‘gettext’ function at runtime. Yet, the Perl parser in ‘xgettext’ will 14395fail to recognize the strings. A less obvious example can be found in 14396the interpolation of regular expressions: 14397 14398 s/<!--START_OF_WEEK-->/gettext ("Sunday")/e; 14399 14400 The modifier ‘e’ will cause the substitution to be interpreted as an 14401evaluable statement. Consequently, at runtime the function ‘gettext()’ 14402is called, but again, the parser fails to extract the string “Sunday”. 14403Use a temporary variable as a simple workaround if you really happen to 14404need this feature: 14405 14406 my $sunday = gettext "Sunday"; 14407 s/<!--START_OF_WEEK-->/$sunday/; 14408 14409 Hash slices would also be handy but are not recognized: 14410 14411 my @weekdays = @gettext{'Sunday', 'Monday', 'Tuesday', 'Wednesday', 14412 'Thursday', 'Friday', 'Saturday'}; 14413 # Or even: 14414 @weekdays = @gettext{qw (Sunday Monday Tuesday Wednesday Thursday 14415 Friday Saturday) }; 14416 14417 This is perfectly valid usage of the tied hash ‘%gettext’ but the 14418strings are not recognized and therefore will not be extracted. 14419 14420 Another caveat of the current version is its rudimentary support for 14421non-ASCII characters in identifiers. You may encounter serious problems 14422if you use identifiers with characters outside the range of ’A’-’Z’, 14423’a’-’z’, ’0’-’9’ and the underscore ’_’. 14424 14425 Maybe some of these missing features will be implemented in future 14426versions, but since you can always make do without them at minimal 14427effort, these todos have very low priority. 14428 14429 A nasty problem are brace format strings that already contain braces 14430as part of the normal text, for example the usage strings typically 14431encountered in programs: 14432 14433 die "usage: $0 {OPTIONS} FILENAME...\n"; 14434 14435 If you want to internationalize this code with Perl brace format 14436strings, you will run into a problem: 14437 14438 die __x ("usage: {program} {OPTIONS} FILENAME...\n", program => $0); 14439 14440 Whereas ‘{program}’ is a placeholder, ‘{OPTIONS}’ is not and should 14441probably be translated. Yet, there is no way to teach the Perl parser 14442in ‘xgettext’ to recognize the first one, and leave the other one alone. 14443 14444 There are two possible work-arounds for this problem. If you are 14445sure that your program will run under Perl 5.8.0 or newer (these Perl 14446versions handle positional parameters in ‘printf()’) or if you are sure 14447that the translator will not have to reorder the arguments in her 14448translation – for example if you have only one brace placeholder in your 14449string, or if it describes a syntax, like in this one –, you can mark 14450the string as ‘no-perl-brace-format’ and use ‘printf()’: 14451 14452 # xgettext: no-perl-brace-format 14453 die sprintf ("usage: %s {OPTIONS} FILENAME...\n", $0); 14454 14455 If you want to use the more portable Perl brace format, you will have 14456to do put placeholders in place of the literal braces: 14457 14458 die __x ("usage: {program} {[}OPTIONS{]} FILENAME...\n", 14459 program => $0, '[' => '{', ']' => '}'); 14460 14461 Perl brace format strings know no escaping mechanism. No matter how 14462this escaping mechanism looked like, it would either give the programmer 14463a hard time, make translating Perl brace format strings heavy-going, or 14464result in a performance penalty at runtime, when the format directives 14465get executed. Most of the time you will happily get along with 14466‘printf()’ for this special case. 14467 14468 14469File: gettext.info, Node: PHP, Next: Pike, Prev: Perl, Up: List of Programming Languages 14470 1447115.5.22 PHP Hypertext Preprocessor 14472---------------------------------- 14473 14474RPMs 14475 mod_php4, mod_php4-core, phpdoc 14476 14477Ubuntu packages 14478 php 14479 14480File extension 14481 ‘php’, ‘php3’, ‘php4’ 14482 14483String syntax 14484 ‘"abc"’, ‘'abc'’ 14485 14486gettext shorthand 14487 ‘_("abc")’ 14488 14489gettext/ngettext functions 14490 ‘gettext’, ‘dgettext’, ‘dcgettext’; starting with PHP 4.2.0 also 14491 ‘ngettext’, ‘dngettext’, ‘dcngettext’ 14492 14493textdomain 14494 ‘textdomain’ function 14495 14496bindtextdomain 14497 ‘bindtextdomain’ function 14498 14499setlocale 14500 Programmer must call ‘setlocale (LC_ALL, "")’ 14501 14502Prerequisite 14503 — 14504 14505Use or emulate GNU gettext 14506 use 14507 14508Extractor 14509 ‘xgettext’ 14510 14511Formatting with positions 14512 ‘printf "%2\$d %1\$d"’ 14513 14514Portability 14515 On platforms without gettext, the functions are not available. 14516 14517po-mode marking 14518 — 14519 14520 An example is available in the ‘examples’ directory: ‘hello-php’. 14521 14522 14523File: gettext.info, Node: Pike, Next: GCC-source, Prev: PHP, Up: List of Programming Languages 14524 1452515.5.23 Pike 14526------------ 14527 14528RPMs 14529 roxen 14530 14531Ubuntu packages 14532 pike8.0 or pike7.8 14533 14534File extension 14535 ‘pike’ 14536 14537String syntax 14538 ‘"abc"’ 14539 14540gettext shorthand 14541 — 14542 14543gettext/ngettext functions 14544 ‘gettext’, ‘dgettext’, ‘dcgettext’ 14545 14546textdomain 14547 ‘textdomain’ function 14548 14549bindtextdomain 14550 ‘bindtextdomain’ function 14551 14552setlocale 14553 ‘setlocale’ function 14554 14555Prerequisite 14556 ‘import Locale.Gettext;’ 14557 14558Use or emulate GNU gettext 14559 use 14560 14561Extractor 14562 — 14563 14564Formatting with positions 14565 — 14566 14567Portability 14568 On platforms without gettext, the functions are not available. 14569 14570po-mode marking 14571 — 14572 14573 14574File: gettext.info, Node: GCC-source, Next: YCP, Prev: Pike, Up: List of Programming Languages 14575 1457615.5.24 GNU Compiler Collection sources 14577--------------------------------------- 14578 14579RPMs 14580 gcc 14581 14582Ubuntu packages 14583 gcc 14584 14585File extension 14586 ‘c’, ‘h’. 14587 14588String syntax 14589 ‘"abc"’ 14590 14591gettext shorthand 14592 ‘_("abc")’ 14593 14594gettext/ngettext functions 14595 ‘gettext’, ‘dgettext’, ‘dcgettext’, ‘ngettext’, ‘dngettext’, 14596 ‘dcngettext’ 14597 14598textdomain 14599 ‘textdomain’ function 14600 14601bindtextdomain 14602 ‘bindtextdomain’ function 14603 14604setlocale 14605 Programmer must call ‘setlocale (LC_ALL, "")’ 14606 14607Prerequisite 14608 ‘#include "intl.h"’ 14609 14610Use or emulate GNU gettext 14611 Use 14612 14613Extractor 14614 ‘xgettext -k_’ 14615 14616Formatting with positions 14617 — 14618 14619Portability 14620 Uses autoconf macros 14621 14622po-mode marking 14623 yes 14624 14625 14626File: gettext.info, Node: YCP, Prev: GCC-source, Up: List of Programming Languages 14627 1462815.5.25 YCP - YaST2 scripting language 14629-------------------------------------- 14630 14631RPMs 14632 libycp, libycp-devel, yast2-core, yast2-core-devel 14633 14634Ubuntu packages 14635 — 14636 14637File extension 14638 ‘ycp’ 14639 14640String syntax 14641 ‘"abc"’ 14642 14643gettext shorthand 14644 ‘_("abc")’ 14645 14646gettext/ngettext functions 14647 ‘_()’ with 1 or 3 arguments 14648 14649textdomain 14650 ‘textdomain’ statement 14651 14652bindtextdomain 14653 — 14654 14655setlocale 14656 — 14657 14658Prerequisite 14659 — 14660 14661Use or emulate GNU gettext 14662 use 14663 14664Extractor 14665 ‘xgettext’ 14666 14667Formatting with positions 14668 ‘sformat "%2 %1"’ 14669 14670Portability 14671 fully portable 14672 14673po-mode marking 14674 — 14675 14676 An example is available in the ‘examples’ directory: ‘hello-ycp’. 14677 14678 14679File: gettext.info, Node: Data Formats, Next: Conclusion, Prev: Programming Languages, Up: Top 14680 1468116 Other Data Formats 14682********************* 14683 14684 While the GNU gettext tools deal mainly with POT and PO files, they 14685can also manipulate a couple of other data formats. 14686 14687* Menu: 14688 14689* Internationalizable Data:: Internationalizable Data Formats 14690* Localized Data:: Localized Data Formats 14691 14692 14693File: gettext.info, Node: Internationalizable Data, Next: Localized Data, Up: Data Formats 14694 1469516.1 Internationalizable Data Formats 14696===================================== 14697 14698 Here is a list of other data formats which can be internationalized 14699using GNU gettext. 14700 14701* Menu: 14702 14703* POT:: POT - Portable Object Template 14704* RST:: Resource String Table 14705* Glade:: Glade - GNOME user interface description 14706* GSettings:: GSettings - GNOME user configuration schema 14707* AppData:: AppData - freedesktop.org application description 14708* Preparing ITS Rules:: Preparing Rules for XML Internationalization 14709 14710 14711File: gettext.info, Node: POT, Next: RST, Up: Internationalizable Data 14712 1471316.1.1 POT - Portable Object Template 14714------------------------------------- 14715 14716RPMs 14717 gettext 14718 14719Ubuntu packages 14720 gettext 14721 14722File extension 14723 ‘pot’, ‘po’ 14724 14725Extractor 14726 ‘xgettext’ 14727 14728 14729File: gettext.info, Node: RST, Next: Glade, Prev: POT, Up: Internationalizable Data 14730 1473116.1.2 Resource String Table 14732---------------------------- 14733 14734 RST is the format of resource string table files of the Free Pascal 14735compiler versions older than 3.0.0. RSJ is the new format of resource 14736string table files, created by the Free Pascal compiler version 3.0.0 or 14737newer. 14738 14739RPMs 14740 fpk 14741 14742Ubuntu packages 14743 fp-compiler 14744 14745File extension 14746 ‘rst’, ‘rsj’ 14747 14748Extractor 14749 ‘xgettext’, ‘rstconv’ 14750 14751 14752File: gettext.info, Node: Glade, Next: GSettings, Prev: RST, Up: Internationalizable Data 14753 1475416.1.3 Glade - GNOME user interface description 14755----------------------------------------------- 14756 14757RPMs 14758 glade, libglade, glade2, libglade2, intltool 14759 14760Ubuntu packages 14761 glade, libglade2-dev, intltool 14762 14763File extension 14764 ‘glade’, ‘glade2’, ‘ui’ 14765 14766Extractor 14767 ‘xgettext’, ‘libglade-xgettext’, ‘xml-i18n-extract’, 14768 ‘intltool-extract’ 14769 14770 14771File: gettext.info, Node: GSettings, Next: AppData, Prev: Glade, Up: Internationalizable Data 14772 1477316.1.4 GSettings - GNOME user configuration schema 14774-------------------------------------------------- 14775 14776RPMs 14777 glib2 14778 14779Ubuntu packages 14780 libglib2.0-dev 14781 14782File extension 14783 ‘gschema.xml’ 14784 14785Extractor 14786 ‘xgettext’, ‘intltool-extract’ 14787 14788 14789File: gettext.info, Node: AppData, Next: Preparing ITS Rules, Prev: GSettings, Up: Internationalizable Data 14790 1479116.1.5 AppData - freedesktop.org application description 14792-------------------------------------------------------- 14793 14794 This file format is specified in 14795<https://www.freedesktop.org/software/appstream/docs/>. 14796 14797RPMs 14798 appdata-tools, appstream, libappstream-glib, 14799 libappstream-glib-builder 14800 14801Ubuntu packages 14802 appdata-tools, appstream, libappstream-glib-dev 14803 14804File extension 14805 ‘appdata.xml’, ‘metainfo.xml’ 14806 14807Extractor 14808 ‘xgettext’, ‘intltool-extract’, ‘itstool’ 14809 14810 14811File: gettext.info, Node: Preparing ITS Rules, Prev: AppData, Up: Internationalizable Data 14812 1481316.1.6 Preparing Rules for XML Internationalization 14814--------------------------------------------------- 14815 14816 Marking translatable strings in an XML file is done through a 14817separate "rule" file, making use of the Internationalization Tag Set 14818standard (ITS, <https://www.w3.org/TR/its20/>). The currently supported 14819ITS data categories are: ‘Translate’, ‘Localization Note’, ‘Elements 14820Within Text’, and ‘Preserve Space’. In addition to them, ‘xgettext’ 14821also recognizes the following extended data categories: 14822 14823‘Context’ 14824 14825 This data category associates ‘msgctxt’ to the extracted text. In 14826 the global rule, the ‘contextRule’ element contains the following: 14827 14828 • A required ‘selector’ attribute. It contains an absolute 14829 selector that selects the nodes to which this rule applies. 14830 14831 • A required ‘contextPointer’ attribute that contains a relative 14832 selector pointing to a node that holds the ‘msgctxt’ value. 14833 14834 • An optional ‘textPointer’ attribute that contains a relative 14835 selector pointing to a node that holds the ‘msgid’ value. 14836 14837‘Escape Special Characters’ 14838 14839 This data category indicates whether the special XML characters 14840 (‘<’, ‘>’, ‘&’, ‘"’) are escaped with entity reference. In the 14841 global rule, the ‘escapeRule’ element contains the following: 14842 14843 • A required ‘selector’ attribute. It contains an absolute 14844 selector that selects the nodes to which this rule applies. 14845 14846 • A required ‘escape’ attribute with the value ‘yes’ or ‘no’. 14847 14848‘Extended Preserve Space’ 14849 14850 This data category extends the standard ‘Preserve Space’ data 14851 category with the additional values ‘trim’ and ‘paragraph’. ‘trim’ 14852 means to remove the leading and trailing whitespaces of the 14853 content, but not to normalize whitespaces in the middle. 14854 ‘paragraph’ means to normalize the content but keep the paragraph 14855 boundaries. In the global rule, the ‘preserveSpaceRule’ element 14856 contains the following: 14857 14858 • A required ‘selector’ attribute. It contains an absolute 14859 selector that selects the nodes to which this rule applies. 14860 14861 • A required ‘space’ attribute with the value ‘default’, 14862 ‘preserve’, ‘trim’, or ‘paragraph’. 14863 14864 All those extended data categories can only be expressed with global 14865rules, and the rule elements have to have the 14866‘https://www.gnu.org/s/gettext/ns/its/extensions/1.0’ namespace. 14867 14868 Given the following XML document in a file ‘messages.xml’: 14869 14870 <?xml version="1.0"?> 14871 <messages> 14872 <message> 14873 <p>A translatable string</p> 14874 </message> 14875 <message> 14876 <p translatable="no">A non-translatable string</p> 14877 </message> 14878 </messages> 14879 14880 To extract the first text content ("A translatable string"), but not 14881the second ("A non-translatable string"), the following ITS rules can be 14882used: 14883 14884 <?xml version="1.0"?> 14885 <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0"> 14886 <its:translateRule selector="/messages" translate="no"/> 14887 <its:translateRule selector="//message/p" translate="yes"/> 14888 14889 <!-- If 'p' has an attribute 'translatable' with the value 'no', then 14890 the content is not translatable. --> 14891 <its:translateRule selector="//message/p[@translatable = 'no']" 14892 translate="no"/> 14893 </its:rules> 14894 14895 ‘xgettext’ needs another file called "locating rule" to associate an 14896ITS rule with an XML file. If the above ITS file is saved as 14897‘messages.its’, the locating rule would look like: 14898 14899 <?xml version="1.0"?> 14900 <locatingRules> 14901 <locatingRule name="Messages" pattern="*.xml"> 14902 <documentRule localName="messages" target="messages.its"/> 14903 </locatingRule> 14904 <locatingRule name="Messages" pattern="*.msg" target="messages.its"/> 14905 </locatingRules> 14906 14907 The ‘locatingRule’ element must have a ‘pattern’ attribute, which 14908denotes either a literal file name or a wildcard pattern of the XML 14909file(1). The ‘locatingRule’ element can have child ‘documentRule’ 14910element, which adds checks on the content of the XML file. 14911 14912 The first rule matches any file with the ‘.xml’ file extension, but 14913it only applies to XML files whose root element is ‘<messages>’. 14914 14915 The second rule indicates that the same ITS rule file are also 14916applicable to any file with the ‘.msg’ file extension. The optional 14917‘name’ attribute of ‘locatingRule’ allows to choose rules by name, 14918typically with ‘xgettext’’s ‘-L’ option. 14919 14920 The associated ITS rule file is indicated by the ‘target’ attribute 14921of ‘locatingRule’ or ‘documentRule’. If it is specified in a 14922‘documentRule’ element, the parent ‘locatingRule’ shouldn’t have the 14923‘target’ attribute. 14924 14925 Locating rule files must have the ‘.loc’ file extension. Both ITS 14926rule files and locating rule files must be installed in the 14927‘$prefix/share/gettext/its’ directory. Once those files are properly 14928installed, ‘xgettext’ can extract translatable strings from the matching 14929XML files. 14930 1493116.1.6.1 Two Use-cases of Translated Strings in XML 14932................................................... 14933 14934 For XML, there are two use-cases of translated strings. One is the 14935case where the translated strings are directly consumed by programs, and 14936the other is the case where the translated strings are merged back to 14937the original XML document. In the former case, special characters in 14938the extracted strings shouldn’t be escaped, while they should in the 14939latter case. To control wheter to escape special characters, the 14940‘Escape Special Characters’ data category can be used. 14941 14942 To merge the translations, the ‘msgfmt’ program can be used with the 14943option ‘--xml’. *Note msgfmt Invocation::, for more details about how 14944one calls the ‘msgfmt’ program. ‘msgfmt’’s ‘--xml’ option doesn’t 14945perform character escaping, so translated strings can have arbitrary XML 14946constructs, such as elements for markup. 14947 14948 ---------- Footnotes ---------- 14949 14950 (1) Note that the file name matching is done after removing any ‘.in’ 14951suffix from the input file name. Thus the ‘pattern’ attribute must not 14952include a pattern matching ‘.in’. For example, if the input file name 14953is ‘foo.msg.in’, the pattern should be either ‘*.msg’ or just ‘*’, 14954rather than ‘*.in’. 14955 14956 14957File: gettext.info, Node: Localized Data, Prev: Internationalizable Data, Up: Data Formats 14958 1495916.2 Localized Data Formats 14960=========================== 14961 14962 Here is a list of file formats that contain localized data and that 14963the GNU gettext tools can manipulate. 14964 14965* Menu: 14966 14967* Editable Message Catalogs:: Editable Message Catalogs 14968* Compiled Message Catalogs:: Compiled Message Catalogs 14969* Desktop Entry:: Desktop Entry files 14970* XML:: XML files 14971 14972 14973File: gettext.info, Node: Editable Message Catalogs, Next: Compiled Message Catalogs, Up: Localized Data 14974 1497516.2.1 Editable Message Catalogs 14976-------------------------------- 14977 14978 These file formats can be used with all of the ‘msg*’ tools and with 14979the ‘xgettext’ program. 14980 14981 If you just want to convert among these formats, you can use the 14982‘msgcat’ program (with the appropriate option) or the ‘xgettext’ 14983program. 14984 14985* Menu: 14986 14987* PO:: PO - Portable Object 14988* Java .properties:: Java .properties 14989* GNUstep .strings:: NeXTstep/GNUstep .strings 14990 14991 14992File: gettext.info, Node: PO, Next: Java .properties, Up: Editable Message Catalogs 14993 1499416.2.1.1 PO - Portable Object 14995............................. 14996 14997File extension 14998 ‘po’ 14999 15000 15001File: gettext.info, Node: Java .properties, Next: GNUstep .strings, Prev: PO, Up: Editable Message Catalogs 15002 1500316.2.1.2 Java .properties 15004......................... 15005 15006File extension 15007 ‘properties’ 15008 15009 15010File: gettext.info, Node: GNUstep .strings, Prev: Java .properties, Up: Editable Message Catalogs 15011 1501216.2.1.3 NeXTstep/GNUstep .strings 15013.................................. 15014 15015File extension 15016 ‘strings’ 15017 15018 15019File: gettext.info, Node: Compiled Message Catalogs, Next: Desktop Entry, Prev: Editable Message Catalogs, Up: Localized Data 15020 1502116.2.2 Compiled Message Catalogs 15022-------------------------------- 15023 15024 These file formats can be created through ‘msgfmt’ and converted back 15025to PO format through ‘msgunfmt’. 15026 15027* Menu: 15028 15029* MO:: MO - Machine Object 15030* Java ResourceBundle:: Java ResourceBundle 15031* C# Satellite Assembly:: C# Satellite Assembly 15032* C# Resource:: C# Resource 15033* Tcl message catalog:: Tcl message catalog 15034* Qt message catalog:: Qt message catalog 15035 15036 15037File: gettext.info, Node: MO, Next: Java ResourceBundle, Up: Compiled Message Catalogs 15038 1503916.2.2.1 MO - Machine Object 15040............................ 15041 15042File extension 15043 ‘mo’ 15044 15045 See section *note MO Files:: for details. 15046 15047 15048File: gettext.info, Node: Java ResourceBundle, Next: C# Satellite Assembly, Prev: MO, Up: Compiled Message Catalogs 15049 1505016.2.2.2 Java ResourceBundle 15051............................ 15052 15053File extension 15054 ‘class’ 15055 15056 For more information, see the section *note Java:: and the examples 15057‘hello-java’, ‘hello-java-awt’, ‘hello-java-swing’. 15058 15059 15060File: gettext.info, Node: C# Satellite Assembly, Next: C# Resource, Prev: Java ResourceBundle, Up: Compiled Message Catalogs 15061 1506216.2.2.3 C# Satellite Assembly 15063.............................. 15064 15065File extension 15066 ‘dll’ 15067 15068 For more information, see the section *note C#::. 15069 15070 15071File: gettext.info, Node: C# Resource, Next: Tcl message catalog, Prev: C# Satellite Assembly, Up: Compiled Message Catalogs 15072 1507316.2.2.4 C# Resource 15074.................... 15075 15076File extension 15077 ‘resources’ 15078 15079 For more information, see the section *note C#::. 15080 15081 15082File: gettext.info, Node: Tcl message catalog, Next: Qt message catalog, Prev: C# Resource, Up: Compiled Message Catalogs 15083 1508416.2.2.5 Tcl message catalog 15085............................ 15086 15087File extension 15088 ‘msg’ 15089 15090 For more information, see the section *note Tcl:: and the examples 15091‘hello-tcl’, ‘hello-tcl-tk’. 15092 15093 15094File: gettext.info, Node: Qt message catalog, Prev: Tcl message catalog, Up: Compiled Message Catalogs 15095 1509616.2.2.6 Qt message catalog 15097........................... 15098 15099File extension 15100 ‘qm’ 15101 15102 For more information, see the examples ‘hello-c++-qt’ and 15103‘hello-c++-kde’. 15104 15105 15106File: gettext.info, Node: Desktop Entry, Next: XML, Prev: Compiled Message Catalogs, Up: Localized Data 15107 1510816.2.3 Desktop Entry files 15109-------------------------- 15110 15111 The programmer produces a desktop entry file template with only the 15112English strings. These strings get included in the POT file, by way of 15113‘xgettext’ (usually by listing the template in ‘po/POTFILES.in’). The 15114translators produce PO files, one for each language. Finally, an 15115‘msgfmt --desktop’ invocation collects all the translations in the 15116desktop entry file. 15117 15118 For more information, see the example ‘hello-c-gnome3’. 15119 15120* Menu: 15121 15122* Icons:: Handling icons 15123 15124 15125File: gettext.info, Node: Icons, Up: Desktop Entry 15126 1512716.2.3.1 How to handle icons in Desktop Entry files 15128................................................... 15129 15130 Icons are generally locale dependent, for the following reasons: 15131 15132 • Icons may contain signs that are considered rude in some cultures. 15133 For example, the high-five sign, in some cultures, is perceived as 15134 an unfriendly “stop” sign. 15135 • Icons may contain metaphors that are culture specific. For 15136 example, a mailbox in the U.S. looks different than mailboxes all 15137 around the world. 15138 • Icons may need to be mirrored for right-to-left locales. 15139 • Icons may contain text strings (a bad practice, but anyway). 15140 15141 However, icons are not covered by GNU gettext localization, because 15142 • Icons cannot be easily embedded in PO files, 15143 • The need to localize an icon is rare, and the ability to do so in a 15144 PO file would introduce translator mistakes. 15145 15146 Desktop Entry files may contain an ‘Icon’ property, and this property 15147is localizable. If a translator wishes to localize an icon, she should 15148do so by bypassing the normal workflow with PO files: 15149 1. The translator contacts the package developers directly, sending 15150 them the icon appropriate for her locale, with a request to change 15151 the template file. 15152 2. The package developers add the icon file to their repository, and a 15153 line 15154 Icon[LOCALE]=ICON_FILE_NAME 15155 to the template file. 15156This line remains in place when this template file is merged with the 15157translators’ PO files, through ‘msgfmt’. 15158 15159 15160File: gettext.info, Node: XML, Prev: Desktop Entry, Up: Localized Data 15161 1516216.2.4 XML files 15163---------------- 15164 15165 See the section *note Preparing ITS Rules:: and *note msgfmt 15166Invocation::, subsection “XML mode operations”. 15167 15168 15169File: gettext.info, Node: Conclusion, Next: Language Codes, Prev: Data Formats, Up: Top 15170 1517117 Concluding Remarks 15172********************* 15173 15174 We would like to conclude this GNU ‘gettext’ manual by presenting an 15175history of the Translation Project so far. We finally give a few 15176pointers for those who want to do further research or readings about 15177Native Language Support matters. 15178 15179* Menu: 15180 15181* History:: History of GNU ‘gettext’ 15182* The original ABOUT-NLS:: Historical introduction 15183* References:: Related Readings 15184 15185 15186File: gettext.info, Node: History, Next: The original ABOUT-NLS, Up: Conclusion 15187 1518817.1 History of GNU ‘gettext’ 15189============================= 15190 15191 Internationalization concerns and algorithms have been informally and 15192casually discussed for years in GNU, sometimes around GNU ‘libc’, maybe 15193around the incoming ‘Hurd’, or otherwise (nobody clearly remembers). 15194And even then, when the work started for real, this was somewhat 15195independently of these previous discussions. 15196 15197 This all began in July 1994, when Patrick D’Cruze had the idea and 15198initiative of internationalizing version 3.9.2 of GNU ‘fileutils’. He 15199then asked Jim Meyering, the maintainer, how to get those changes folded 15200into an official release. That first draft was full of ‘#ifdef’s and 15201somewhat disconcerting, and Jim wanted to find nicer ways. Patrick and 15202Jim shared some tries and experimentations in this area. Then, feeling 15203that this might eventually have a deeper impact on GNU, Jim wanted to 15204know what standards were, and contacted Richard Stallman, who very 15205quickly and verbally described an overall design for what was meant to 15206become ‘glocale’, at that time. 15207 15208 Jim implemented ‘glocale’ and got a lot of exhausting feedback from 15209Patrick and Richard, of course, but also from Mitchum DSouza (who wrote 15210a ‘catgets’-like package), Roland McGrath, maybe David MacKenzie, 15211François Pinard, and Paul Eggert, all pushing and pulling in various 15212directions, not always compatible, to the extent that after a couple of 15213test releases, ‘glocale’ was torn apart. In particular, Paul Eggert – 15214always keeping an eye on developments in Solaris – advocated the use of 15215the ‘gettext’ API over ‘glocale’’s ‘catgets’-based API. 15216 15217 While Jim took some distance and time and became dad for a second 15218time, Roland wanted to get GNU ‘libc’ internationalized, and got Ulrich 15219Drepper involved in that project. Instead of starting from ‘glocale’, 15220Ulrich rewrote something from scratch, but more conforming to the set of 15221guidelines who emerged out of the ‘glocale’ effort. Then, Ulrich got 15222people from the previous forum to involve themselves into this new 15223project, and the switch from ‘glocale’ to what was first named 15224‘msgutils’, renamed ‘nlsutils’, and later ‘gettext’, became officially 15225accepted by Richard in May 1995 or so. 15226 15227 Let’s summarize by saying that Ulrich Drepper wrote GNU ‘gettext’ in 15228April 1995. The first official release of the package, including PO 15229mode, occurred in July 1995, and was numbered 0.7. Other people 15230contributed to the effort by providing a discussion forum around Ulrich, 15231writing little pieces of code, or testing. These are quoted in the 15232‘THANKS’ file which comes with the GNU ‘gettext’ distribution. 15233 15234 While this was being done, François adapted half a dozen of GNU 15235packages to ‘glocale’ first, then later to ‘gettext’, putting them in 15236pretest, so providing along the way an effective user environment for 15237fine tuning the evolving tools. He also took the responsibility of 15238organizing and coordinating the Translation Project. After nearly a 15239year of informal exchanges between people from many countries, 15240translator teams started to exist in May 1995, through the creation and 15241support by Patrick D’Cruze of twenty unmoderated mailing lists for that 15242many native languages, and two moderated lists: one for reaching all 15243teams at once, the other for reaching all willing maintainers of 15244internationalized free software packages. 15245 15246 François also wrote PO mode in June 1995 with the collaboration of 15247Greg McGary, as a kind of contribution to Ulrich’s package. He also 15248gave a hand with the GNU ‘gettext’ Texinfo manual. 15249 15250 In 1997, Ulrich Drepper released the GNU libc 2.0, which included the 15251‘gettext’, ‘textdomain’ and ‘bindtextdomain’ functions. 15252 15253 In 2000, Ulrich Drepper added plural form handling (the ‘ngettext’ 15254function) to GNU libc. Later, in 2001, he released GNU libc 2.2.x, 15255which is the first free C library with full internationalization 15256support. 15257 15258 Ulrich being quite busy in his role of General Maintainer of GNU 15259libc, he handed over the GNU ‘gettext’ maintenance to Bruno Haible in 152602000. Bruno added the plural form handling to the tools as well, added 15261support for UTF-8 and CJK locales, and wrote a few new tools for 15262manipulating PO files. 15263 15264 15265File: gettext.info, Node: The original ABOUT-NLS, Next: References, Prev: History, Up: Conclusion 15266 1526717.2 Notes on the Free Translation Project 15268========================================== 15269 15270 This section contains the text that was, for a long time, distributed 15271as a file named ‘ABOUT-NLS’. 15272 15273 * NOTE: * This documentation section is outdated. It it included 15274here for historical purposes only. 15275 15276 Free software is going international! The Free Translation Project 15277is a way to get maintainers of free software, translators, and users all 15278together, so that free software will gradually become able to speak many 15279languages. A few packages already provide translations for their 15280messages. 15281 15282 If you found this ‘ABOUT-NLS’ file inside a distribution, you may 15283assume that the distributed package does use GNU ‘gettext’ internally, 15284itself available at your nearest GNU archive site. But you do _not_ 15285need to install GNU ‘gettext’ prior to configuring, installing or using 15286this package with messages translated. 15287 15288 Installers will find here some useful hints. These notes also 15289explain how users should proceed for getting the programs to use the 15290available translations. They tell how people wanting to contribute and 15291work on translations can contact the appropriate team. 15292 15293* Menu: 15294 15295* INSTALL Matters:: 15296* Using This Package:: 15297* Translating Teams:: 15298* Available Packages:: 15299* Using gettext in own code:: 15300 15301 15302File: gettext.info, Node: INSTALL Matters, Next: Using This Package, Up: The original ABOUT-NLS 15303 1530417.2.1 INSTALL Matters 15305---------------------- 15306 15307 Some packages are “localizable” when properly installed; the programs 15308they contain can be made to speak your own native language. Most such 15309packages use GNU ‘gettext’. Other packages have their own ways to 15310internationalization, predating GNU ‘gettext’. 15311 15312 By default, this package will be installed to allow translation of 15313messages. It will automatically detect whether the system already 15314provides the GNU ‘gettext’ functions. Installers may use special 15315options at configuration time for changing the default behaviour. The 15316command: 15317 15318 ./configure --disable-nls 15319 15320will _totally_ disable translation of messages. 15321 15322 When you already have GNU ‘gettext’ installed on your system and run 15323configure without an option for your new package, ‘configure’ will 15324probably detect the previously built and installed ‘libintl’ library and 15325will decide to use it. If not, you may have to to use the 15326‘--with-libintl-prefix’ option to tell ‘configure’ where to look for it. 15327 15328 Internationalized packages usually have many ‘po/LL.po’ files, where 15329LL gives an ISO 639 two-letter code identifying the language. Unless 15330translations have been forbidden at ‘configure’ time by using the 15331‘--disable-nls’ switch, all available translations are installed 15332together with the package. However, the environment variable ‘LINGUAS’ 15333may be set, prior to configuration, to limit the installed set. 15334‘LINGUAS’ should then contain a space separated list of two-letter 15335codes, stating which languages are allowed. 15336 15337 15338File: gettext.info, Node: Using This Package, Next: Translating Teams, Prev: INSTALL Matters, Up: The original ABOUT-NLS 15339 1534017.2.2 Using This Package 15341------------------------- 15342 15343 As a user, if your language has been installed for this package, you 15344only have to set the ‘LANG’ environment variable to the appropriate 15345‘LL_CC’ combination. If you happen to have the ‘LC_ALL’ or some other 15346‘LC_xxx’ environment variables set, you should unset them before setting 15347‘LANG’, otherwise the setting of ‘LANG’ will not have the desired 15348effect. Here ‘LL’ is an ISO 639 two-letter language code, and ‘CC’ is 15349an ISO 3166 two-letter country code. For example, let’s suppose that 15350you speak German and live in Germany. At the shell prompt, merely 15351execute ‘setenv LANG de_DE’ (in ‘csh’), ‘export LANG; LANG=de_DE’ (in 15352‘sh’) or ‘export LANG=de_DE’ (in ‘bash’). This can be done from your 15353‘.login’ or ‘.profile’ file, once and for all. 15354 15355 You might think that the country code specification is redundant. 15356But in fact, some languages have dialects in different countries. For 15357example, ‘de_AT’ is used for Austria, and ‘pt_BR’ for Brazil. The 15358country code serves to distinguish the dialects. 15359 15360 The locale naming convention of ‘LL_CC’, with ‘LL’ denoting the 15361language and ‘CC’ denoting the country, is the one use on systems based 15362on GNU libc. On other systems, some variations of this scheme are used, 15363such as ‘LL’ or ‘LL_CC.ENCODING’. You can get the list of locales 15364supported by your system for your language by running the command 15365‘locale -a | grep '^LL'’. 15366 15367 Not all programs have translations for all languages. By default, an 15368English message is shown in place of a nonexistent translation. If you 15369understand other languages, you can set up a priority list of languages. 15370This is done through a different environment variable, called 15371‘LANGUAGE’. GNU ‘gettext’ gives preference to ‘LANGUAGE’ over ‘LANG’ 15372for the purpose of message handling, but you still need to have ‘LANG’ 15373set to the primary language; this is required by other parts of the 15374system libraries. For example, some Swedish users who would rather read 15375translations in German than English for when Swedish is not available, 15376set ‘LANGUAGE’ to ‘sv:de’ while leaving ‘LANG’ to ‘sv_SE’. 15377 15378 Special advice for Norwegian users: The language code for Norwegian 15379bokmål changed from ‘no’ to ‘nb’ recently (in 2003). During the 15380transition period, while some message catalogs for this language are 15381installed under ‘nb’ and some older ones under ‘no’, it’s recommended 15382for Norwegian users to set ‘LANGUAGE’ to ‘nb:no’ so that both newer and 15383older translations are used. 15384 15385 In the ‘LANGUAGE’ environment variable, but not in the ‘LANG’ 15386environment variable, ‘LL_CC’ combinations can be abbreviated as ‘LL’ to 15387denote the language’s main dialect. For example, ‘de’ is equivalent to 15388‘de_DE’ (German as spoken in Germany), and ‘pt’ to ‘pt_PT’ (Portuguese 15389as spoken in Portugal) in this context. 15390 15391 15392File: gettext.info, Node: Translating Teams, Next: Available Packages, Prev: Using This Package, Up: The original ABOUT-NLS 15393 1539417.2.3 Translating Teams 15395------------------------ 15396 15397 For the Free Translation Project to be a success, we need interested 15398people who like their own language and write it well, and who are also 15399able to synergize with other translators speaking the same language. 15400Each translation team has its own mailing list. The up-to-date list of 15401teams can be found at the Free Translation Project’s homepage, 15402‘https://translationproject.org/’, in the "Teams" area. 15403 15404 If you’d like to volunteer to _work_ at translating messages, you 15405should become a member of the translating team for your own language. 15406The subscribing address is _not_ the same as the list itself, it has 15407‘-request’ appended. For example, speakers of Swedish can send a 15408message to ‘sv-request@li.org’, having this message body: 15409 15410 subscribe 15411 15412 Keep in mind that team members are expected to participate _actively_ 15413in translations, or at solving translational difficulties, rather than 15414merely lurking around. If your team does not exist yet and you want to 15415start one, or if you are unsure about what to do or how to get started, 15416please write to ‘coordinator@translationproject.org’ to reach the 15417coordinator for all translator teams. 15418 15419 The English team is special. It works at improving and uniformizing 15420the terminology in use. Proven linguistic skills are praised more than 15421programming skills, here. 15422 15423 15424File: gettext.info, Node: Available Packages, Next: Using gettext in own code, Prev: Translating Teams, Up: The original ABOUT-NLS 15425 1542617.2.4 Available Packages 15427------------------------- 15428 15429 Languages are not equally supported in all packages. The following 15430matrix shows the current state of internationalization, as of July 2020. 15431The matrix shows, in regard of each package, for which languages PO 15432files have been submitted to translation coordination, with a 15433translation percentage of at least 50%. 15434 15435 Ready PO files af an ar ast be bg bn bn_IN ca ckb crh cs da de 15436 +---------------------------------------------------+ 15437 a2ps | [] [] [] [] [] | 15438 aegis | [] [] | 15439 anubis | [] [] | 15440 aspell | [] [] [] [] [] | 15441 bash | [] [] [] [] | 15442 bfd | | 15443 binutils | [] | 15444 bison | [] [] | 15445 bison-runtime | [] [] [] [] [] | 15446 buzztrax | [] [] [] | 15447 ccd2cue | [] [] | 15448 ccide | [] [] | 15449 cflow | [] [] | 15450 clisp | [] [] | 15451 coreutils | [] [] [] [] [] | 15452 cpio | [] [] | 15453 cppi | [] [] | 15454 cpplib | [] [] [] | 15455 cryptsetup | [] [] [] | 15456 datamash | [] [] | 15457 denemo | [] [] [] | 15458 dfarc | [] [] [] | 15459 dialog | [] [] [] [] [] [] | 15460 dico | [] [] | 15461 diffutils | [] [] [] [] | 15462 dink | [] [] [] | 15463 direvent | [] [] | 15464 doodle | [] [] [] | 15465 dos2unix | [] [] | 15466 dos2unix-man | [] | 15467 e2fsprogs | [] [] [] [] | 15468 enscript | [] [] [] | 15469 exif | [] [] [] [] | 15470 fetchmail | [] [] [] () | 15471 findutils | [] [] [] [] | 15472 flex | [] [] [] [] | 15473 freedink | [] [] [] [] | 15474 fusionforge | [] | 15475 gas | | 15476 gawk | [] [] | 15477 gcal | [] [] [] | 15478 gcc | [] | 15479 gdbm | [] [] | 15480 gettext-examples | [] [] [] [] [] [] [] | 15481 gettext-runtime | [] [] [] [] [] [] | 15482 gettext-tools | [] [] [] [] | 15483 gjay | [] | 15484 glunarclock | [] [] [] [] [] | 15485 gnubiff | [] () | 15486 gnubik | [] [] [] | 15487 gnucash | [] () [] () | 15488 gnuchess | [] [] | 15489 gnucobol | | 15490 gnulib | [] [] [] [] | 15491 gnunet | | 15492 gnunet-gtk | [] | 15493 gnutls | [] [] | 15494 gold | | 15495 gphoto2 | [] [] () | 15496 gprof | [] [] [] | 15497 gramadoir | [] [] | 15498 grep | [] [] [] [] [] | 15499 grip | [] [] [] [] [] | 15500 grub | [] [] [] [] | 15501 gsasl | [] [] | 15502 gss | [] [] | 15503 gst-plugins-bad | [] [] [] [] [] | 15504 gst-plugins-base | [] [] [] [] [] | 15505 gst-plugins-good | [] [] [] [] [] | 15506 gst-plugins-ugly | [] [] [] [] [] [] | 15507 gstreamer | [] [] [] [] [] [] | 15508 gtick | [] [] () | 15509 gtkam | [] [] [] () | 15510 gtkspell | [] [] [] [] [] [] [] | 15511 guix | [] [] | 15512 guix-manual | [] | 15513 guix-packages | | 15514 gutenprint | [] [] [] | 15515 hello | [] [] [] [] | 15516 help2man | [] [] | 15517 help2man-texi | [] | 15518 hylafax | [] | 15519 idutils | [] [] | 15520 jwhois | [] | 15521 kbd | [] | 15522 klavaro | [] [] [] [] [] [] [] | 15523 ld | [] | 15524 libc | [] [] [] [] [] | 15525 libexif | () [] [] | 15526 libextractor | [] [] | 15527 libgphoto2 | [] [] () | 15528 libgphoto2_port | [] [] () | 15529 libgsasl | [] [] | 15530 libiconv | [] [] [] [] | 15531 libidn | [] [] [] | 15532 libidn2 | [] [] [] | 15533 lilypond | [] [] [] [] | 15534 lordsawar | [] [] [] | 15535 lprng | | 15536 lynx | [] [] [] [] | 15537 m4 | [] [] [] [] | 15538 mailfromd | [] | 15539 mailutils | [] | 15540 make | [] [] [] [] | 15541 man-db | [] [] [] [] [] | 15542 man-db-manpages | [] | 15543 meritous | [] | 15544 midi-instruments | [] [] [] [] [] | 15545 minicom | [] [] [] | 15546 mkisofs | [] | 15547 mpop | [] | 15548 msmtp | [] | 15549 muibase | () | 15550 myserver | [] [] | 15551 nano | [] [] [] [] | 15552 opcodes | [] | 15553 parted | [] [] [] | 15554 pies | [] | 15555 pnmixer | [] [] | 15556 procps-ng | [] | 15557 procps-ng-man | [] | 15558 psmisc | [] [] [] | 15559 pspp | [] [] | 15560 pushover | [] () | 15561 pwdutils | [] [] | 15562 pyspread | [] [] | 15563 radius | [] | 15564 recode | [] [] [] [] [] | 15565 recutils | [] | 15566 rush | [] [] | 15567 sarg | [] [] | 15568 savane | | 15569 sed | [] [] [] [] [] [] | 15570 sharutils | [] [] | 15571 shepherd | [] [] | 15572 shishi | [] | 15573 skribilo | [] | 15574 solfege | [] [] [] [] | 15575 solfege-manual | [] [] | 15576 spotmachine | [] [] | 15577 sudo | [] [] [] [] [] | 15578 sudoers | [] [] [] [] | 15579 sysstat | [] [] | 15580 tar | [] [] [] [] [] | 15581 texinfo | [] [] [] [] | 15582 texinfo_document | [] [] [] | 15583 tigervnc | [] [] [] [] | 15584 tin | [] [] | 15585 tin-man | | 15586 tracgoogleappsa... | [] [] | 15587 trader | [] [] | 15588 util-linux | [] [] [] | 15589 ve | [] | 15590 vmm | [] | 15591 vorbis-tools | [] [] [] | 15592 wastesedge | [] | 15593 wcd | [] [] | 15594 wcd-man | [] | 15595 wdiff | [] [] [] [] | 15596 wget | [] [] | 15597 wget2 | [] | 15598 wyslij-po | [] [] | 15599 xboard | [] [] | 15600 xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] | 15601 xkeyboard-config | [] [] [] [] [] | 15602 xz | [] [] | 15603 +---------------------------------------------------+ 15604 af an ar ast be bg bn bn_IN ca ckb crh cs da de 15605 3 2 4 17 6 31 1 1 54 1 1 69 114 138 15606 15607 el en en_GB eo es et eu fa fi fr fur ga gd gl 15608 +-------------------------------------------------+ 15609 a2ps | [] [] [] [] [] [] [] | 15610 aegis | [] [] | 15611 anubis | [] [] [] | 15612 aspell | [] [] [] [] [] [] [] | 15613 bash | [] [] [] [] | 15614 bfd | [] | 15615 binutils | [] | 15616 bison | [] [] [] | 15617 bison-runtime | [] [] [] [] [] [] [] [] | 15618 buzztrax | [] [] [] | 15619 ccd2cue | [] [] [] | 15620 ccide | [] [] [] [] [] | 15621 cflow | [] [] [] [] [] | 15622 clisp | [] [] [] | 15623 coreutils | [] [] [] | 15624 cpio | [] [] [] [] | 15625 cppi | [] [] [] [] [] | 15626 cpplib | [] [] [] [] | 15627 cryptsetup | [] [] | 15628 datamash | [] [] [] | 15629 denemo | | 15630 dfarc | [] [] [] [] [] | 15631 dialog | [] [] [] [] [] [] [] [] [] [] [] | 15632 dico | [] [] [] | 15633 diffutils | [] [] [] [] [] | 15634 dink | [] [] [] [] | 15635 direvent | [] [] [] | 15636 doodle | [] [] [] [] [] | 15637 dos2unix | [] [] [] [] | 15638 dos2unix-man | [] [] | 15639 e2fsprogs | [] [] | 15640 enscript | [] [] [] [] [] [] | 15641 exif | [] [] [] [] [] [] | 15642 fetchmail | [] [] [] [] [] | 15643 findutils | [] [] [] [] [] [] [] [] | 15644 flex | [] [] [] [] [] | 15645 freedink | [] [] [] [] [] [] [] | 15646 fusionforge | [] [] | 15647 gas | [] [] [] | 15648 gawk | [] [] [] | 15649 gcal | [] [] | 15650 gcc | [] [] | 15651 gdbm | [] [] [] [] | 15652 gettext-examples | [] [] [] [] [] [] [] | 15653 gettext-runtime | [] [] [] [] [] [] | 15654 gettext-tools | [] [] [] | 15655 gjay | [] [] [] [] | 15656 glunarclock | [] [] [] [] [] [] | 15657 gnubiff | [] [] () | 15658 gnubik | [] [] [] [] [] [] | 15659 gnucash | () () () () () | 15660 gnuchess | [] [] [] | 15661 gnucobol | [] [] | 15662 gnulib | [] [] [] [] [] | 15663 gnunet | [] | 15664 gnunet-gtk | [] | 15665 gnutls | [] [] [] [] | 15666 gold | [] [] [] | 15667 gphoto2 | [] [] | 15668 gprof | [] [] [] [] [] | 15669 gramadoir | [] [] [] [] [] | 15670 grep | [] [] [] [] [] [] | 15671 grip | [] [] [] [] | 15672 grub | [] [] [] [] | 15673 gsasl | [] [] [] [] [] | 15674 gss | [] [] [] [] [] | 15675 gst-plugins-bad | [] [] | 15676 gst-plugins-base | [] [] [] [] [] [] | 15677 gst-plugins-good | [] [] [] [] [] [] | 15678 gst-plugins-ugly | [] [] [] [] [] [] [] [] | 15679 gstreamer | [] [] [] [] [] [] | 15680 gtick | [] [] [] [] [] [] | 15681 gtkam | [] [] [] [] | 15682 gtkspell | [] [] [] [] [] [] [] [] [] | 15683 guix | [] [] | 15684 guix-manual | [] [] | 15685 guix-packages | | 15686 gutenprint | [] [] [] | 15687 hello | [] [] [] [] [] [] [] [] | 15688 help2man | [] [] [] [] [] | 15689 help2man-texi | [] [] | 15690 hylafax | [] | 15691 idutils | [] [] [] [] | 15692 jwhois | [] [] [] [] [] | 15693 kbd | [] | 15694 klavaro | [] [] [] [] [] [] | 15695 ld | [] [] | 15696 libc | [] [] [] [] | 15697 libexif | () [] [] | 15698 libextractor | [] [] | 15699 libgphoto2 | [] [] | 15700 libgphoto2_port | [] [] [] [] | 15701 libgsasl | [] [] [] [] [] | 15702 libiconv | [] [] [] [] [] [] [] | 15703 libidn | [] [] [] | 15704 libidn2 | [] [] | 15705 lilypond | [] [] [] [] | 15706 lordsawar | [] | 15707 lprng | | 15708 lynx | [] [] [] [] | 15709 m4 | [] [] [] [] [] [] [] | 15710 mailfromd | [] | 15711 mailutils | [] [] [] | 15712 make | [] [] [] [] | 15713 man-db | [] [] [] | 15714 man-db-manpages | [] [] | 15715 meritous | [] | 15716 midi-instruments | [] [] [] [] [] [] [] [] | 15717 minicom | [] [] [] | 15718 mkisofs | [] [] [] [] | 15719 mpop | [] [] | 15720 msmtp | [] [] | 15721 muibase | [] | 15722 myserver | [] [] [] | 15723 nano | [] [] [] [] [] [] | 15724 opcodes | [] [] | 15725 parted | [] [] [] | 15726 pies | [] [] | 15727 pnmixer | [] | 15728 procps-ng | [] | 15729 procps-ng-man | [] | 15730 psmisc | [] [] [] [] [] | 15731 pspp | [] [] [] [] | 15732 pushover | [] [] [] | 15733 pwdutils | [] | 15734 pyspread | [] | 15735 radius | [] [] | 15736 recode | [] [] [] [] [] [] | 15737 recutils | [] [] | 15738 rush | [] [] | 15739 sarg | [] [] | 15740 savane | [] [] | 15741 sed | [] [] [] [] [] [] [] [] | 15742 sharutils | [] [] [] | 15743 shepherd | [] [] | 15744 shishi | [] [] | 15745 skribilo | [] [] [] | 15746 solfege | [] [] [] [] [] [] [] | 15747 solfege-manual | [] [] [] [] | 15748 spotmachine | [] [] [] | 15749 sudo | [] [] [] [] [] [] | 15750 sudoers | [] [] [] | 15751 sysstat | [] [] [] | 15752 tar | [] [] [] [] [] [] | 15753 texinfo | [] [] [] | 15754 texinfo_document | [] [] [] | 15755 tigervnc | [] [] [] [] [] [] | 15756 tin | [] [] | 15757 tin-man | [] | 15758 tracgoogleappsa... | [] [] [] [] | 15759 trader | [] [] [] [] | 15760 util-linux | [] [] | 15761 ve | [] [] [] [] [] | 15762 vmm | [] | 15763 vorbis-tools | [] [] [] | 15764 wastesedge | [] | 15765 wcd | [] [] [] [] [] | 15766 wcd-man | [] | 15767 wdiff | [] [] [] [] [] [] [] | 15768 wget | [] [] [] [] [] [] | 15769 wget2 | [] | 15770 wyslij-po | [] [] [] [] [] | 15771 xboard | [] [] | 15772 xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] | 15773 xkeyboard-config | [] [] [] [] [] [] | 15774 xz | [] [] [] | 15775 +-------------------------------------------------+ 15776 el en en_GB eo es et eu fa fi fr fur ga gd gl 15777 24 1 6 89 122 20 8 4 90 154 24 33 2 38 15778 15779 gu he hi hr hu hy id is it ja ka kk kn ko ku ky 15780 +-------------------------------------------------+ 15781 a2ps | [] [] [] [] | 15782 aegis | [] | 15783 anubis | [] [] [] [] | 15784 aspell | [] [] [] [] | 15785 bash | [] [] [] | 15786 bfd | | 15787 binutils | | 15788 bison | [] | 15789 bison-runtime | [] [] [] [] [] [] | 15790 buzztrax | | 15791 ccd2cue | [] | 15792 ccide | [] [] | 15793 cflow | [] [] | 15794 clisp | | 15795 coreutils | [] [] | 15796 cpio | [] [] [] [] [] [] | 15797 cppi | [] [] [] [] | 15798 cpplib | [] [] | 15799 cryptsetup | [] [] | 15800 datamash | | 15801 denemo | [] | 15802 dfarc | [] [] [] | 15803 dialog | [] [] [] [] [] [] [] | 15804 dico | | 15805 diffutils | [] [] [] [] [] | 15806 dink | [] | 15807 direvent | [] | 15808 doodle | [] | 15809 dos2unix | [] [] | 15810 dos2unix-man | | 15811 e2fsprogs | [] | 15812 enscript | [] [] | 15813 exif | [] [] [] [] [] [] | 15814 fetchmail | [] [] [] | 15815 findutils | [] [] [] [] [] | 15816 flex | | 15817 freedink | [] [] [] [] | 15818 fusionforge | | 15819 gas | [] | 15820 gawk | [] () [] | 15821 gcal | | 15822 gcc | | 15823 gdbm | | 15824 gettext-examples | [] [] [] [] [] [] | 15825 gettext-runtime | [] [] [] [] [] | 15826 gettext-tools | [] [] [] [] | 15827 gjay | | 15828 glunarclock | [] [] [] [] | 15829 gnubiff | [] [] () | 15830 gnubik | [] [] | 15831 gnucash | () () () () () () [] () () | 15832 gnuchess | | 15833 gnucobol | | 15834 gnulib | [] [] [] | 15835 gnunet | | 15836 gnunet-gtk | | 15837 gnutls | [] | 15838 gold | | 15839 gphoto2 | [] [] [] [] | 15840 gprof | [] [] [] | 15841 gramadoir | [] [] | 15842 grep | [] [] [] [] [] [] | 15843 grip | [] [] [] [] | 15844 grub | [] [] [] | 15845 gsasl | [] [] [] [] | 15846 gss | [] [] [] [] | 15847 gst-plugins-bad | [] [] [] [] | 15848 gst-plugins-base | [] [] [] [] | 15849 gst-plugins-good | [] [] [] [] [] | 15850 gst-plugins-ugly | [] [] [] [] [] | 15851 gstreamer | [] [] [] [] | 15852 gtick | [] [] [] | 15853 gtkam | [] [] [] [] [] | 15854 gtkspell | [] [] [] [] [] [] [] [] [] | 15855 guix | | 15856 guix-manual | | 15857 guix-packages | | 15858 gutenprint | [] [] [] | 15859 hello | [] [] [] | 15860 help2man | [] [] [] | 15861 help2man-texi | | 15862 hylafax | [] | 15863 idutils | [] [] | 15864 jwhois | [] [] [] | 15865 kbd | | 15866 klavaro | [] [] [] [] | 15867 ld | | 15868 libc | [] [] [] [] [] | 15869 libexif | [] | 15870 libextractor | | 15871 libgphoto2 | | 15872 libgphoto2_port | [] [] | 15873 libgsasl | [] [] [] | 15874 libiconv | [] [] [] [] [] | 15875 libidn | [] [] [] [] | 15876 libidn2 | [] | 15877 lilypond | [] [] | 15878 lordsawar | | 15879 lprng | [] | 15880 lynx | [] [] [] [] | 15881 m4 | [] [] [] | 15882 mailfromd | | 15883 mailutils | | 15884 make | [] [] [] [] [] | 15885 man-db | [] [] | 15886 man-db-manpages | [] | 15887 meritous | | 15888 midi-instruments | [] [] [] [] [] [] [] [] [] [] | 15889 minicom | [] [] [] | 15890 mkisofs | [] [] | 15891 mpop | | 15892 msmtp | | 15893 muibase | | 15894 myserver | [] | 15895 nano | [] [] [] [] [] | 15896 opcodes | | 15897 parted | [] [] [] [] [] | 15898 pies | | 15899 pnmixer | [] [] | 15900 procps-ng | | 15901 procps-ng-man | | 15902 psmisc | [] [] [] | 15903 pspp | [] [] | 15904 pushover | [] | 15905 pwdutils | [] | 15906 pyspread | | 15907 radius | [] | 15908 recode | [] [] [] [] [] | 15909 recutils | | 15910 rush | | 15911 sarg | | 15912 savane | | 15913 sed | [] [] [] [] [] [] | 15914 sharutils | | 15915 shepherd | | 15916 shishi | | 15917 skribilo | [] | 15918 solfege | [] | 15919 solfege-manual | | 15920 spotmachine | | 15921 sudo | [] [] [] [] [] | 15922 sudoers | [] [] [] [] | 15923 sysstat | [] [] | 15924 tar | [] [] [] [] [] [] [] | 15925 texinfo | [] [] [] | 15926 texinfo_document | [] [] [] | 15927 tigervnc | [] [] [] | 15928 tin | | 15929 tin-man | | 15930 tracgoogleappsa... | [] [] [] [] | 15931 trader | [] [] | 15932 util-linux | [] [] | 15933 ve | [] [] | 15934 vmm | | 15935 vorbis-tools | [] [] | 15936 wastesedge | [] | 15937 wcd | | 15938 wcd-man | | 15939 wdiff | [] [] | 15940 wget | [] [] [] [] | 15941 wget2 | [] [] | 15942 wyslij-po | [] [] [] | 15943 xboard | | 15944 xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] | 15945 xkeyboard-config | [] [] [] [] [] | 15946 xz | [] [] [] | 15947 +-------------------------------------------------+ 15948 gu he hi hr hu hy id is it ja ka kk kn ko ku ky 15949 1 5 1 61 69 2 63 7 76 49 0 2 1 20 3 6 15950 15951 lg lt lv mk ml mn mr ms mt nb ne nl nn or pa pl 15952 +---------------------------------------------------+ 15953 a2ps | [] [] [] | 15954 aegis | [] | 15955 anubis | [] [] [] [] | 15956 aspell | [] [] [] | 15957 bash | [] [] [] | 15958 bfd | | 15959 binutils | | 15960 bison | | 15961 bison-runtime | [] [] [] [] [] [] | 15962 buzztrax | | 15963 ccd2cue | | 15964 ccide | [] [] [] | 15965 cflow | [] [] | 15966 clisp | [] | 15967 coreutils | [] [] [] | 15968 cpio | [] [] | 15969 cppi | [] | 15970 cpplib | [] | 15971 cryptsetup | [] | 15972 datamash | [] [] | 15973 denemo | | 15974 dfarc | [] [] [] | 15975 dialog | [] [] [] [] [] [] | 15976 dico | [] | 15977 diffutils | [] [] [] [] | 15978 dink | [] | 15979 direvent | [] [] | 15980 doodle | [] | 15981 dos2unix | [] [] [] | 15982 dos2unix-man | [] [] | 15983 e2fsprogs | [] [] | 15984 enscript | [] [] | 15985 exif | [] [] [] [] | 15986 fetchmail | [] [] | 15987 findutils | [] [] [] | 15988 flex | [] [] | 15989 freedink | [] [] [] | 15990 fusionforge | | 15991 gas | | 15992 gawk | [] [] | 15993 gcal | | 15994 gcc | | 15995 gdbm | [] | 15996 gettext-examples | [] [] [] [] [] [] [] | 15997 gettext-runtime | [] [] [] [] | 15998 gettext-tools | [] | 15999 gjay | | 16000 glunarclock | [] [] [] | 16001 gnubiff | [] | 16002 gnubik | [] [] [] | 16003 gnucash | () () () () () [] () | 16004 gnuchess | [] [] | 16005 gnucobol | | 16006 gnulib | [] [] | 16007 gnunet | | 16008 gnunet-gtk | | 16009 gnutls | [] [] | 16010 gold | | 16011 gphoto2 | [] [] | 16012 gprof | [] [] | 16013 gramadoir | [] | 16014 grep | [] [] [] | 16015 grip | [] [] [] | 16016 grub | [] [] [] [] | 16017 gsasl | [] [] | 16018 gss | [] | 16019 gst-plugins-bad | [] [] [] [] | 16020 gst-plugins-base | [] [] [] [] | 16021 gst-plugins-good | [] [] [] [] | 16022 gst-plugins-ugly | [] [] [] [] [] [] | 16023 gstreamer | [] [] [] [] | 16024 gtick | [] [] | 16025 gtkam | [] [] [] [] | 16026 gtkspell | [] [] [] [] [] [] [] | 16027 guix | | 16028 guix-manual | | 16029 guix-packages | | 16030 gutenprint | [] | 16031 hello | [] [] [] [] | 16032 help2man | [] [] | 16033 help2man-texi | [] | 16034 hylafax | [] | 16035 idutils | [] [] [] | 16036 jwhois | [] [] [] | 16037 kbd | [] | 16038 klavaro | [] [] [] [] | 16039 ld | | 16040 libc | [] [] | 16041 libexif | [] [] | 16042 libextractor | [] [] | 16043 libgphoto2 | [] [] | 16044 libgphoto2_port | [] [] | 16045 libgsasl | [] [] | 16046 libiconv | [] [] [] | 16047 libidn | [] [] | 16048 libidn2 | [] | 16049 lilypond | [] | 16050 lordsawar | | 16051 lprng | [] | 16052 lynx | [] | 16053 m4 | [] [] | 16054 mailfromd | [] | 16055 mailutils | [] | 16056 make | [] [] | 16057 man-db | [] [] | 16058 man-db-manpages | [] | 16059 meritous | | 16060 midi-instruments | [] [] [] [] [] [] | 16061 minicom | [] [] | 16062 mkisofs | [] [] | 16063 mpop | | 16064 msmtp | | 16065 muibase | [] | 16066 myserver | | 16067 nano | [] [] [] [] | 16068 opcodes | | 16069 parted | [] [] | 16070 pies | [] | 16071 pnmixer | [] | 16072 procps-ng | [] | 16073 procps-ng-man | [] | 16074 psmisc | [] [] | 16075 pspp | [] [] [] | 16076 pushover | | 16077 pwdutils | [] [] | 16078 pyspread | [] | 16079 radius | [] [] | 16080 recode | [] [] [] | 16081 recutils | [] | 16082 rush | [] [] | 16083 sarg | | 16084 savane | | 16085 sed | [] [] [] | 16086 sharutils | [] [] | 16087 shepherd | | 16088 shishi | [] | 16089 skribilo | | 16090 solfege | [] [] [] | 16091 solfege-manual | [] [] | 16092 spotmachine | [] | 16093 sudo | [] [] [] | 16094 sudoers | [] [] [] | 16095 sysstat | [] [] [] | 16096 tar | [] [] [] | 16097 texinfo | [] [] [] | 16098 texinfo_document | [] [] | 16099 tigervnc | [] | 16100 tin | | 16101 tin-man | | 16102 tracgoogleappsa... | [] [] [] [] | 16103 trader | [] | 16104 util-linux | [] [] | 16105 ve | [] [] | 16106 vmm | [] | 16107 vorbis-tools | [] [] | 16108 wastesedge | [] | 16109 wcd | [] | 16110 wcd-man | [] | 16111 wdiff | [] [] [] [] | 16112 wget | [] [] [] | 16113 wget2 | [] | 16114 wyslij-po | [] [] [] | 16115 xboard | [] [] | 16116 xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] | 16117 xkeyboard-config | [] [] | 16118 xz | [] | 16119 +---------------------------------------------------+ 16120 lg lt lv mk ml mn mr ms mt nb ne nl nn or pa pl 16121 1 9 16 2 1 3 1 12 2 44 1 111 5 1 3 107 16122 16123 ps pt pt_BR ro ru rw sk sl sq sr sv sw ta te tg 16124 +---------------------------------------------------+ 16125 a2ps | [] [] [] [] [] [] [] | 16126 aegis | [] [] [] [] | 16127 anubis | [] [] [] [] | 16128 aspell | [] [] [] [] [] [] [] [] [] | 16129 bash | [] [] [] [] [] | 16130 bfd | [] [] [] | 16131 binutils | [] [] [] [] | 16132 bison | [] [] [] [] | 16133 bison-runtime | [] [] [] [] [] [] [] [] [] | 16134 buzztrax | [] [] [] | 16135 ccd2cue | [] [] [] | 16136 ccide | [] [] [] | 16137 cflow | [] [] [] | 16138 clisp | [] [] | 16139 coreutils | [] [] [] [] [] [] | 16140 cpio | [] [] [] [] [] | 16141 cppi | [] [] [] | 16142 cpplib | [] [] [] [] | 16143 cryptsetup | [] [] [] [] | 16144 datamash | [] [] [] | 16145 denemo | | 16146 dfarc | [] [] [] | 16147 dialog | [] [] [] [] [] [] [] [] [] [] | 16148 dico | [] [] [] | 16149 diffutils | [] [] [] [] [] | 16150 dink | [] | 16151 direvent | [] [] [] | 16152 doodle | [] [] [] | 16153 dos2unix | [] [] [] [] | 16154 dos2unix-man | [] [] | 16155 e2fsprogs | [] [] [] | 16156 enscript | [] [] [] [] [] [] | 16157 exif | [] [] [] [] [] [] [] | 16158 fetchmail | [] [] [] [] [] | 16159 findutils | [] [] [] [] [] [] [] | 16160 flex | [] [] [] [] [] [] | 16161 freedink | [] [] [] [] [] | 16162 fusionforge | | 16163 gas | [] [] | 16164 gawk | [] [] [] [] | 16165 gcal | [] | 16166 gcc | [] [] | 16167 gdbm | [] [] [] [] | 16168 gettext-examples | [] [] [] [] [] [] [] [] [] [] | 16169 gettext-runtime | [] [] [] [] [] [] [] [] | 16170 gettext-tools | [] [] [] [] [] [] [] [] | 16171 gjay | [] [] | 16172 glunarclock | [] [] [] [] [] [] | 16173 gnubiff | [] [] | 16174 gnubik | [] [] [] [] | 16175 gnucash | () () () [] () () | 16176 gnuchess | [] [] [] | 16177 gnucobol | [] | 16178 gnulib | [] [] [] [] [] [] | 16179 gnunet | | 16180 gnunet-gtk | | 16181 gnutls | [] [] [] | 16182 gold | [] | 16183 gphoto2 | [] [] [] [] [] | 16184 gprof | [] [] [] [] [] | 16185 gramadoir | [] [] [] | 16186 grep | [] [] [] [] [] [] [] | 16187 grip | [] [] [] | 16188 grub | [] [] [] [] [] [] | 16189 gsasl | [] [] [] [] | 16190 gss | [] [] [] [] [] | 16191 gst-plugins-bad | [] [] [] [] [] [] | 16192 gst-plugins-base | [] [] [] [] [] [] [] | 16193 gst-plugins-good | [] [] [] [] [] [] [] | 16194 gst-plugins-ugly | [] [] [] [] [] [] [] [] | 16195 gstreamer | [] [] [] [] [] [] [] | 16196 gtick | [] [] [] [] [] | 16197 gtkam | [] [] [] [] [] | 16198 gtkspell | [] [] [] [] [] [] [] [] [] [] | 16199 guix | [] | 16200 guix-manual | | 16201 guix-packages | | 16202 gutenprint | [] [] [] [] | 16203 hello | [] [] [] [] [] [] [] [] | 16204 help2man | [] [] [] [] | 16205 help2man-texi | [] [] | 16206 hylafax | [] | 16207 idutils | [] [] [] [] | 16208 jwhois | [] [] [] [] | 16209 kbd | [] [] [] [] | 16210 klavaro | [] [] [] [] [] [] | 16211 ld | [] [] [] | 16212 libc | [] [] [] [] | 16213 libexif | [] [] | 16214 libextractor | [] [] | 16215 libgphoto2 | [] | 16216 libgphoto2_port | [] [] [] [] [] | 16217 libgsasl | [] [] [] [] [] | 16218 libiconv | [] [] [] [] [] [] | 16219 libidn | [] [] [] | 16220 libidn2 | [] [] [] [] [] | 16221 lilypond | [] | 16222 lordsawar | [] | 16223 lprng | [] | 16224 lynx | [] [] [] | 16225 m4 | [] [] [] [] [] | 16226 mailfromd | [] [] | 16227 mailutils | [] | 16228 make | [] [] [] [] [] | 16229 man-db | [] [] [] [] [] [] | 16230 man-db-manpages | [] [] [] [] [] [] | 16231 meritous | [] [] | 16232 midi-instruments | [] [] [] [] [] [] [] [] | 16233 minicom | [] [] [] [] [] | 16234 mkisofs | [] [] [] | 16235 mpop | [] [] | 16236 msmtp | [] [] | 16237 muibase | [] | 16238 myserver | [] [] [] | 16239 nano | [] [] [] [] [] [] | 16240 opcodes | [] [] [] | 16241 parted | [] [] [] [] [] [] | 16242 pies | [] | 16243 pnmixer | [] () [] [] | 16244 procps-ng | [] [] | 16245 procps-ng-man | [] [] | 16246 psmisc | [] [] [] [] [] | 16247 pspp | [] [] | 16248 pushover | [] [] | 16249 pwdutils | [] [] | 16250 pyspread | [] | 16251 radius | [] | 16252 recode | [] [] [] [] [] [] [] [] | 16253 recutils | [] [] [] | 16254 rush | [] [] [] | 16255 sarg | [] [] [] | 16256 savane | [] () | 16257 sed | [] [] [] [] [] [] [] [] | 16258 sharutils | [] [] [] | 16259 shepherd | [] [] [] [] | 16260 shishi | [] [] | 16261 skribilo | [] [] [] | 16262 solfege | [] [] [] | 16263 solfege-manual | [] | 16264 spotmachine | [] [] [] | 16265 sudo | [] [] [] [] [] [] [] | 16266 sudoers | [] [] [] [] [] | 16267 sysstat | [] [] [] [] [] [] | 16268 tar | [] [] [] [] [] [] [] | 16269 texinfo | [] [] [] [] | 16270 texinfo_document | [] [] [] | 16271 tigervnc | [] [] [] [] | 16272 tin | [] | 16273 tin-man | | 16274 tracgoogleappsa... | [] [] [] [] [] [] | 16275 trader | [] [] [] [] | 16276 util-linux | [] [] [] | 16277 ve | [] [] [] [] | 16278 vmm | [] [] | 16279 vorbis-tools | [] [] [] | 16280 wastesedge | [] [] | 16281 wcd | [] [] | 16282 wcd-man | [] | 16283 wdiff | [] [] [] [] [] | 16284 wget | [] [] [] [] [] [] [] | 16285 wget2 | [] | 16286 wyslij-po | [] [] [] | 16287 xboard | [] [] | 16288 xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] | 16289 xkeyboard-config | [] [] [] [] [] | 16290 xz | [] [] [] | 16291 +---------------------------------------------------+ 16292 ps pt pt_BR ro ru rw sk sl sq sr sv sw ta te tg 16293 1 46 121 43 86 0 35 35 8 121 132 1 8 1 0 16294 16295 th tr uk ur vi wa wo zh_CN zh_HK zh_TW 16296 +------------------------------------------+ 16297 a2ps | [] [] [] [] | 30 16298 aegis | [] | 11 16299 anubis | [] [] [] | 20 16300 aspell | [] [] [] [] | 32 16301 bash | [] [] [] [] [] | 24 16302 bfd | [] | 5 16303 binutils | [] | 7 16304 bison | [] [] | 12 16305 bison-runtime | [] [] [] [] [] [] | 40 16306 buzztrax | [] [] | 11 16307 ccd2cue | [] [] [] [] | 13 16308 ccide | [] [] [] | 18 16309 cflow | [] [] [] | 17 16310 clisp | | 11 16311 coreutils | [] [] [] [] | 23 16312 cpio | [] [] [] [] | 23 16313 cppi | [] [] [] | 18 16314 cpplib | [] [] [] [] [] | 19 16315 cryptsetup | [] | 13 16316 datamash | [] | 11 16317 denemo | [] | 5 16318 dfarc | [] | 18 16319 dialog | [] [] [] [] [] [] | 46 16320 dico | [] | 10 16321 diffutils | [] [] [] [] [] | 28 16322 dink | [] | 11 16323 direvent | [] [] | 13 16324 doodle | [] | 14 16325 dos2unix | [] [] [] [] | 19 16326 dos2unix-man | [] [] | 9 16327 e2fsprogs | [] [] [] | 15 16328 enscript | [] [] [] | 22 16329 exif | [] [] [] [] | 31 16330 fetchmail | [] [] [] | 21 16331 findutils | [] [] [] [] [] | 32 16332 flex | [] [] [] [] [] | 22 16333 freedink | [] [] | 25 16334 fusionforge | | 3 16335 gas | [] | 7 16336 gawk | [] [] | 15 16337 gcal | [] [] | 8 16338 gcc | | 5 16339 gdbm | [] [] | 13 16340 gettext-examples | [] [] [] [] [] [] | 43 16341 gettext-runtime | [] [] [] [] [] | 34 16342 gettext-tools | [] [] [] [] [] | 25 16343 gjay | [] [] [] | 10 16344 glunarclock | [] [] [] [] | 28 16345 gnubiff | [] [] | 10 16346 gnubik | [] [] [] | 21 16347 gnucash | [] [] () () () | 8 16348 gnuchess | [] [] [] | 13 16349 gnucobol | | 3 16350 gnulib | [] [] [] [] | 24 16351 gnunet | | 1 16352 gnunet-gtk | | 2 16353 gnutls | [] [] [] | 15 16354 gold | [] | 5 16355 gphoto2 | [] [] [] [] | 19 16356 gprof | [] [] [] | 21 16357 gramadoir | [] [] | 15 16358 grep | [] [] [] [] [] | 32 16359 grip | [] [] [] [] [] | 24 16360 grub | [] [] [] [] | 25 16361 gsasl | [] [] [] [] | 21 16362 gss | [] [] | 19 16363 gst-plugins-bad | [] [] [] [] [] | 26 16364 gst-plugins-base | [] [] [] [] | 30 16365 gst-plugins-good | [] [] [] [] [] | 32 16366 gst-plugins-ugly | [] [] [] [] [] | 38 16367 gstreamer | [] [] [] [] [] | 32 16368 gtick | [] [] [] | 21 16369 gtkam | [] [] [] | 24 16370 gtkspell | [] [] [] [] [] [] [] [] | 50 16371 guix | | 5 16372 guix-manual | | 3 16373 guix-packages | | 0 16374 gutenprint | [] [] [] | 17 16375 hello | [] [] [] [] [] [] | 33 16376 help2man | [] [] [] | 19 16377 help2man-texi | [] | 7 16378 hylafax | [] | 6 16379 idutils | [] [] [] | 18 16380 jwhois | [] [] [] [] | 20 16381 kbd | [] | 8 16382 klavaro | [] [] [] [] [] | 32 16383 ld | [] | 7 16384 libc | [] [] [] [] [] | 25 16385 libexif | [] [] () | 11 16386 libextractor | [] [] | 10 16387 libgphoto2 | [] [] | 9 16388 libgphoto2_port | [] [] [] [] | 19 16389 libgsasl | [] [] [] | 20 16390 libiconv | [] [] [] [] [] | 30 16391 libidn | [] [] [] | 18 16392 libidn2 | [] [] | 14 16393 lilypond | | 12 16394 lordsawar | [] | 6 16395 lprng | [] | 4 16396 lynx | [] [] [] | 19 16397 m4 | [] [] [] | 24 16398 mailfromd | [] [] | 7 16399 mailutils | [] | 7 16400 make | [] [] [] [] | 24 16401 man-db | [] [] [] [] | 22 16402 man-db-manpages | [] [] | 13 16403 meritous | | 4 16404 midi-instruments | [] [] [] [] [] [] | 43 16405 minicom | [] [] | 18 16406 mkisofs | [] [] [] | 15 16407 mpop | [] | 6 16408 msmtp | [] | 6 16409 muibase | [] | 4 16410 myserver | [] | 10 16411 nano | [] [] [] [] [] | 30 16412 opcodes | [] | 7 16413 parted | [] [] [] [] [] | 24 16414 pies | [] [] | 7 16415 pnmixer | [] [] () | 13 16416 procps-ng | [] [] | 7 16417 procps-ng-man | [] | 6 16418 psmisc | [] [] [] [] | 22 16419 pspp | [] [] [] | 16 16420 pushover | | 7 16421 pwdutils | [] | 9 16422 pyspread | [] | 6 16423 radius | [] [] | 9 16424 recode | [] [] [] [] | 31 16425 recutils | [] [] | 9 16426 rush | [] [] [] | 12 16427 sarg | | 7 16428 savane | | 3 16429 sed | [] [] [] [] [] | 36 16430 sharutils | [] [] [] | 13 16431 shepherd | [] | 9 16432 shishi | [] [] | 8 16433 skribilo | [] | 9 16434 solfege | [] [] [] | 21 16435 solfege-manual | [] | 10 16436 spotmachine | [] [] | 11 16437 sudo | [] [] [] [] [] | 31 16438 sudoers | [] [] [] [] | 23 16439 sysstat | [] [] [] | 19 16440 tar | [] [] [] [] [] | 33 16441 texinfo | [] [] [] | 20 16442 texinfo_document | [] | 15 16443 tigervnc | [] [] [] [] [] | 23 16444 tin | [] [] [] | 8 16445 tin-man | | 1 16446 tracgoogleappsa... | [] [] [] [] [] | 25 16447 trader | | 13 16448 util-linux | [] [] [] [] | 16 16449 ve | [] [] [] | 17 16450 vmm | | 5 16451 vorbis-tools | [] | 14 16452 wastesedge | [] | 7 16453 wcd | [] [] [] | 13 16454 wcd-man | [] | 5 16455 wdiff | [] [] [] [] | 26 16456 wget | [] [] [] [] [] | 27 16457 wget2 | [] | 7 16458 wyslij-po | [] [] [] | 19 16459 xboard | [] [] [] | 11 16460 xdg-user-dirs | [] [] [] [] [] [] [] [] | 70 16461 xkeyboard-config | [] [] | 25 16462 xz | [] [] [] [] | 16 16463 +------------------------------------------+ 16464 85 teams th tr uk ur vi wa wo zh_CN zh_HK zh_TW 16465 166 domains 12 55 117 1 111 6 1 92 4 48 2827 16466 16467 Some counters in the preceding matrix are higher than the number of 16468visible blocks let us expect. This is because a few extra PO files are 16469used for implementing regional variants of languages, or language 16470dialects. 16471 16472 For a PO file in the matrix above to be effective, the package to 16473which it applies should also have been internationalized and distributed 16474as such by its maintainer. There might be an observable lag between the 16475mere existence a PO file and its wide availability in a distribution. 16476 16477 If July 2020 seems to be old, you may fetch a more recent copy of 16478this ‘ABOUT-NLS’ file on most GNU archive sites. The most up-to-date 16479matrix with full percentage details can be found at 16480‘https://translationproject.org/extra/matrix.html’. 16481 16482 16483File: gettext.info, Node: Using gettext in own code, Prev: Available Packages, Up: The original ABOUT-NLS 16484 1648517.2.5 Using ‘gettext’ in new packages 16486-------------------------------------- 16487 16488 If you are writing a freely available program and want to 16489internationalize it you are welcome to use GNU ‘gettext’ in your 16490package. Of course you have to respect the GNU Lesser General Public 16491License which covers the use of the GNU ‘gettext’ library. This means 16492in particular that even non-free programs can use ‘libintl’ as a shared 16493library, whereas only free software can use ‘libintl’ as a static 16494library or use modified versions of ‘libintl’. 16495 16496 Once the sources are changed appropriately and the setup can handle 16497the use of ‘gettext’ the only thing missing are the translations. The 16498Free Translation Project is also available for packages which are not 16499developed inside the GNU project. Therefore the information given above 16500applies also for every other Free Software Project. Contact 16501‘coordinator@translationproject.org’ to make the ‘.pot’ files available 16502to the translation teams. 16503 16504 16505File: gettext.info, Node: References, Prev: The original ABOUT-NLS, Up: Conclusion 16506 1650717.3 Related Readings 16508===================== 16509 16510 * NOTE: * This documentation section is outdated and needs to be 16511revised. 16512 16513 Eugene H. Dorr (‘dorre@well.com’) maintains an interesting 16514bibliography on internationalization matters, called 16515‘Internationalization Reference List’, which is available as: 16516 ftp://ftp.ora.com/pub/examples/nutshell/ujip/doc/i18n-books.txt 16517 16518 Michael Gschwind (‘mike@vlsivie.tuwien.ac.at’) maintains a Frequently 16519Asked Questions (FAQ) list, entitled ‘Programming for 16520Internationalisation’. This FAQ discusses writing programs which can 16521handle different language conventions, character sets, etc.; and is 16522applicable to all character set encodings, with particular emphasis on 16523ISO 8859-1. It is regularly published in Usenet groups 16524‘comp.unix.questions’, ‘comp.std.internat’, 16525‘comp.software.international’, ‘comp.lang.c’, ‘comp.windows.x’, 16526‘comp.std.c’, ‘comp.answers’ and ‘news.answers’. The home location of 16527this document is: 16528 ftp://ftp.vlsivie.tuwien.ac.at/pub/8bit/ISO-programming 16529 16530 Patrick D’Cruze (‘pdcruze@li.org’) wrote a tutorial about NLS 16531matters, and Jochen Hein (‘Hein@student.tu-clausthal.de’) took over the 16532responsibility of maintaining it. It may be found as: 16533 ftp://sunsite.unc.edu/pub/Linux/utils/nls/catalogs/Incoming/... 16534 ...locale-tutorial-0.8.txt.gz 16535This site is mirrored in: 16536 ftp://ftp.ibp.fr/pub/linux/sunsite/ 16537 16538 A French version of the same tutorial should be findable at: 16539 ftp://ftp.ibp.fr/pub/linux/french/docs/ 16540together with French translations of many Linux-related documents. 16541 16542 16543File: gettext.info, Node: Language Codes, Next: Country Codes, Prev: Conclusion, Up: Top 16544 16545Appendix A Language Codes 16546************************* 16547 16548 The ISO 639 standard defines two-letter codes for many languages, and 16549three-letter codes for more rarely used languages. All abbreviations 16550for languages used in the Translation Project should come from this 16551standard. 16552 16553* Menu: 16554 16555* Usual Language Codes:: Two-letter ISO 639 language codes 16556* Rare Language Codes:: Three-letter ISO 639 language codes 16557 16558 16559File: gettext.info, Node: Usual Language Codes, Next: Rare Language Codes, Up: Language Codes 16560 16561A.1 Usual Language Codes 16562======================== 16563 16564 For the commonly used languages, the ISO 639-1 standard defines 16565two-letter codes. 16566 16567‘aa’ 16568 Afar. 16569‘ab’ 16570 Abkhazian. 16571‘ae’ 16572 Avestan. 16573‘af’ 16574 Afrikaans. 16575‘ak’ 16576 Akan. 16577‘am’ 16578 Amharic. 16579‘an’ 16580 Aragonese. 16581‘ar’ 16582 Arabic. 16583‘as’ 16584 Assamese. 16585‘av’ 16586 Avaric. 16587‘ay’ 16588 Aymara. 16589‘az’ 16590 Azerbaijani. 16591‘ba’ 16592 Bashkir. 16593‘be’ 16594 Belarusian. 16595‘bg’ 16596 Bulgarian. 16597‘bh’ 16598 Bihari languages. 16599‘bi’ 16600 Bislama. 16601‘bm’ 16602 Bambara. 16603‘bn’ 16604 Bengali. 16605‘bo’ 16606 Tibetan. 16607‘br’ 16608 Breton. 16609‘bs’ 16610 Bosnian. 16611‘ca’ 16612 Catalan; Valencian. 16613‘ce’ 16614 Chechen. 16615‘ch’ 16616 Chamorro. 16617‘co’ 16618 Corsican. 16619‘cr’ 16620 Cree. 16621‘cs’ 16622 Czech. 16623‘cu’ 16624 Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old 16625 Church Slavonic. 16626‘cv’ 16627 Chuvash. 16628‘cy’ 16629 Welsh. 16630‘da’ 16631 Danish. 16632‘de’ 16633 German. 16634‘dv’ 16635 Divehi; Dhivehi; Maldivian. 16636‘dz’ 16637 Dzongkha. 16638‘ee’ 16639 Ewe. 16640‘el’ 16641 Greek, Modern (1453-). 16642‘en’ 16643 English. 16644‘eo’ 16645 Esperanto. 16646‘es’ 16647 Spanish; Castilian. 16648‘et’ 16649 Estonian. 16650‘eu’ 16651 Basque. 16652‘fa’ 16653 Persian. 16654‘ff’ 16655 Fulah. 16656‘fi’ 16657 Finnish. 16658‘fj’ 16659 Fijian. 16660‘fo’ 16661 Faroese. 16662‘fr’ 16663 French. 16664‘fy’ 16665 Western Frisian. 16666‘ga’ 16667 Irish. 16668‘gd’ 16669 Gaelic; Scottish Gaelic. 16670‘gl’ 16671 Galician. 16672‘gn’ 16673 Guarani. 16674‘gu’ 16675 Gujarati. 16676‘gv’ 16677 Manx. 16678‘ha’ 16679 Hausa. 16680‘he’ 16681 Hebrew. 16682‘hi’ 16683 Hindi. 16684‘ho’ 16685 Hiri Motu. 16686‘hr’ 16687 Croatian. 16688‘ht’ 16689 Haitian; Haitian Creole. 16690‘hu’ 16691 Hungarian. 16692‘hy’ 16693 Armenian. 16694‘hz’ 16695 Herero. 16696‘ia’ 16697 Interlingua (International Auxiliary Language Association). 16698‘id’ 16699 Indonesian. 16700‘ie’ 16701 Interlingue; Occidental. 16702‘ig’ 16703 Igbo. 16704‘ii’ 16705 Sichuan Yi; Nuosu. 16706‘ik’ 16707 Inupiak. 16708‘io’ 16709 Ido. 16710‘is’ 16711 Icelandic. 16712‘it’ 16713 Italian. 16714‘iu’ 16715 Inuktitut. 16716‘ja’ 16717 Japanese. 16718‘jv’ 16719 Javanese. 16720‘ka’ 16721 Georgian. 16722‘kg’ 16723 Kongo. 16724‘ki’ 16725 Kikuyu; Gikuyu. 16726‘kj’ 16727 Kuanyama; Kwanyama. 16728‘kk’ 16729 Kazakh. 16730‘kl’ 16731 Kalaallisut; Greenlandic. 16732‘km’ 16733 Central Khmer. 16734‘kn’ 16735 Kannada. 16736‘ko’ 16737 Korean. 16738‘kr’ 16739 Kanuri. 16740‘ks’ 16741 Kashmiri. 16742‘ku’ 16743 Kurdish. 16744‘kv’ 16745 Komi. 16746‘kw’ 16747 Cornish. 16748‘ky’ 16749 Kirghiz; Kyrgyz. 16750‘la’ 16751 Latin. 16752‘lb’ 16753 Luxembourgish; Letzeburgesch. 16754‘lg’ 16755 Ganda. 16756‘li’ 16757 Limburgan; Limburger; Limburgish. 16758‘ln’ 16759 Lingala. 16760‘lo’ 16761 Lao. 16762‘lt’ 16763 Lithuanian. 16764‘lu’ 16765 Luba-Katanga. 16766‘lv’ 16767 Latvian. 16768‘mg’ 16769 Malagasy. 16770‘mh’ 16771 Marshallese. 16772‘mi’ 16773 Maori. 16774‘mk’ 16775 Macedonian. 16776‘ml’ 16777 Malayalam. 16778‘mn’ 16779 Mongolian. 16780‘mr’ 16781 Marathi. 16782‘ms’ 16783 Malay. 16784‘mt’ 16785 Maltese. 16786‘my’ 16787 Burmese. 16788‘na’ 16789 Nauru. 16790‘nb’ 16791 Bokmål, Norwegian; Norwegian Bokmål. 16792‘nd’ 16793 Ndebele, North; North Ndebele. 16794‘ne’ 16795 Nepali. 16796‘ng’ 16797 Ndonga. 16798‘nl’ 16799 Dutch; Flemish. 16800‘nn’ 16801 Norwegian Nynorsk; Nynorsk, Norwegian. 16802‘no’ 16803 Norwegian. 16804‘nr’ 16805 Ndebele, South; South Ndebele. 16806‘nv’ 16807 Navajo; Navaho. 16808‘ny’ 16809 Chichewa; Nyanja. 16810‘oc’ 16811 Occitan (post 1500); Provençal. 16812‘oj’ 16813 Ojibwa. 16814‘om’ 16815 Oromo. 16816‘or’ 16817 Oriya. 16818‘os’ 16819 Ossetian; Ossetic. 16820‘pa’ 16821 Panjabi; Punjabi. 16822‘pi’ 16823 Pali. 16824‘pl’ 16825 Polish. 16826‘ps’ 16827 Pushto; Pashto. 16828‘pt’ 16829 Portuguese. 16830‘qu’ 16831 Quechua. 16832‘rm’ 16833 Romansh. 16834‘rn’ 16835 Rundi. 16836‘ro’ 16837 Romanian; Moldavian; Moldovan. 16838‘ru’ 16839 Russian. 16840‘rw’ 16841 Kinyarwanda. 16842‘sa’ 16843 Sanskrit. 16844‘sc’ 16845 Sardinian. 16846‘sd’ 16847 Sindhi. 16848‘se’ 16849 Northern Sami. 16850‘sg’ 16851 Sango. 16852‘si’ 16853 Sinhala; Sinhalese. 16854‘sk’ 16855 Slovak. 16856‘sl’ 16857 Slovenian. 16858‘sm’ 16859 Samoan. 16860‘sn’ 16861 Shona. 16862‘so’ 16863 Somali. 16864‘sq’ 16865 Albanian. 16866‘sr’ 16867 Serbian. 16868‘ss’ 16869 Swati. 16870‘st’ 16871 Sotho, Southern. 16872‘su’ 16873 Sundanese. 16874‘sv’ 16875 Swedish. 16876‘sw’ 16877 Swahili. 16878‘ta’ 16879 Tamil. 16880‘te’ 16881 Telugu. 16882‘tg’ 16883 Tajik. 16884‘th’ 16885 Thai. 16886‘ti’ 16887 Tigrinya. 16888‘tk’ 16889 Turkmen. 16890‘tl’ 16891 Tagalog. 16892‘tn’ 16893 Tswana. 16894‘to’ 16895 Tonga (Tonga Islands). 16896‘tr’ 16897 Turkish. 16898‘ts’ 16899 Tsonga. 16900‘tt’ 16901 Tatar. 16902‘tw’ 16903 Twi. 16904‘ty’ 16905 Tahitian. 16906‘ug’ 16907 Uighur; Uyghur. 16908‘uk’ 16909 Ukrainian. 16910‘ur’ 16911 Urdu. 16912‘uz’ 16913 Uzbek. 16914‘ve’ 16915 Venda. 16916‘vi’ 16917 Vietnamese. 16918‘vo’ 16919 Volapük. 16920‘wa’ 16921 Walloon. 16922‘wo’ 16923 Wolof. 16924‘xh’ 16925 Xhosa. 16926‘yi’ 16927 Yiddish. 16928‘yo’ 16929 Yoruba. 16930‘za’ 16931 Zhuang; Chuang. 16932‘zh’ 16933 Chinese. 16934‘zu’ 16935 Zulu. 16936 16937 16938File: gettext.info, Node: Rare Language Codes, Prev: Usual Language Codes, Up: Language Codes 16939 16940A.2 Rare Language Codes 16941======================= 16942 16943 For rarely used languages, the ISO 639-2 standard defines 16944three-letter codes. Here is the current list, reduced to only living 16945languages with at least one million of speakers. 16946 16947‘ace’ 16948 Achinese. 16949‘awa’ 16950 Awadhi. 16951‘bal’ 16952 Baluchi. 16953‘ban’ 16954 Balinese. 16955‘bej’ 16956 Beja; Bedawiyet. 16957‘bem’ 16958 Bemba. 16959‘bho’ 16960 Bhojpuri. 16961‘bik’ 16962 Bikol. 16963‘bin’ 16964 Bini; Edo. 16965‘bug’ 16966 Buginese. 16967‘ceb’ 16968 Cebuano. 16969‘din’ 16970 Dinka. 16971‘doi’ 16972 Dogri. 16973‘fil’ 16974 Filipino; Pilipino. 16975‘fon’ 16976 Fon. 16977‘gon’ 16978 Gondi. 16979‘gsw’ 16980 Swiss German; Alemannic; Alsatian. 16981‘hil’ 16982 Hiligaynon. 16983‘hmn’ 16984 Hmong. 16985‘ilo’ 16986 Iloko. 16987‘kab’ 16988 Kabyle. 16989‘kam’ 16990 Kamba. 16991‘kbd’ 16992 Kabardian. 16993‘kmb’ 16994 Kimbundu. 16995‘kok’ 16996 Konkani. 16997‘kru’ 16998 Kurukh. 16999‘lua’ 17000 Luba-Lulua. 17001‘luo’ 17002 Luo (Kenya and Tanzania). 17003‘mad’ 17004 Madurese. 17005‘mag’ 17006 Magahi. 17007‘mai’ 17008 Maithili. 17009‘mak’ 17010 Makasar. 17011‘man’ 17012 Mandingo. 17013‘men’ 17014 Mende. 17015‘min’ 17016 Minangkabau. 17017‘mni’ 17018 Manipuri. 17019‘mos’ 17020 Mossi. 17021‘mwr’ 17022 Marwari. 17023‘nap’ 17024 Neapolitan. 17025‘nso’ 17026 Pedi; Sepedi; Northern Sotho. 17027‘nym’ 17028 Nyamwezi. 17029‘nyn’ 17030 Nyankole. 17031‘pag’ 17032 Pangasinan. 17033‘pam’ 17034 Pampanga; Kapampangan. 17035‘raj’ 17036 Rajasthani. 17037‘sas’ 17038 Sasak. 17039‘sat’ 17040 Santali. 17041‘scn’ 17042 Sicilian. 17043‘shn’ 17044 Shan. 17045‘sid’ 17046 Sidamo. 17047‘srr’ 17048 Serer. 17049‘suk’ 17050 Sukuma. 17051‘sus’ 17052 Susu. 17053‘tem’ 17054 Timne. 17055‘tiv’ 17056 Tiv. 17057‘tum’ 17058 Tumbuka. 17059‘umb’ 17060 Umbundu. 17061‘wal’ 17062 Walamo. 17063‘war’ 17064 Waray. 17065‘yao’ 17066 Yao. 17067 17068 17069File: gettext.info, Node: Country Codes, Next: Licenses, Prev: Language Codes, Up: Top 17070 17071Appendix B Country Codes 17072************************ 17073 17074 The ISO 3166 standard defines two character codes for many countries 17075and territories. All abbreviations for countries used in the 17076Translation Project should come from this standard. 17077 17078‘AD’ 17079 Andorra. 17080‘AE’ 17081 United Arab Emirates. 17082‘AF’ 17083 Afghanistan. 17084‘AG’ 17085 Antigua and Barbuda. 17086‘AI’ 17087 Anguilla. 17088‘AL’ 17089 Albania. 17090‘AM’ 17091 Armenia. 17092‘AO’ 17093 Angola. 17094‘AQ’ 17095 Antarctica. 17096‘AR’ 17097 Argentina. 17098‘AS’ 17099 American Samoa. 17100‘AT’ 17101 Austria. 17102‘AU’ 17103 Australia. 17104‘AW’ 17105 Aruba. 17106‘AX’ 17107 Aaland Islands. 17108‘AZ’ 17109 Azerbaijan. 17110‘BA’ 17111 Bosnia and Herzegovina. 17112‘BB’ 17113 Barbados. 17114‘BD’ 17115 Bangladesh. 17116‘BE’ 17117 Belgium. 17118‘BF’ 17119 Burkina Faso. 17120‘BG’ 17121 Bulgaria. 17122‘BH’ 17123 Bahrain. 17124‘BI’ 17125 Burundi. 17126‘BJ’ 17127 Benin. 17128‘BL’ 17129 Saint Barthelemy. 17130‘BM’ 17131 Bermuda. 17132‘BN’ 17133 Brunei Darussalam. 17134‘BO’ 17135 Bolivia, Plurinational State of. 17136‘BQ’ 17137 Bonaire, Sint Eustatius and Saba. 17138‘BR’ 17139 Brazil. 17140‘BS’ 17141 Bahamas. 17142‘BT’ 17143 Bhutan. 17144‘BV’ 17145 Bouvet Island. 17146‘BW’ 17147 Botswana. 17148‘BY’ 17149 Belarus. 17150‘BZ’ 17151 Belize. 17152‘CA’ 17153 Canada. 17154‘CC’ 17155 Cocos (Keeling) Islands. 17156‘CD’ 17157 Congo, The Democratic Republic of the. 17158‘CF’ 17159 Central African Republic. 17160‘CG’ 17161 Congo. 17162‘CH’ 17163 Switzerland. 17164‘CI’ 17165 Côte d’Ivoire. 17166‘CK’ 17167 Cook Islands. 17168‘CL’ 17169 Chile. 17170‘CM’ 17171 Cameroon. 17172‘CN’ 17173 China. 17174‘CO’ 17175 Colombia. 17176‘CR’ 17177 Costa Rica. 17178‘CU’ 17179 Cuba. 17180‘CV’ 17181 Cape Verde. 17182‘CW’ 17183 Curaçao. 17184‘CX’ 17185 Christmas Island. 17186‘CY’ 17187 Cyprus. 17188‘CZ’ 17189 Czech Republic. 17190‘DE’ 17191 Germany. 17192‘DJ’ 17193 Djibouti. 17194‘DK’ 17195 Denmark. 17196‘DM’ 17197 Dominica. 17198‘DO’ 17199 Dominican Republic. 17200‘DZ’ 17201 Algeria. 17202‘EC’ 17203 Ecuador. 17204‘EE’ 17205 Estonia. 17206‘EG’ 17207 Egypt. 17208‘EH’ 17209 Western Sahara. 17210‘ER’ 17211 Eritrea. 17212‘ES’ 17213 Spain. 17214‘ET’ 17215 Ethiopia. 17216‘FI’ 17217 Finland. 17218‘FJ’ 17219 Fiji. 17220‘FK’ 17221 Falkland Islands (Malvinas). 17222‘FM’ 17223 Micronesia, Federated States of. 17224‘FO’ 17225 Faroe Islands. 17226‘FR’ 17227 France. 17228‘GA’ 17229 Gabon. 17230‘GB’ 17231 United Kingdom. 17232‘GD’ 17233 Grenada. 17234‘GE’ 17235 Georgia. 17236‘GF’ 17237 French Guiana. 17238‘GG’ 17239 Guernsey. 17240‘GH’ 17241 Ghana. 17242‘GI’ 17243 Gibraltar. 17244‘GL’ 17245 Greenland. 17246‘GM’ 17247 Gambia. 17248‘GN’ 17249 Guinea. 17250‘GP’ 17251 Guadeloupe. 17252‘GQ’ 17253 Equatorial Guinea. 17254‘GR’ 17255 Greece. 17256‘GS’ 17257 South Georgia and the South Sandwich Islands. 17258‘GT’ 17259 Guatemala. 17260‘GU’ 17261 Guam. 17262‘GW’ 17263 Guinea-Bissau. 17264‘GY’ 17265 Guyana. 17266‘HK’ 17267 Hong Kong. 17268‘HM’ 17269 Heard Island and McDonald Islands. 17270‘HN’ 17271 Honduras. 17272‘HR’ 17273 Croatia. 17274‘HT’ 17275 Haiti. 17276‘HU’ 17277 Hungary. 17278‘ID’ 17279 Indonesia. 17280‘IE’ 17281 Ireland. 17282‘IL’ 17283 Israel. 17284‘IM’ 17285 Isle of Man. 17286‘IN’ 17287 India. 17288‘IO’ 17289 British Indian Ocean Territory. 17290‘IQ’ 17291 Iraq. 17292‘IR’ 17293 Iran, Islamic Republic of. 17294‘IS’ 17295 Iceland. 17296‘IT’ 17297 Italy. 17298‘JE’ 17299 Jersey. 17300‘JM’ 17301 Jamaica. 17302‘JO’ 17303 Jordan. 17304‘JP’ 17305 Japan. 17306‘KE’ 17307 Kenya. 17308‘KG’ 17309 Kyrgyzstan. 17310‘KH’ 17311 Cambodia. 17312‘KI’ 17313 Kiribati. 17314‘KM’ 17315 Comoros. 17316‘KN’ 17317 Saint Kitts and Nevis. 17318‘KP’ 17319 Korea, Democratic People’s Republic of. 17320‘KR’ 17321 Korea, Republic of. 17322‘KW’ 17323 Kuwait. 17324‘KY’ 17325 Cayman Islands. 17326‘KZ’ 17327 Kazakhstan. 17328‘LA’ 17329 Lao People’s Democratic Republic. 17330‘LB’ 17331 Lebanon. 17332‘LC’ 17333 Saint Lucia. 17334‘LI’ 17335 Liechtenstein. 17336‘LK’ 17337 Sri Lanka. 17338‘LR’ 17339 Liberia. 17340‘LS’ 17341 Lesotho. 17342‘LT’ 17343 Lithuania. 17344‘LU’ 17345 Luxembourg. 17346‘LV’ 17347 Latvia. 17348‘LY’ 17349 Libya. 17350‘MA’ 17351 Morocco. 17352‘MC’ 17353 Monaco. 17354‘MD’ 17355 Moldova, Republic of. 17356‘ME’ 17357 Montenegro. 17358‘MF’ 17359 Saint Martin (French part). 17360‘MG’ 17361 Madagascar. 17362‘MH’ 17363 Marshall Islands. 17364‘MK’ 17365 North Macedonia. 17366‘ML’ 17367 Mali. 17368‘MM’ 17369 Myanmar. 17370‘MN’ 17371 Mongolia. 17372‘MO’ 17373 Macao. 17374‘MP’ 17375 Northern Mariana Islands. 17376‘MQ’ 17377 Martinique. 17378‘MR’ 17379 Mauritania. 17380‘MS’ 17381 Montserrat. 17382‘MT’ 17383 Malta. 17384‘MU’ 17385 Mauritius. 17386‘MV’ 17387 Maldives. 17388‘MW’ 17389 Malawi. 17390‘MX’ 17391 Mexico. 17392‘MY’ 17393 Malaysia. 17394‘MZ’ 17395 Mozambique. 17396‘NA’ 17397 Namibia. 17398‘NC’ 17399 New Caledonia. 17400‘NE’ 17401 Niger. 17402‘NF’ 17403 Norfolk Island. 17404‘NG’ 17405 Nigeria. 17406‘NI’ 17407 Nicaragua. 17408‘NL’ 17409 Netherlands. 17410‘NO’ 17411 Norway. 17412‘NP’ 17413 Nepal. 17414‘NR’ 17415 Nauru. 17416‘NU’ 17417 Niue. 17418‘NZ’ 17419 New Zealand. 17420‘OM’ 17421 Oman. 17422‘PA’ 17423 Panama. 17424‘PE’ 17425 Peru. 17426‘PF’ 17427 French Polynesia. 17428‘PG’ 17429 Papua New Guinea. 17430‘PH’ 17431 Philippines. 17432‘PK’ 17433 Pakistan. 17434‘PL’ 17435 Poland. 17436‘PM’ 17437 Saint Pierre and Miquelon. 17438‘PN’ 17439 Pitcairn. 17440‘PR’ 17441 Puerto Rico. 17442‘PS’ 17443 Palestine, State of. 17444‘PT’ 17445 Portugal. 17446‘PW’ 17447 Palau. 17448‘PY’ 17449 Paraguay. 17450‘QA’ 17451 Qatar. 17452‘RE’ 17453 Reunion. 17454‘RO’ 17455 Romania. 17456‘RS’ 17457 Serbia. 17458‘RU’ 17459 Russian Federation. 17460‘RW’ 17461 Rwanda. 17462‘SA’ 17463 Saudi Arabia. 17464‘SB’ 17465 Solomon Islands. 17466‘SC’ 17467 Seychelles. 17468‘SD’ 17469 Sudan. 17470‘SE’ 17471 Sweden. 17472‘SG’ 17473 Singapore. 17474‘SH’ 17475 Saint Helena, Ascension and Tristan da Cunha. 17476‘SI’ 17477 Slovenia. 17478‘SJ’ 17479 Svalbard and Jan Mayen. 17480‘SK’ 17481 Slovakia. 17482‘SL’ 17483 Sierra Leone. 17484‘SM’ 17485 San Marino. 17486‘SN’ 17487 Senegal. 17488‘SO’ 17489 Somalia. 17490‘SR’ 17491 Suriname. 17492‘SS’ 17493 South Sudan. 17494‘ST’ 17495 Sao Tome and Principe. 17496‘SV’ 17497 El Salvador. 17498‘SX’ 17499 Sint Maarten (Dutch part). 17500‘SY’ 17501 Syrian Arab Republic. 17502‘SZ’ 17503 Swaziland. 17504‘TC’ 17505 Turks and Caicos Islands. 17506‘TD’ 17507 Chad. 17508‘TF’ 17509 French Southern Territories. 17510‘TG’ 17511 Togo. 17512‘TH’ 17513 Thailand. 17514‘TJ’ 17515 Tajikistan. 17516‘TK’ 17517 Tokelau. 17518‘TL’ 17519 Timor-Leste. 17520‘TM’ 17521 Turkmenistan. 17522‘TN’ 17523 Tunisia. 17524‘TO’ 17525 Tonga. 17526‘TR’ 17527 Turkey. 17528‘TT’ 17529 Trinidad and Tobago. 17530‘TV’ 17531 Tuvalu. 17532‘TW’ 17533 Taiwan, Province of China. 17534‘TZ’ 17535 Tanzania, United Republic of. 17536‘UA’ 17537 Ukraine. 17538‘UG’ 17539 Uganda. 17540‘UM’ 17541 United States Minor Outlying Islands. 17542‘US’ 17543 United States. 17544‘UY’ 17545 Uruguay. 17546‘UZ’ 17547 Uzbekistan. 17548‘VA’ 17549 Holy See (Vatican City State). 17550‘VC’ 17551 Saint Vincent and the Grenadines. 17552‘VE’ 17553 Venezuela, Bolivarian Republic of. 17554‘VG’ 17555 Virgin Islands, British. 17556‘VI’ 17557 Virgin Islands, U.S.. 17558‘VN’ 17559 Viet Nam. 17560‘VU’ 17561 Vanuatu. 17562‘WF’ 17563 Wallis and Futuna. 17564‘WS’ 17565 Samoa. 17566‘YE’ 17567 Yemen. 17568‘YT’ 17569 Mayotte. 17570‘ZA’ 17571 South Africa. 17572‘ZM’ 17573 Zambia. 17574‘ZW’ 17575 Zimbabwe. 17576 17577 17578File: gettext.info, Node: Licenses, Next: Program Index, Prev: Country Codes, Up: Top 17579 17580Appendix C Licenses 17581******************* 17582 17583 The files of this package are covered by the licenses indicated in 17584each particular file or directory. Here is a summary: 17585 17586 • The ‘libintl’ and ‘libasprintf’ libraries are covered by the GNU 17587 Lesser General Public License (LGPL). A copy of the license is 17588 included in *note GNU LGPL::. 17589 17590 • The executable programs of this package and the ‘libgettextpo’ 17591 library are covered by the GNU General Public License (GPL). A copy 17592 of the license is included in *note GNU GPL::. 17593 17594 • This manual is free documentation. It is dually licensed under the 17595 GNU FDL and the GNU GPL. This means that you can redistribute this 17596 manual under either of these two licenses, at your choice. 17597 This manual is covered by the GNU FDL. Permission is granted to 17598 copy, distribute and/or modify this document under the terms of the 17599 GNU Free Documentation License (FDL), either version 1.2 of the 17600 License, or (at your option) any later version published by the 17601 Free Software Foundation (FSF); with no Invariant Sections, with no 17602 Front-Cover Text, and with no Back-Cover Texts. A copy of the 17603 license is included in *note GNU FDL::. 17604 This manual is covered by the GNU GPL. You can redistribute it 17605 and/or modify it under the terms of the GNU General Public License 17606 (GPL), either version 2 of the License, or (at your option) any 17607 later version published by the Free Software Foundation (FSF). A 17608 copy of the license is included in *note GNU GPL::. 17609 17610* Menu: 17611 17612* GNU GPL:: GNU General Public License 17613* GNU LGPL:: GNU Lesser General Public License 17614* GNU FDL:: GNU Free Documentation License 17615 17616 17617File: gettext.info, Node: GNU GPL, Next: GNU LGPL, Up: Licenses 17618 17619C.1 GNU GENERAL PUBLIC LICENSE 17620============================== 17621 17622 Version 2, June 1991 17623 17624 Copyright © 1989, 1991 Free Software Foundation, Inc. 17625 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 17626 17627 Everyone is permitted to copy and distribute verbatim copies 17628 of this license document, but changing it is not allowed. 17629 17630Preamble 17631======== 17632 17633 The licenses for most software are designed to take away your freedom 17634to share and change it. By contrast, the GNU General Public License is 17635intended to guarantee your freedom to share and change free software—to 17636make sure the software is free for all its users. This General Public 17637License applies to most of the Free Software Foundation’s software and 17638to any other program whose authors commit to using it. (Some other Free 17639Software Foundation software is covered by the GNU Lesser General Public 17640License instead.) You can apply it to your programs, too. 17641 17642 When we speak of free software, we are referring to freedom, not 17643price. Our General Public Licenses are designed to make sure that you 17644have the freedom to distribute copies of free software (and charge for 17645this service if you wish), that you receive source code or can get it if 17646you want it, that you can change the software or use pieces of it in new 17647free programs; and that you know you can do these things. 17648 17649 To protect your rights, we need to make restrictions that forbid 17650anyone to deny you these rights or to ask you to surrender the rights. 17651These restrictions translate to certain responsibilities for you if you 17652distribute copies of the software, or if you modify it. 17653 17654 For example, if you distribute copies of such a program, whether 17655gratis or for a fee, you must give the recipients all the rights that 17656you have. You must make sure that they, too, receive or can get the 17657source code. And you must show them these terms so they know their 17658rights. 17659 17660 We protect your rights with two steps: (1) copyright the software, 17661and (2) offer you this license which gives you legal permission to copy, 17662distribute and/or modify the software. 17663 17664 Also, for each author’s protection and ours, we want to make certain 17665that everyone understands that there is no warranty for this free 17666software. If the software is modified by someone else and passed on, we 17667want its recipients to know that what they have is not the original, so 17668that any problems introduced by others will not reflect on the original 17669authors’ reputations. 17670 17671 Finally, any free program is threatened constantly by software 17672patents. We wish to avoid the danger that redistributors of a free 17673program will individually obtain patent licenses, in effect making the 17674program proprietary. To prevent this, we have made it clear that any 17675patent must be licensed for everyone’s free use or not licensed at all. 17676 17677 The precise terms and conditions for copying, distribution and 17678modification follow. 17679 17680TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 17681=============================================================== 17682 17683 0. This License applies to any program or other work which contains a 17684 notice placed by the copyright holder saying it may be distributed 17685 under the terms of this General Public License. The “Program”, 17686 below, refers to any such program or work, and a “work based on the 17687 Program” means either the Program or any derivative work under 17688 copyright law: that is to say, a work containing the Program or a 17689 portion of it, either verbatim or with modifications and/or 17690 translated into another language. (Hereinafter, translation is 17691 included without limitation in the term “modification”.) Each 17692 licensee is addressed as “you”. 17693 17694 Activities other than copying, distribution and modification are 17695 not covered by this License; they are outside its scope. The act 17696 of running the Program is not restricted, and the output from the 17697 Program is covered only if its contents constitute a work based on 17698 the Program (independent of having been made by running the 17699 Program). Whether that is true depends on what the Program does. 17700 17701 1. You may copy and distribute verbatim copies of the Program’s source 17702 code as you receive it, in any medium, provided that you 17703 conspicuously and appropriately publish on each copy an appropriate 17704 copyright notice and disclaimer of warranty; keep intact all the 17705 notices that refer to this License and to the absence of any 17706 warranty; and give any other recipients of the Program a copy of 17707 this License along with the Program. 17708 17709 You may charge a fee for the physical act of transferring a copy, 17710 and you may at your option offer warranty protection in exchange 17711 for a fee. 17712 17713 2. You may modify your copy or copies of the Program or any portion of 17714 it, thus forming a work based on the Program, and copy and 17715 distribute such modifications or work under the terms of Section 1 17716 above, provided that you also meet all of these conditions: 17717 17718 a. You must cause the modified files to carry prominent notices 17719 stating that you changed the files and the date of any change. 17720 17721 b. You must cause any work that you distribute or publish, that 17722 in whole or in part contains or is derived from the Program or 17723 any part thereof, to be licensed as a whole at no charge to 17724 all third parties under the terms of this License. 17725 17726 c. If the modified program normally reads commands interactively 17727 when run, you must cause it, when started running for such 17728 interactive use in the most ordinary way, to print or display 17729 an announcement including an appropriate copyright notice and 17730 a notice that there is no warranty (or else, saying that you 17731 provide a warranty) and that users may redistribute the 17732 program under these conditions, and telling the user how to 17733 view a copy of this License. (Exception: if the Program 17734 itself is interactive but does not normally print such an 17735 announcement, your work based on the Program is not required 17736 to print an announcement.) 17737 17738 These requirements apply to the modified work as a whole. If 17739 identifiable sections of that work are not derived from the 17740 Program, and can be reasonably considered independent and separate 17741 works in themselves, then this License, and its terms, do not apply 17742 to those sections when you distribute them as separate works. But 17743 when you distribute the same sections as part of a whole which is a 17744 work based on the Program, the distribution of the whole must be on 17745 the terms of this License, whose permissions for other licensees 17746 extend to the entire whole, and thus to each and every part 17747 regardless of who wrote it. 17748 17749 Thus, it is not the intent of this section to claim rights or 17750 contest your rights to work written entirely by you; rather, the 17751 intent is to exercise the right to control the distribution of 17752 derivative or collective works based on the Program. 17753 17754 In addition, mere aggregation of another work not based on the 17755 Program with the Program (or with a work based on the Program) on a 17756 volume of a storage or distribution medium does not bring the other 17757 work under the scope of this License. 17758 17759 3. You may copy and distribute the Program (or a work based on it, 17760 under Section 2) in object code or executable form under the terms 17761 of Sections 1 and 2 above provided that you also do one of the 17762 following: 17763 17764 a. Accompany it with the complete corresponding machine-readable 17765 source code, which must be distributed under the terms of 17766 Sections 1 and 2 above on a medium customarily used for 17767 software interchange; or, 17768 17769 b. Accompany it with a written offer, valid for at least three 17770 years, to give any third party, for a charge no more than your 17771 cost of physically performing source distribution, a complete 17772 machine-readable copy of the corresponding source code, to be 17773 distributed under the terms of Sections 1 and 2 above on a 17774 medium customarily used for software interchange; or, 17775 17776 c. Accompany it with the information you received as to the offer 17777 to distribute corresponding source code. (This alternative is 17778 allowed only for noncommercial distribution and only if you 17779 received the program in object code or executable form with 17780 such an offer, in accord with Subsection b above.) 17781 17782 The source code for a work means the preferred form of the work for 17783 making modifications to it. For an executable work, complete 17784 source code means all the source code for all modules it contains, 17785 plus any associated interface definition files, plus the scripts 17786 used to control compilation and installation of the executable. 17787 However, as a special exception, the source code distributed need 17788 not include anything that is normally distributed (in either source 17789 or binary form) with the major components (compiler, kernel, and so 17790 on) of the operating system on which the executable runs, unless 17791 that component itself accompanies the executable. 17792 17793 If distribution of executable or object code is made by offering 17794 access to copy from a designated place, then offering equivalent 17795 access to copy the source code from the same place counts as 17796 distribution of the source code, even though third parties are not 17797 compelled to copy the source along with the object code. 17798 17799 4. You may not copy, modify, sublicense, or distribute the Program 17800 except as expressly provided under this License. Any attempt 17801 otherwise to copy, modify, sublicense or distribute the Program is 17802 void, and will automatically terminate your rights under this 17803 License. However, parties who have received copies, or rights, 17804 from you under this License will not have their licenses terminated 17805 so long as such parties remain in full compliance. 17806 17807 5. You are not required to accept this License, since you have not 17808 signed it. However, nothing else grants you permission to modify 17809 or distribute the Program or its derivative works. These actions 17810 are prohibited by law if you do not accept this License. 17811 Therefore, by modifying or distributing the Program (or any work 17812 based on the Program), you indicate your acceptance of this License 17813 to do so, and all its terms and conditions for copying, 17814 distributing or modifying the Program or works based on it. 17815 17816 6. Each time you redistribute the Program (or any work based on the 17817 Program), the recipient automatically receives a license from the 17818 original licensor to copy, distribute or modify the Program subject 17819 to these terms and conditions. You may not impose any further 17820 restrictions on the recipients’ exercise of the rights granted 17821 herein. You are not responsible for enforcing compliance by third 17822 parties to this License. 17823 17824 7. If, as a consequence of a court judgment or allegation of patent 17825 infringement or for any other reason (not limited to patent 17826 issues), conditions are imposed on you (whether by court order, 17827 agreement or otherwise) that contradict the conditions of this 17828 License, they do not excuse you from the conditions of this 17829 License. If you cannot distribute so as to satisfy simultaneously 17830 your obligations under this License and any other pertinent 17831 obligations, then as a consequence you may not distribute the 17832 Program at all. For example, if a patent license would not permit 17833 royalty-free redistribution of the Program by all those who receive 17834 copies directly or indirectly through you, then the only way you 17835 could satisfy both it and this License would be to refrain entirely 17836 from distribution of the Program. 17837 17838 If any portion of this section is held invalid or unenforceable 17839 under any particular circumstance, the balance of the section is 17840 intended to apply and the section as a whole is intended to apply 17841 in other circumstances. 17842 17843 It is not the purpose of this section to induce you to infringe any 17844 patents or other property right claims or to contest validity of 17845 any such claims; this section has the sole purpose of protecting 17846 the integrity of the free software distribution system, which is 17847 implemented by public license practices. Many people have made 17848 generous contributions to the wide range of software distributed 17849 through that system in reliance on consistent application of that 17850 system; it is up to the author/donor to decide if he or she is 17851 willing to distribute software through any other system and a 17852 licensee cannot impose that choice. 17853 17854 This section is intended to make thoroughly clear what is believed 17855 to be a consequence of the rest of this License. 17856 17857 8. If the distribution and/or use of the Program is restricted in 17858 certain countries either by patents or by copyrighted interfaces, 17859 the original copyright holder who places the Program under this 17860 License may add an explicit geographical distribution limitation 17861 excluding those countries, so that distribution is permitted only 17862 in or among countries not thus excluded. In such case, this 17863 License incorporates the limitation as if written in the body of 17864 this License. 17865 17866 9. The Free Software Foundation may publish revised and/or new 17867 versions of the General Public License from time to time. Such new 17868 versions will be similar in spirit to the present version, but may 17869 differ in detail to address new problems or concerns. 17870 17871 Each version is given a distinguishing version number. If the 17872 Program specifies a version number of this License which applies to 17873 it and “any later version”, you have the option of following the 17874 terms and conditions either of that version or of any later version 17875 published by the Free Software Foundation. If the Program does not 17876 specify a version number of this License, you may choose any 17877 version ever published by the Free Software Foundation. 17878 17879 10. If you wish to incorporate parts of the Program into other free 17880 programs whose distribution conditions are different, write to the 17881 author to ask for permission. For software which is copyrighted by 17882 the Free Software Foundation, write to the Free Software 17883 Foundation; we sometimes make exceptions for this. Our decision 17884 will be guided by the two goals of preserving the free status of 17885 all derivatives of our free software and of promoting the sharing 17886 and reuse of software generally. 17887 17888 NO WARRANTY 17889 17890 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO 17891 WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE 17892 LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS 17893 AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY 17894 OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT 17895 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 17896 FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND 17897 PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE 17898 DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR 17899 OR CORRECTION. 17900 17901 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 17902 WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY 17903 MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE 17904 LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, 17905 INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR 17906 INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 17907 DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU 17908 OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY 17909 OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN 17910 ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17911 17912 END OF TERMS AND CONDITIONS 17913 17914Appendix: How to Apply These Terms to Your New Programs 17915======================================================= 17916 17917 If you develop a new program, and you want it to be of the greatest 17918possible use to the public, the best way to achieve this is to make it 17919free software which everyone can redistribute and change under these 17920terms. 17921 17922 To do so, attach the following notices to the program. It is safest 17923to attach them to the start of each source file to most effectively 17924convey the exclusion of warranty; and each file should have at least the 17925“copyright” line and a pointer to where the full notice is found. 17926 17927 ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. 17928 Copyright (C) YYYY NAME OF AUTHOR 17929 17930 This program is free software; you can redistribute it and/or modify 17931 it under the terms of the GNU General Public License as published by 17932 the Free Software Foundation; either version 2 of the License, or 17933 (at your option) any later version. 17934 17935 This program is distributed in the hope that it will be useful, 17936 but WITHOUT ANY WARRANTY; without even the implied warranty of 17937 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17938 GNU General Public License for more details. 17939 17940 You should have received a copy of the GNU General Public License 17941 along with this program; if not, write to the Free Software 17942 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17943 17944 Also add information on how to contact you by electronic and paper 17945mail. 17946 17947 If the program is interactive, make it output a short notice like 17948this when it starts in an interactive mode: 17949 17950 Gnomovision version 69, Copyright (C) YEAR NAME OF AUTHOR 17951 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 17952 This is free software, and you are welcome to redistribute it 17953 under certain conditions; type `show c' for details. 17954 17955 The hypothetical commands ‘show w’ and ‘show c’ should show the 17956appropriate parts of the General Public License. Of course, the 17957commands you use may be called something other than ‘show w’ and ‘show 17958c’; they could even be mouse-clicks or menu items—whatever suits your 17959program. 17960 17961 You should also get your employer (if you work as a programmer) or 17962your school, if any, to sign a “copyright disclaimer” for the program, 17963if necessary. Here is a sample; alter the names: 17964 17965 Yoyodyne, Inc., hereby disclaims all copyright interest in the program 17966 `Gnomovision' (which makes passes at compilers) written by James Hacker. 17967 17968 SIGNATURE OF TY COON, 1 April 1989 17969 Ty Coon, President of Vice 17970 17971 This General Public License does not permit incorporating your 17972program into proprietary programs. If your program is a subroutine 17973library, you may consider it more useful to permit linking proprietary 17974applications with the library. If this is what you want to do, use the 17975GNU Lesser General Public License instead of this License. 17976 17977 17978File: gettext.info, Node: GNU LGPL, Next: GNU FDL, Prev: GNU GPL, Up: Licenses 17979 17980C.2 GNU LESSER GENERAL PUBLIC LICENSE 17981===================================== 17982 17983 Version 2.1, February 1999 17984 17985 Copyright © 1991, 1999 Free Software Foundation, Inc. 17986 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 17987 17988 Everyone is permitted to copy and distribute verbatim copies 17989 of this license document, but changing it is not allowed. 17990 17991 [This is the first released version of the Lesser GPL. It also counts 17992 as the successor of the GNU Library Public License, version 2, hence the 17993 version number 2.1.] 17994 17995Preamble 17996-------- 17997 17998 The licenses for most software are designed to take away your freedom 17999to share and change it. By contrast, the GNU General Public Licenses 18000are intended to guarantee your freedom to share and change free 18001software—to make sure the software is free for all its users. 18002 18003 This license, the Lesser General Public License, applies to some 18004specially designated software—typically libraries—of the Free Software 18005Foundation and other authors who decide to use it. You can use it too, 18006but we suggest you first think carefully about whether this license or 18007the ordinary General Public License is the better strategy to use in any 18008particular case, based on the explanations below. 18009 18010 When we speak of free software, we are referring to freedom of use, 18011not price. Our General Public Licenses are designed to make sure that 18012you have the freedom to distribute copies of free software (and charge 18013for this service if you wish); that you receive source code or can get 18014it if you want it; that you can change the software and use pieces of it 18015in new free programs; and that you are informed that you can do these 18016things. 18017 18018 To protect your rights, we need to make restrictions that forbid 18019distributors to deny you these rights or to ask you to surrender these 18020rights. These restrictions translate to certain responsibilities for 18021you if you distribute copies of the library or if you modify it. 18022 18023 For example, if you distribute copies of the library, whether gratis 18024or for a fee, you must give the recipients all the rights that we gave 18025you. You must make sure that they, too, receive or can get the source 18026code. If you link other code with the library, you must provide 18027complete object files to the recipients, so that they can relink them 18028with the library after making changes to the library and recompiling it. 18029And you must show them these terms so they know their rights. 18030 18031 We protect your rights with a two-step method: (1) we copyright the 18032library, and (2) we offer you this license, which gives you legal 18033permission to copy, distribute and/or modify the library. 18034 18035 To protect each distributor, we want to make it very clear that there 18036is no warranty for the free library. Also, if the library is modified 18037by someone else and passed on, the recipients should know that what they 18038have is not the original version, so that the original author’s 18039reputation will not be affected by problems that might be introduced by 18040others. 18041 18042 Finally, software patents pose a constant threat to the existence of 18043any free program. We wish to make sure that a company cannot 18044effectively restrict the users of a free program by obtaining a 18045restrictive license from a patent holder. Therefore, we insist that any 18046patent license obtained for a version of the library must be consistent 18047with the full freedom of use specified in this license. 18048 18049 Most GNU software, including some libraries, is covered by the 18050ordinary GNU General Public License. This license, the GNU Lesser 18051General Public License, applies to certain designated libraries, and is 18052quite different from the ordinary General Public License. We use this 18053license for certain libraries in order to permit linking those libraries 18054into non-free programs. 18055 18056 When a program is linked with a library, whether statically or using 18057a shared library, the combination of the two is legally speaking a 18058combined work, a derivative of the original library. The ordinary 18059General Public License therefore permits such linking only if the entire 18060combination fits its criteria of freedom. The Lesser General Public 18061License permits more lax criteria for linking other code with the 18062library. 18063 18064 We call this license the “Lesser” General Public License because it 18065does _Less_ to protect the user’s freedom than the ordinary General 18066Public License. It also provides other free software developers Less of 18067an advantage over competing non-free programs. These disadvantages are 18068the reason we use the ordinary General Public License for many 18069libraries. However, the Lesser license provides advantages in certain 18070special circumstances. 18071 18072 For example, on rare occasions, there may be a special need to 18073encourage the widest possible use of a certain library, so that it 18074becomes a de-facto standard. To achieve this, non-free programs must be 18075allowed to use the library. A more frequent case is that a free library 18076does the same job as widely used non-free libraries. In this case, 18077there is little to gain by limiting the free library to free software 18078only, so we use the Lesser General Public License. 18079 18080 In other cases, permission to use a particular library in non-free 18081programs enables a greater number of people to use a large body of free 18082software. For example, permission to use the GNU C Library in non-free 18083programs enables many more people to use the whole GNU operating system, 18084as well as its variant, the GNU/Linux operating system. 18085 18086 Although the Lesser General Public License is Less protective of the 18087users’ freedom, it does ensure that the user of a program that is linked 18088with the Library has the freedom and the wherewithal to run that program 18089using a modified version of the Library. 18090 18091 The precise terms and conditions for copying, distribution and 18092modification follow. Pay close attention to the difference between a 18093“work based on the library” and a “work that uses the library”. The 18094former contains code derived from the library, whereas the latter must 18095be combined with the library in order to run. 18096 18097TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 18098--------------------------------------------------------------- 18099 18100 0. This License Agreement applies to any software library or other 18101 program which contains a notice placed by the copyright holder or 18102 other authorized party saying it may be distributed under the terms 18103 of this Lesser General Public License (also called “this License”). 18104 Each licensee is addressed as “you”. 18105 18106 A “library” means a collection of software functions and/or data 18107 prepared so as to be conveniently linked with application programs 18108 (which use some of those functions and data) to form executables. 18109 18110 The “Library”, below, refers to any such software library or work 18111 which has been distributed under these terms. A “work based on the 18112 Library” means either the Library or any derivative work under 18113 copyright law: that is to say, a work containing the Library or a 18114 portion of it, either verbatim or with modifications and/or 18115 translated straightforwardly into another language. (Hereinafter, 18116 translation is included without limitation in the term 18117 “modification”.) 18118 18119 “Source code” for a work means the preferred form of the work for 18120 making modifications to it. For a library, complete source code 18121 means all the source code for all modules it contains, plus any 18122 associated interface definition files, plus the scripts used to 18123 control compilation and installation of the library. 18124 18125 Activities other than copying, distribution and modification are 18126 not covered by this License; they are outside its scope. The act 18127 of running a program using the Library is not restricted, and 18128 output from such a program is covered only if its contents 18129 constitute a work based on the Library (independent of the use of 18130 the Library in a tool for writing it). Whether that is true 18131 depends on what the Library does and what the program that uses the 18132 Library does. 18133 18134 1. You may copy and distribute verbatim copies of the Library’s 18135 complete source code as you receive it, in any medium, provided 18136 that you conspicuously and appropriately publish on each copy an 18137 appropriate copyright notice and disclaimer of warranty; keep 18138 intact all the notices that refer to this License and to the 18139 absence of any warranty; and distribute a copy of this License 18140 along with the Library. 18141 18142 You may charge a fee for the physical act of transferring a copy, 18143 and you may at your option offer warranty protection in exchange 18144 for a fee. 18145 18146 2. You may modify your copy or copies of the Library or any portion of 18147 it, thus forming a work based on the Library, and copy and 18148 distribute such modifications or work under the terms of Section 1 18149 above, provided that you also meet all of these conditions: 18150 18151 a. The modified work must itself be a software library. 18152 18153 b. You must cause the files modified to carry prominent notices 18154 stating that you changed the files and the date of any change. 18155 18156 c. You must cause the whole of the work to be licensed at no 18157 charge to all third parties under the terms of this License. 18158 18159 d. If a facility in the modified Library refers to a function or 18160 a table of data to be supplied by an application program that 18161 uses the facility, other than as an argument passed when the 18162 facility is invoked, then you must make a good faith effort to 18163 ensure that, in the event an application does not supply such 18164 function or table, the facility still operates, and performs 18165 whatever part of its purpose remains meaningful. 18166 18167 (For example, a function in a library to compute square roots 18168 has a purpose that is entirely well-defined independent of the 18169 application. Therefore, Subsection 2d requires that any 18170 application-supplied function or table used by this function 18171 must be optional: if the application does not supply it, the 18172 square root function must still compute square roots.) 18173 18174 These requirements apply to the modified work as a whole. If 18175 identifiable sections of that work are not derived from the 18176 Library, and can be reasonably considered independent and separate 18177 works in themselves, then this License, and its terms, do not apply 18178 to those sections when you distribute them as separate works. But 18179 when you distribute the same sections as part of a whole which is a 18180 work based on the Library, the distribution of the whole must be on 18181 the terms of this License, whose permissions for other licensees 18182 extend to the entire whole, and thus to each and every part 18183 regardless of who wrote it. 18184 18185 Thus, it is not the intent of this section to claim rights or 18186 contest your rights to work written entirely by you; rather, the 18187 intent is to exercise the right to control the distribution of 18188 derivative or collective works based on the Library. 18189 18190 In addition, mere aggregation of another work not based on the 18191 Library with the Library (or with a work based on the Library) on a 18192 volume of a storage or distribution medium does not bring the other 18193 work under the scope of this License. 18194 18195 3. You may opt to apply the terms of the ordinary GNU General Public 18196 License instead of this License to a given copy of the Library. To 18197 do this, you must alter all the notices that refer to this License, 18198 so that they refer to the ordinary GNU General Public License, 18199 version 2, instead of to this License. (If a newer version than 18200 version 2 of the ordinary GNU General Public License has appeared, 18201 then you can specify that version instead if you wish.) Do not 18202 make any other change in these notices. 18203 18204 Once this change is made in a given copy, it is irreversible for 18205 that copy, so the ordinary GNU General Public License applies to 18206 all subsequent copies and derivative works made from that copy. 18207 18208 This option is useful when you wish to copy part of the code of the 18209 Library into a program that is not a library. 18210 18211 4. You may copy and distribute the Library (or a portion or derivative 18212 of it, under Section 2) in object code or executable form under the 18213 terms of Sections 1 and 2 above provided that you accompany it with 18214 the complete corresponding machine-readable source code, which must 18215 be distributed under the terms of Sections 1 and 2 above on a 18216 medium customarily used for software interchange. 18217 18218 If distribution of object code is made by offering access to copy 18219 from a designated place, then offering equivalent access to copy 18220 the source code from the same place satisfies the requirement to 18221 distribute the source code, even though third parties are not 18222 compelled to copy the source along with the object code. 18223 18224 5. A program that contains no derivative of any portion of the 18225 Library, but is designed to work with the Library by being compiled 18226 or linked with it, is called a “work that uses the Library”. Such 18227 a work, in isolation, is not a derivative work of the Library, and 18228 therefore falls outside the scope of this License. 18229 18230 However, linking a “work that uses the Library” with the Library 18231 creates an executable that is a derivative of the Library (because 18232 it contains portions of the Library), rather than a “work that uses 18233 the library”. The executable is therefore covered by this License. 18234 Section 6 states terms for distribution of such executables. 18235 18236 When a “work that uses the Library” uses material from a header 18237 file that is part of the Library, the object code for the work may 18238 be a derivative work of the Library even though the source code is 18239 not. Whether this is true is especially significant if the work 18240 can be linked without the Library, or if the work is itself a 18241 library. The threshold for this to be true is not precisely 18242 defined by law. 18243 18244 If such an object file uses only numerical parameters, data 18245 structure layouts and accessors, and small macros and small inline 18246 functions (ten lines or less in length), then the use of the object 18247 file is unrestricted, regardless of whether it is legally a 18248 derivative work. (Executables containing this object code plus 18249 portions of the Library will still fall under Section 6.) 18250 18251 Otherwise, if the work is a derivative of the Library, you may 18252 distribute the object code for the work under the terms of Section 18253 6. Any executables containing that work also fall under Section 6, 18254 whether or not they are linked directly with the Library itself. 18255 18256 6. As an exception to the Sections above, you may also combine or link 18257 a “work that uses the Library” with the Library to produce a work 18258 containing portions of the Library, and distribute that work under 18259 terms of your choice, provided that the terms permit modification 18260 of the work for the customer’s own use and reverse engineering for 18261 debugging such modifications. 18262 18263 You must give prominent notice with each copy of the work that the 18264 Library is used in it and that the Library and its use are covered 18265 by this License. You must supply a copy of this License. If the 18266 work during execution displays copyright notices, you must include 18267 the copyright notice for the Library among them, as well as a 18268 reference directing the user to the copy of this License. Also, 18269 you must do one of these things: 18270 18271 a. Accompany the work with the complete corresponding 18272 machine-readable source code for the Library including 18273 whatever changes were used in the work (which must be 18274 distributed under Sections 1 and 2 above); and, if the work is 18275 an executable linked with the Library, with the complete 18276 machine-readable “work that uses the Library”, as object code 18277 and/or source code, so that the user can modify the Library 18278 and then relink to produce a modified executable containing 18279 the modified Library. (It is understood that the user who 18280 changes the contents of definitions files in the Library will 18281 not necessarily be able to recompile the application to use 18282 the modified definitions.) 18283 18284 b. Use a suitable shared library mechanism for linking with the 18285 Library. A suitable mechanism is one that (1) uses at run 18286 time a copy of the library already present on the user’s 18287 computer system, rather than copying library functions into 18288 the executable, and (2) will operate properly with a modified 18289 version of the library, if the user installs one, as long as 18290 the modified version is interface-compatible with the version 18291 that the work was made with. 18292 18293 c. Accompany the work with a written offer, valid for at least 18294 three years, to give the same user the materials specified in 18295 Subsection 6a, above, for a charge no more than the cost of 18296 performing this distribution. 18297 18298 d. If distribution of the work is made by offering access to copy 18299 from a designated place, offer equivalent access to copy the 18300 above specified materials from the same place. 18301 18302 e. Verify that the user has already received a copy of these 18303 materials or that you have already sent this user a copy. 18304 18305 For an executable, the required form of the “work that uses the 18306 Library” must include any data and utility programs needed for 18307 reproducing the executable from it. However, as a special 18308 exception, the materials to be distributed need not include 18309 anything that is normally distributed (in either source or binary 18310 form) with the major components (compiler, kernel, and so on) of 18311 the operating system on which the executable runs, unless that 18312 component itself accompanies the executable. 18313 18314 It may happen that this requirement contradicts the license 18315 restrictions of other proprietary libraries that do not normally 18316 accompany the operating system. Such a contradiction means you 18317 cannot use both them and the Library together in an executable that 18318 you distribute. 18319 18320 7. You may place library facilities that are a work based on the 18321 Library side-by-side in a single library together with other 18322 library facilities not covered by this License, and distribute such 18323 a combined library, provided that the separate distribution of the 18324 work based on the Library and of the other library facilities is 18325 otherwise permitted, and provided that you do these two things: 18326 18327 a. Accompany the combined library with a copy of the same work 18328 based on the Library, uncombined with any other library 18329 facilities. This must be distributed under the terms of the 18330 Sections above. 18331 18332 b. Give prominent notice with the combined library of the fact 18333 that part of it is a work based on the Library, and explaining 18334 where to find the accompanying uncombined form of the same 18335 work. 18336 18337 8. You may not copy, modify, sublicense, link with, or distribute the 18338 Library except as expressly provided under this License. Any 18339 attempt otherwise to copy, modify, sublicense, link with, or 18340 distribute the Library is void, and will automatically terminate 18341 your rights under this License. However, parties who have received 18342 copies, or rights, from you under this License will not have their 18343 licenses terminated so long as such parties remain in full 18344 compliance. 18345 18346 9. You are not required to accept this License, since you have not 18347 signed it. However, nothing else grants you permission to modify 18348 or distribute the Library or its derivative works. These actions 18349 are prohibited by law if you do not accept this License. 18350 Therefore, by modifying or distributing the Library (or any work 18351 based on the Library), you indicate your acceptance of this License 18352 to do so, and all its terms and conditions for copying, 18353 distributing or modifying the Library or works based on it. 18354 18355 10. Each time you redistribute the Library (or any work based on the 18356 Library), the recipient automatically receives a license from the 18357 original licensor to copy, distribute, link with or modify the 18358 Library subject to these terms and conditions. You may not impose 18359 any further restrictions on the recipients’ exercise of the rights 18360 granted herein. You are not responsible for enforcing compliance 18361 by third parties with this License. 18362 18363 11. If, as a consequence of a court judgment or allegation of patent 18364 infringement or for any other reason (not limited to patent 18365 issues), conditions are imposed on you (whether by court order, 18366 agreement or otherwise) that contradict the conditions of this 18367 License, they do not excuse you from the conditions of this 18368 License. If you cannot distribute so as to satisfy simultaneously 18369 your obligations under this License and any other pertinent 18370 obligations, then as a consequence you may not distribute the 18371 Library at all. For example, if a patent license would not permit 18372 royalty-free redistribution of the Library by all those who receive 18373 copies directly or indirectly through you, then the only way you 18374 could satisfy both it and this License would be to refrain entirely 18375 from distribution of the Library. 18376 18377 If any portion of this section is held invalid or unenforceable 18378 under any particular circumstance, the balance of the section is 18379 intended to apply, and the section as a whole is intended to apply 18380 in other circumstances. 18381 18382 It is not the purpose of this section to induce you to infringe any 18383 patents or other property right claims or to contest validity of 18384 any such claims; this section has the sole purpose of protecting 18385 the integrity of the free software distribution system which is 18386 implemented by public license practices. Many people have made 18387 generous contributions to the wide range of software distributed 18388 through that system in reliance on consistent application of that 18389 system; it is up to the author/donor to decide if he or she is 18390 willing to distribute software through any other system and a 18391 licensee cannot impose that choice. 18392 18393 This section is intended to make thoroughly clear what is believed 18394 to be a consequence of the rest of this License. 18395 18396 12. If the distribution and/or use of the Library is restricted in 18397 certain countries either by patents or by copyrighted interfaces, 18398 the original copyright holder who places the Library under this 18399 License may add an explicit geographical distribution limitation 18400 excluding those countries, so that distribution is permitted only 18401 in or among countries not thus excluded. In such case, this 18402 License incorporates the limitation as if written in the body of 18403 this License. 18404 18405 13. The Free Software Foundation may publish revised and/or new 18406 versions of the Lesser General Public License from time to time. 18407 Such new versions will be similar in spirit to the present version, 18408 but may differ in detail to address new problems or concerns. 18409 18410 Each version is given a distinguishing version number. If the 18411 Library specifies a version number of this License which applies to 18412 it and “any later version”, you have the option of following the 18413 terms and conditions either of that version or of any later version 18414 published by the Free Software Foundation. If the Library does not 18415 specify a license version number, you may choose any version ever 18416 published by the Free Software Foundation. 18417 18418 14. If you wish to incorporate parts of the Library into other free 18419 programs whose distribution conditions are incompatible with these, 18420 write to the author to ask for permission. For software which is 18421 copyrighted by the Free Software Foundation, write to the Free 18422 Software Foundation; we sometimes make exceptions for this. Our 18423 decision will be guided by the two goals of preserving the free 18424 status of all derivatives of our free software and of promoting the 18425 sharing and reuse of software generally. 18426 18427 NO WARRANTY 18428 18429 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 18430 WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE 18431 LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS 18432 AND/OR OTHER PARTIES PROVIDE THE LIBRARY “AS IS” WITHOUT WARRANTY 18433 OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT 18434 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 18435 FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND 18436 PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE 18437 DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR 18438 OR CORRECTION. 18439 18440 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 18441 WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY 18442 MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE 18443 LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, 18444 INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR 18445 INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF 18446 DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU 18447 OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY 18448 OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN 18449 ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 18450 18451END OF TERMS AND CONDITIONS 18452--------------------------- 18453 18454How to Apply These Terms to Your New Libraries 18455---------------------------------------------- 18456 18457 If you develop a new library, and you want it to be of the greatest 18458possible use to the public, we recommend making it free software that 18459everyone can redistribute and change. You can do so by permitting 18460redistribution under these terms (or, alternatively, under the terms of 18461the ordinary General Public License). 18462 18463 To apply these terms, attach the following notices to the library. 18464It is safest to attach them to the start of each source file to most 18465effectively convey the exclusion of warranty; and each file should have 18466at least the “copyright” line and a pointer to where the full notice is 18467found. 18468 18469 ONE LINE TO GIVE THE LIBRARY'S NAME AND AN IDEA OF WHAT IT DOES. 18470 Copyright (C) YEAR NAME OF AUTHOR 18471 18472 This library is free software; you can redistribute it and/or modify it 18473 under the terms of the GNU Lesser General Public License as published by 18474 the Free Software Foundation; either version 2.1 of the License, or (at 18475 your option) any later version. 18476 18477 This library is distributed in the hope that it will be useful, but 18478 WITHOUT ANY WARRANTY; without even the implied warranty of 18479 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18480 Lesser General Public License for more details. 18481 18482 You should have received a copy of the GNU Lesser General Public 18483 License along with this library; if not, write to the Free Software 18484 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 18485 USA. 18486 18487 Also add information on how to contact you by electronic and paper 18488mail. 18489 18490 You should also get your employer (if you work as a programmer) or 18491your school, if any, to sign a “copyright disclaimer” for the library, 18492if necessary. Here is a sample; alter the names: 18493 18494 Yoyodyne, Inc., hereby disclaims all copyright interest in the library 18495 `Frob' (a library for tweaking knobs) written by James Random Hacker. 18496 18497 SIGNATURE OF TY COON, 1 April 1990 18498 Ty Coon, President of Vice 18499 18500 That’s all there is to it! 18501 18502 18503File: gettext.info, Node: GNU FDL, Prev: GNU LGPL, Up: Licenses 18504 18505C.3 GNU Free Documentation License 18506================================== 18507 18508 Version 1.2, November 2002 18509 18510 Copyright © 2000,2001,2002 Free Software Foundation, Inc. 18511 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 18512 18513 Everyone is permitted to copy and distribute verbatim copies 18514 of this license document, but changing it is not allowed. 18515 18516 0. PREAMBLE 18517 18518 The purpose of this License is to make a manual, textbook, or other 18519 functional and useful document “free” in the sense of freedom: to 18520 assure everyone the effective freedom to copy and redistribute it, 18521 with or without modifying it, either commercially or 18522 noncommercially. Secondarily, this License preserves for the 18523 author and publisher a way to get credit for their work, while not 18524 being considered responsible for modifications made by others. 18525 18526 This License is a kind of “copyleft”, which means that derivative 18527 works of the document must themselves be free in the same sense. 18528 It complements the GNU General Public License, which is a copyleft 18529 license designed for free software. 18530 18531 We have designed this License in order to use it for manuals for 18532 free software, because free software needs free documentation: a 18533 free program should come with manuals providing the same freedoms 18534 that the software does. But this License is not limited to 18535 software manuals; it can be used for any textual work, regardless 18536 of subject matter or whether it is published as a printed book. We 18537 recommend this License principally for works whose purpose is 18538 instruction or reference. 18539 18540 1. APPLICABILITY AND DEFINITIONS 18541 18542 This License applies to any manual or other work, in any medium, 18543 that contains a notice placed by the copyright holder saying it can 18544 be distributed under the terms of this License. Such a notice 18545 grants a world-wide, royalty-free license, unlimited in duration, 18546 to use that work under the conditions stated herein. The 18547 “Document”, below, refers to any such manual or work. Any member 18548 of the public is a licensee, and is addressed as “you”. You accept 18549 the license if you copy, modify or distribute the work in a way 18550 requiring permission under copyright law. 18551 18552 A “Modified Version” of the Document means any work containing the 18553 Document or a portion of it, either copied verbatim, or with 18554 modifications and/or translated into another language. 18555 18556 A “Secondary Section” is a named appendix or a front-matter section 18557 of the Document that deals exclusively with the relationship of the 18558 publishers or authors of the Document to the Document’s overall 18559 subject (or to related matters) and contains nothing that could 18560 fall directly within that overall subject. (Thus, if the Document 18561 is in part a textbook of mathematics, a Secondary Section may not 18562 explain any mathematics.) The relationship could be a matter of 18563 historical connection with the subject or with related matters, or 18564 of legal, commercial, philosophical, ethical or political position 18565 regarding them. 18566 18567 The “Invariant Sections” are certain Secondary Sections whose 18568 titles are designated, as being those of Invariant Sections, in the 18569 notice that says that the Document is released under this License. 18570 If a section does not fit the above definition of Secondary then it 18571 is not allowed to be designated as Invariant. The Document may 18572 contain zero Invariant Sections. If the Document does not identify 18573 any Invariant Sections then there are none. 18574 18575 The “Cover Texts” are certain short passages of text that are 18576 listed, as Front-Cover Texts or Back-Cover Texts, in the notice 18577 that says that the Document is released under this License. A 18578 Front-Cover Text may be at most 5 words, and a Back-Cover Text may 18579 be at most 25 words. 18580 18581 A “Transparent” copy of the Document means a machine-readable copy, 18582 represented in a format whose specification is available to the 18583 general public, that is suitable for revising the document 18584 straightforwardly with generic text editors or (for images composed 18585 of pixels) generic paint programs or (for drawings) some widely 18586 available drawing editor, and that is suitable for input to text 18587 formatters or for automatic translation to a variety of formats 18588 suitable for input to text formatters. A copy made in an otherwise 18589 Transparent file format whose markup, or absence of markup, has 18590 been arranged to thwart or discourage subsequent modification by 18591 readers is not Transparent. An image format is not Transparent if 18592 used for any substantial amount of text. A copy that is not 18593 “Transparent” is called “Opaque”. 18594 18595 Examples of suitable formats for Transparent copies include plain 18596 ASCII without markup, Texinfo input format, LaTeX input format, 18597 SGML or XML using a publicly available DTD, and standard-conforming 18598 simple HTML, PostScript or PDF designed for human modification. 18599 Examples of transparent image formats include PNG, XCF and JPG. 18600 Opaque formats include proprietary formats that can be read and 18601 edited only by proprietary word processors, SGML or XML for which 18602 the DTD and/or processing tools are not generally available, and 18603 the machine-generated HTML, PostScript or PDF produced by some word 18604 processors for output purposes only. 18605 18606 The “Title Page” means, for a printed book, the title page itself, 18607 plus such following pages as are needed to hold, legibly, the 18608 material this License requires to appear in the title page. For 18609 works in formats which do not have any title page as such, “Title 18610 Page” means the text near the most prominent appearance of the 18611 work’s title, preceding the beginning of the body of the text. 18612 18613 A section “Entitled XYZ” means a named subunit of the Document 18614 whose title either is precisely XYZ or contains XYZ in parentheses 18615 following text that translates XYZ in another language. (Here XYZ 18616 stands for a specific section name mentioned below, such as 18617 “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) 18618 To “Preserve the Title” of such a section when you modify the 18619 Document means that it remains a section “Entitled XYZ” according 18620 to this definition. 18621 18622 The Document may include Warranty Disclaimers next to the notice 18623 which states that this License applies to the Document. These 18624 Warranty Disclaimers are considered to be included by reference in 18625 this License, but only as regards disclaiming warranties: any other 18626 implication that these Warranty Disclaimers may have is void and 18627 has no effect on the meaning of this License. 18628 18629 2. VERBATIM COPYING 18630 18631 You may copy and distribute the Document in any medium, either 18632 commercially or noncommercially, provided that this License, the 18633 copyright notices, and the license notice saying this License 18634 applies to the Document are reproduced in all copies, and that you 18635 add no other conditions whatsoever to those of this License. You 18636 may not use technical measures to obstruct or control the reading 18637 or further copying of the copies you make or distribute. However, 18638 you may accept compensation in exchange for copies. If you 18639 distribute a large enough number of copies you must also follow the 18640 conditions in section 3. 18641 18642 You may also lend copies, under the same conditions stated above, 18643 and you may publicly display copies. 18644 18645 3. COPYING IN QUANTITY 18646 18647 If you publish printed copies (or copies in media that commonly 18648 have printed covers) of the Document, numbering more than 100, and 18649 the Document’s license notice requires Cover Texts, you must 18650 enclose the copies in covers that carry, clearly and legibly, all 18651 these Cover Texts: Front-Cover Texts on the front cover, and 18652 Back-Cover Texts on the back cover. Both covers must also clearly 18653 and legibly identify you as the publisher of these copies. The 18654 front cover must present the full title with all words of the title 18655 equally prominent and visible. You may add other material on the 18656 covers in addition. Copying with changes limited to the covers, as 18657 long as they preserve the title of the Document and satisfy these 18658 conditions, can be treated as verbatim copying in other respects. 18659 18660 If the required texts for either cover are too voluminous to fit 18661 legibly, you should put the first ones listed (as many as fit 18662 reasonably) on the actual cover, and continue the rest onto 18663 adjacent pages. 18664 18665 If you publish or distribute Opaque copies of the Document 18666 numbering more than 100, you must either include a machine-readable 18667 Transparent copy along with each Opaque copy, or state in or with 18668 each Opaque copy a computer-network location from which the general 18669 network-using public has access to download using public-standard 18670 network protocols a complete Transparent copy of the Document, free 18671 of added material. If you use the latter option, you must take 18672 reasonably prudent steps, when you begin distribution of Opaque 18673 copies in quantity, to ensure that this Transparent copy will 18674 remain thus accessible at the stated location until at least one 18675 year after the last time you distribute an Opaque copy (directly or 18676 through your agents or retailers) of that edition to the public. 18677 18678 It is requested, but not required, that you contact the authors of 18679 the Document well before redistributing any large number of copies, 18680 to give them a chance to provide you with an updated version of the 18681 Document. 18682 18683 4. MODIFICATIONS 18684 18685 You may copy and distribute a Modified Version of the Document 18686 under the conditions of sections 2 and 3 above, provided that you 18687 release the Modified Version under precisely this License, with the 18688 Modified Version filling the role of the Document, thus licensing 18689 distribution and modification of the Modified Version to whoever 18690 possesses a copy of it. In addition, you must do these things in 18691 the Modified Version: 18692 18693 A. Use in the Title Page (and on the covers, if any) a title 18694 distinct from that of the Document, and from those of previous 18695 versions (which should, if there were any, be listed in the 18696 History section of the Document). You may use the same title 18697 as a previous version if the original publisher of that 18698 version gives permission. 18699 18700 B. List on the Title Page, as authors, one or more persons or 18701 entities responsible for authorship of the modifications in 18702 the Modified Version, together with at least five of the 18703 principal authors of the Document (all of its principal 18704 authors, if it has fewer than five), unless they release you 18705 from this requirement. 18706 18707 C. State on the Title page the name of the publisher of the 18708 Modified Version, as the publisher. 18709 18710 D. Preserve all the copyright notices of the Document. 18711 18712 E. Add an appropriate copyright notice for your modifications 18713 adjacent to the other copyright notices. 18714 18715 F. Include, immediately after the copyright notices, a license 18716 notice giving the public permission to use the Modified 18717 Version under the terms of this License, in the form shown in 18718 the Addendum below. 18719 18720 G. Preserve in that license notice the full lists of Invariant 18721 Sections and required Cover Texts given in the Document’s 18722 license notice. 18723 18724 H. Include an unaltered copy of this License. 18725 18726 I. Preserve the section Entitled “History”, Preserve its Title, 18727 and add to it an item stating at least the title, year, new 18728 authors, and publisher of the Modified Version as given on the 18729 Title Page. If there is no section Entitled “History” in the 18730 Document, create one stating the title, year, authors, and 18731 publisher of the Document as given on its Title Page, then add 18732 an item describing the Modified Version as stated in the 18733 previous sentence. 18734 18735 J. Preserve the network location, if any, given in the Document 18736 for public access to a Transparent copy of the Document, and 18737 likewise the network locations given in the Document for 18738 previous versions it was based on. These may be placed in the 18739 “History” section. You may omit a network location for a work 18740 that was published at least four years before the Document 18741 itself, or if the original publisher of the version it refers 18742 to gives permission. 18743 18744 K. For any section Entitled “Acknowledgements” or “Dedications”, 18745 Preserve the Title of the section, and preserve in the section 18746 all the substance and tone of each of the contributor 18747 acknowledgements and/or dedications given therein. 18748 18749 L. Preserve all the Invariant Sections of the Document, unaltered 18750 in their text and in their titles. Section numbers or the 18751 equivalent are not considered part of the section titles. 18752 18753 M. Delete any section Entitled “Endorsements”. Such a section 18754 may not be included in the Modified Version. 18755 18756 N. Do not retitle any existing section to be Entitled 18757 “Endorsements” or to conflict in title with any Invariant 18758 Section. 18759 18760 O. Preserve any Warranty Disclaimers. 18761 18762 If the Modified Version includes new front-matter sections or 18763 appendices that qualify as Secondary Sections and contain no 18764 material copied from the Document, you may at your option designate 18765 some or all of these sections as invariant. To do this, add their 18766 titles to the list of Invariant Sections in the Modified Version’s 18767 license notice. These titles must be distinct from any other 18768 section titles. 18769 18770 You may add a section Entitled “Endorsements”, provided it contains 18771 nothing but endorsements of your Modified Version by various 18772 parties—for example, statements of peer review or that the text has 18773 been approved by an organization as the authoritative definition of 18774 a standard. 18775 18776 You may add a passage of up to five words as a Front-Cover Text, 18777 and a passage of up to 25 words as a Back-Cover Text, to the end of 18778 the list of Cover Texts in the Modified Version. Only one passage 18779 of Front-Cover Text and one of Back-Cover Text may be added by (or 18780 through arrangements made by) any one entity. If the Document 18781 already includes a cover text for the same cover, previously added 18782 by you or by arrangement made by the same entity you are acting on 18783 behalf of, you may not add another; but you may replace the old 18784 one, on explicit permission from the previous publisher that added 18785 the old one. 18786 18787 The author(s) and publisher(s) of the Document do not by this 18788 License give permission to use their names for publicity for or to 18789 assert or imply endorsement of any Modified Version. 18790 18791 5. COMBINING DOCUMENTS 18792 18793 You may combine the Document with other documents released under 18794 this License, under the terms defined in section 4 above for 18795 modified versions, provided that you include in the combination all 18796 of the Invariant Sections of all of the original documents, 18797 unmodified, and list them all as Invariant Sections of your 18798 combined work in its license notice, and that you preserve all 18799 their Warranty Disclaimers. 18800 18801 The combined work need only contain one copy of this License, and 18802 multiple identical Invariant Sections may be replaced with a single 18803 copy. If there are multiple Invariant Sections with the same name 18804 but different contents, make the title of each such section unique 18805 by adding at the end of it, in parentheses, the name of the 18806 original author or publisher of that section if known, or else a 18807 unique number. Make the same adjustment to the section titles in 18808 the list of Invariant Sections in the license notice of the 18809 combined work. 18810 18811 In the combination, you must combine any sections Entitled 18812 “History” in the various original documents, forming one section 18813 Entitled “History”; likewise combine any sections Entitled 18814 “Acknowledgements”, and any sections Entitled “Dedications”. You 18815 must delete all sections Entitled “Endorsements.” 18816 18817 6. COLLECTIONS OF DOCUMENTS 18818 18819 You may make a collection consisting of the Document and other 18820 documents released under this License, and replace the individual 18821 copies of this License in the various documents with a single copy 18822 that is included in the collection, provided that you follow the 18823 rules of this License for verbatim copying of each of the documents 18824 in all other respects. 18825 18826 You may extract a single document from such a collection, and 18827 distribute it individually under this License, provided you insert 18828 a copy of this License into the extracted document, and follow this 18829 License in all other respects regarding verbatim copying of that 18830 document. 18831 18832 7. AGGREGATION WITH INDEPENDENT WORKS 18833 18834 A compilation of the Document or its derivatives with other 18835 separate and independent documents or works, in or on a volume of a 18836 storage or distribution medium, is called an “aggregate” if the 18837 copyright resulting from the compilation is not used to limit the 18838 legal rights of the compilation’s users beyond what the individual 18839 works permit. When the Document is included in an aggregate, this 18840 License does not apply to the other works in the aggregate which 18841 are not themselves derivative works of the Document. 18842 18843 If the Cover Text requirement of section 3 is applicable to these 18844 copies of the Document, then if the Document is less than one half 18845 of the entire aggregate, the Document’s Cover Texts may be placed 18846 on covers that bracket the Document within the aggregate, or the 18847 electronic equivalent of covers if the Document is in electronic 18848 form. Otherwise they must appear on printed covers that bracket 18849 the whole aggregate. 18850 18851 8. TRANSLATION 18852 18853 Translation is considered a kind of modification, so you may 18854 distribute translations of the Document under the terms of section 18855 4. Replacing Invariant Sections with translations requires special 18856 permission from their copyright holders, but you may include 18857 translations of some or all Invariant Sections in addition to the 18858 original versions of these Invariant Sections. You may include a 18859 translation of this License, and all the license notices in the 18860 Document, and any Warranty Disclaimers, provided that you also 18861 include the original English version of this License and the 18862 original versions of those notices and disclaimers. In case of a 18863 disagreement between the translation and the original version of 18864 this License or a notice or disclaimer, the original version will 18865 prevail. 18866 18867 If a section in the Document is Entitled “Acknowledgements”, 18868 “Dedications”, or “History”, the requirement (section 4) to 18869 Preserve its Title (section 1) will typically require changing the 18870 actual title. 18871 18872 9. TERMINATION 18873 18874 You may not copy, modify, sublicense, or distribute the Document 18875 except as expressly provided for under this License. Any other 18876 attempt to copy, modify, sublicense or distribute the Document is 18877 void, and will automatically terminate your rights under this 18878 License. However, parties who have received copies, or rights, 18879 from you under this License will not have their licenses terminated 18880 so long as such parties remain in full compliance. 18881 18882 10. FUTURE REVISIONS OF THIS LICENSE 18883 18884 The Free Software Foundation may publish new, revised versions of 18885 the GNU Free Documentation License from time to time. Such new 18886 versions will be similar in spirit to the present version, but may 18887 differ in detail to address new problems or concerns. See 18888 <https://www.gnu.org/copyleft/>. 18889 18890 Each version of the License is given a distinguishing version 18891 number. If the Document specifies that a particular numbered 18892 version of this License “or any later version” applies to it, you 18893 have the option of following the terms and conditions either of 18894 that specified version or of any later version that has been 18895 published (not as a draft) by the Free Software Foundation. If the 18896 Document does not specify a version number of this License, you may 18897 choose any version ever published (not as a draft) by the Free 18898 Software Foundation. 18899 18900ADDENDUM: How to use this License for your documents 18901==================================================== 18902 18903 To use this License in a document you have written, include a copy of 18904the License in the document and put the following copyright and license 18905notices just after the title page: 18906 18907 Copyright (C) YEAR YOUR NAME. 18908 Permission is granted to copy, distribute and/or modify this document 18909 under the terms of the GNU Free Documentation License, Version 1.2 18910 or any later version published by the Free Software Foundation; 18911 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover 18912 Texts. A copy of the license is included in the section entitled ``GNU 18913 Free Documentation License''. 18914 18915 If you have Invariant Sections, Front-Cover Texts and Back-Cover 18916Texts, replace the “with...Texts.” line with this: 18917 18918 with the Invariant Sections being LIST THEIR TITLES, with 18919 the Front-Cover Texts being LIST, and with the Back-Cover Texts 18920 being LIST. 18921 18922 If you have Invariant Sections without Cover Texts, or some other 18923combination of the three, merge those two alternatives to suit the 18924situation. 18925 18926 If your document contains nontrivial examples of program code, we 18927recommend releasing these examples in parallel under your choice of free 18928software license, such as the GNU General Public License, to permit 18929their use in free software. 18930 18931 18932File: gettext.info, Node: Program Index, Next: Option Index, Prev: Licenses, Up: Top 18933 18934Program Index 18935************* 18936 18937[index] 18938* Menu: 18939 18940* autopoint: autopoint Invocation. 18941 (line 6) 18942* boldquot: msgfilter Invocation. 18943 (line 111) 18944* envsubst: envsubst Invocation. (line 6) 18945* gettext: sh. (line 22) 18946* gettext <1>: gettext Invocation. (line 6) 18947* gettextize: gettextize Invocation. 18948 (line 34) 18949* msgattrib: msgattrib Invocation. 18950 (line 6) 18951* msgcat: msgcat Invocation. (line 6) 18952* msgcmp: msgcmp Invocation. (line 6) 18953* msgcomm: msgcomm Invocation. (line 6) 18954* msgconv: msgconv Invocation. (line 6) 18955* msgen: msgen Invocation. (line 6) 18956* msgexec: msgexec Invocation. (line 6) 18957* msgfilter: msgfilter Invocation. 18958 (line 6) 18959* msgfmt: msgfmt Invocation. (line 6) 18960* msggrep: msggrep Invocation. (line 6) 18961* msginit: msginit Invocation. (line 6) 18962* msgmerge: msgmerge Invocation. (line 6) 18963* msgunfmt: msgunfmt Invocation. (line 6) 18964* msguniq: msguniq Invocation. (line 6) 18965* ngettext: sh. (line 22) 18966* ngettext <1>: ngettext Invocation. (line 6) 18967* quot: msgfilter Invocation. 18968 (line 107) 18969* recode-sr-latin: msgfilter Invocation. 18970 (line 101) 18971* xgettext: xgettext Invocation. (line 6) 18972 18973 18974File: gettext.info, Node: Option Index, Next: Variable Index, Prev: Program Index, Up: Top 18975 18976Option Index 18977************ 18978 18979[index] 18980* Menu: 18981 18982* --add-comments, xgettext option: xgettext Invocation. (line 94) 18983* --add-location, msgattrib option: msgattrib Invocation. 18984 (line 138) 18985* --add-location, msgcat option: msgcat Invocation. (line 118) 18986* --add-location, msgcomm option: msgcomm Invocation. (line 100) 18987* --add-location, msgconv option: msgconv Invocation. (line 80) 18988* --add-location, msgen option: msgen Invocation. (line 83) 18989* --add-location, msgfilter option: msgfilter Invocation. 18990 (line 161) 18991* --add-location, msggrep option: msggrep Invocation. (line 152) 18992* --add-location, msgmerge option: msgmerge Invocation. (line 157) 18993* --add-location, msguniq option: msguniq Invocation. (line 97) 18994* --add-location, xgettext option: xgettext Invocation. (line 371) 18995* --alignment, msgfmt option: msgfmt Invocation. (line 288) 18996* --backup, msgmerge option: msgmerge Invocation. (line 62) 18997* --boost, xgettext option: xgettext Invocation. (line 329) 18998* --c++, xgettext option: xgettext Invocation. (line 63) 18999* --check, msgfmt option: msgfmt Invocation. (line 226) 19000* --check, xgettext option: xgettext Invocation. (line 116) 19001* --check-accelerators, msgfmt option: msgfmt Invocation. (line 267) 19002* --check-compatibility, msgfmt option: msgfmt Invocation. (line 263) 19003* --check-domain, msgfmt option: msgfmt Invocation. (line 258) 19004* --check-format, msgfmt option: msgfmt Invocation. (line 230) 19005* --check-header, msgfmt option: msgfmt Invocation. (line 253) 19006* --clear-fuzzy, msgattrib option: msgattrib Invocation. 19007 (line 68) 19008* --clear-obsolete, msgattrib option: msgattrib Invocation. 19009 (line 74) 19010* --clear-previous, msgattrib option: msgattrib Invocation. 19011 (line 81) 19012* --color, msgattrib option: msgattrib Invocation. 19013 (line 119) 19014* --color, msgcat option: msgcat Invocation. (line 99) 19015* --color, msgcat option <1>: The --color option. (line 6) 19016* --color, msgcomm option: msgcomm Invocation. (line 81) 19017* --color, msgconv option: msgconv Invocation. (line 61) 19018* --color, msgen option: msgen Invocation. (line 64) 19019* --color, msgfilter option: msgfilter Invocation. 19020 (line 138) 19021* --color, msggrep option: msggrep Invocation. (line 134) 19022* --color, msginit option: msginit Invocation. (line 96) 19023* --color, msgmerge option: msgmerge Invocation. (line 138) 19024* --color, msgunfmt option: msgunfmt Invocation. (line 103) 19025* --color, msguniq option: msguniq Invocation. (line 78) 19026* --color, xgettext option: xgettext Invocation. (line 350) 19027* --comment, msggrep option: msggrep Invocation. (line 86) 19028* --compendium, msgmerge option: msgmerge Invocation. (line 36) 19029* --context, gettext option: gettext Invocation. (line 16) 19030* --context, ngettext option: ngettext Invocation. (line 15) 19031* --copyright-holder, xgettext option: xgettext Invocation. (line 435) 19032* --csharp, msgfmt option: msgfmt Invocation. (line 36) 19033* --csharp, msgunfmt option: msgunfmt Invocation. (line 19) 19034* --csharp-resources, msgfmt option: msgfmt Invocation. (line 40) 19035* --csharp-resources, msgunfmt option: msgunfmt Invocation. (line 23) 19036* --debug, xgettext option: xgettext Invocation. (line 333) 19037* --default-domain, xgettext option: xgettext Invocation. (line 35) 19038* --desktop, msgfmt option: msgfmt Invocation. (line 49) 19039* --directory, msgattrib option: msgattrib Invocation. 19040 (line 19) 19041* --directory, msgcat option: msgcat Invocation. (line 35) 19042* --directory, msgcmp option: msgcmp Invocation. (line 27) 19043* --directory, msgcomm option: msgcomm Invocation. (line 30) 19044* --directory, msgconv option: msgconv Invocation. (line 19) 19045* --directory, msgen option: msgen Invocation. (line 25) 19046* --directory, msgexec option: msgexec Invocation. (line 54) 19047* --directory, msgfilter option: msgfilter Invocation. 19048 (line 34) 19049* --directory, msgfmt option: msgfmt Invocation. (line 18) 19050* --directory, msggrep option: msggrep Invocation. (line 19) 19051* --directory, msgmerge option: msgmerge Invocation. (line 30) 19052* --directory, msguniq option: msguniq Invocation. (line 26) 19053* --directory, xgettext option: xgettext Invocation. (line 24) 19054* --domain, gettext option: gettext Invocation. (line 21) 19055* --domain, msggrep option: msggrep Invocation. (line 70) 19056* --domain, ngettext option: ngettext Invocation. (line 20) 19057* --dry-run, autopoint option: autopoint Invocation. 19058 (line 31) 19059* --dry-run, gettextize option: gettextize Invocation. 19060 (line 64) 19061* --empty, msgattrib option: msgattrib Invocation. 19062 (line 84) 19063* --endianness, msgfmt option: msgfmt Invocation. (line 291) 19064* --exclude-file, xgettext option: xgettext Invocation. (line 89) 19065* --expression, msgfilter option: msgfilter Invocation. 19066 (line 87) 19067* --extended-regexp, msggrep option: msggrep Invocation. (line 94) 19068* --extract-all, xgettext option: xgettext Invocation. (line 165) 19069* --extracted-comment, msggrep option: msggrep Invocation. (line 90) 19070* --file, msgfilter option: msgfilter Invocation. 19071 (line 91) 19072* --file, msggrep option: msggrep Invocation. (line 106) 19073* --files-from, msgcat option: msgcat Invocation. (line 30) 19074* --files-from, msgcomm option: msgcomm Invocation. (line 25) 19075* --files-from, xgettext option: xgettext Invocation. (line 19) 19076* --fixed-strings, msggrep option: msggrep Invocation. (line 98) 19077* --flag, xgettext option: xgettext Invocation. (line 276) 19078* --for-msgfmt, msgmerge option: msgmerge Invocation. (line 99) 19079* --force, autopoint option: autopoint Invocation. 19080 (line 27) 19081* --force, gettextize option: gettextize Invocation. 19082 (line 40) 19083* --force-po, msgattrib option: msgattrib Invocation. 19084 (line 127) 19085* --force-po, msgcat option: msgcat Invocation. (line 107) 19086* --force-po, msgcomm option: msgcomm Invocation. (line 89) 19087* --force-po, msgconv option: msgconv Invocation. (line 69) 19088* --force-po, msgen option: msgen Invocation. (line 72) 19089* --force-po, msgfilter option: msgfilter Invocation. 19090 (line 146) 19091* --force-po, msggrep option: msggrep Invocation. (line 142) 19092* --force-po, msgmerge option: msgmerge Invocation. (line 146) 19093* --force-po, msgunfmt option: msgunfmt Invocation. (line 111) 19094* --force-po, msguniq option: msguniq Invocation. (line 86) 19095* --force-po, xgettext option: xgettext Invocation. (line 358) 19096* --foreign-user, xgettext option: xgettext Invocation. (line 450) 19097* --from-code, xgettext option: xgettext Invocation. (line 72) 19098* --fuzzy, msgattrib option: msgattrib Invocation. 19099 (line 95) 19100* --help, autopoint option: autopoint Invocation. 19101 (line 39) 19102* --help, envsubst option: envsubst Invocation. (line 21) 19103* --help, gettext option: gettext Invocation. (line 37) 19104* --help, gettextize option: gettextize Invocation. 19105 (line 69) 19106* --help, msgattrib option: msgattrib Invocation. 19107 (line 188) 19108* --help, msgcat option: msgcat Invocation. (line 168) 19109* --help, msgcmp option: msgcmp Invocation. (line 69) 19110* --help, msgcomm option: msgcomm Invocation. (line 153) 19111* --help, msgconv option: msgconv Invocation. (line 130) 19112* --help, msgen option: msgen Invocation. (line 133) 19113* --help, msgexec option: msgexec Invocation. (line 77) 19114* --help, msgfilter option: msgfilter Invocation. 19115 (line 211) 19116* --help, msgfmt option: msgfmt Invocation. (line 311) 19117* --help, msggrep option: msggrep Invocation. (line 200) 19118* --help, msginit option: msginit Invocation. (line 131) 19119* --help, msgmerge option: msgmerge Invocation. (line 207) 19120* --help, msgunfmt option: msgunfmt Invocation. (line 155) 19121* --help, msguniq option: msguniq Invocation. (line 147) 19122* --help, ngettext option: ngettext Invocation. (line 36) 19123* --help, xgettext option: xgettext Invocation. (line 497) 19124* --ignore-case, msggrep option: msggrep Invocation. (line 110) 19125* --ignore-file, msgattrib option: msgattrib Invocation. 19126 (line 91) 19127* --indent, msgattrib option: msgattrib Invocation. 19128 (line 131) 19129* --indent, msgcat option: msgcat Invocation. (line 111) 19130* --indent, msgcomm option: msgcomm Invocation. (line 93) 19131* --indent, msgconv option: msgconv Invocation. (line 73) 19132* --indent, msgen option: msgen Invocation. (line 76) 19133* --indent, msgfilter option: msgfilter Invocation. 19134 (line 149) 19135* --indent, msggrep option: msggrep Invocation. (line 145) 19136* --indent, msgmerge option: msgmerge Invocation. (line 150) 19137* --indent, msgunfmt option: msgunfmt Invocation. (line 115) 19138* --indent, msguniq option: msguniq Invocation. (line 90) 19139* --indent, xgettext option: xgettext Invocation. (line 362) 19140* --input, msgexec option: msgexec Invocation. (line 50) 19141* --input, msgfilter option: msgfilter Invocation. 19142 (line 30) 19143* --input, msginit option: msginit Invocation. (line 51) 19144* --invert-match, msggrep option: msggrep Invocation. (line 114) 19145* --its, xgettext option: xgettext Invocation. (line 394) 19146* --itstool, xgettext option: xgettext Invocation. (line 398) 19147* --java, msgfmt option: msgfmt Invocation. (line 30) 19148* --java, msgunfmt option: msgunfmt Invocation. (line 16) 19149* --java2, msgfmt option: msgfmt Invocation. (line 33) 19150* --join-existing, xgettext option: xgettext Invocation. (line 85) 19151* --kde, xgettext option: xgettext Invocation. (line 325) 19152* --keep-header, msgfilter option: msgfilter Invocation. 19153 (line 152) 19154* --keyword, msgfmt option: msgfmt Invocation. (line 140) 19155* --keyword, xgettext option: xgettext Invocation. (line 174) 19156* --lang, msgcat option: msgcat Invocation. (line 93) 19157* --lang, msgen option: msgen Invocation. (line 57) 19158* --lang, msgmerge option: msgmerge Invocation. (line 130) 19159* --language, msgfmt option: msgfmt Invocation. (line 180) 19160* --language, xgettext option: xgettext Invocation. (line 54) 19161* --less-than, msgcat option: msgcat Invocation. (line 56) 19162* --less-than, msgcomm option: msgcomm Invocation. (line 51) 19163* --locale, msgfmt option: msgfmt Invocation. (line 83) 19164* --locale, msgfmt option <1>: msgfmt Invocation. (line 106) 19165* --locale, msgfmt option <2>: msgfmt Invocation. (line 122) 19166* --locale, msgfmt option <3>: msgfmt Invocation. (line 146) 19167* --locale, msgfmt option <4>: msgfmt Invocation. (line 184) 19168* --locale, msginit option: msginit Invocation. (line 84) 19169* --locale, msgunfmt option: msgunfmt Invocation. (line 45) 19170* --locale, msgunfmt option <1>: msgunfmt Invocation. (line 62) 19171* --locale, msgunfmt option <2>: msgunfmt Invocation. (line 78) 19172* --location, msggrep option: msggrep Invocation. (line 65) 19173* --more-than, msgcat option: msgcat Invocation. (line 61) 19174* --more-than, msgcomm option: msgcomm Invocation. (line 56) 19175* --msgctxt, msggrep option: msggrep Invocation. (line 74) 19176* --msgid, msggrep option: msggrep Invocation. (line 78) 19177* --msgid-bugs-address, xgettext option: xgettext Invocation. (line 463) 19178* --msgstr, msggrep option: msggrep Invocation. (line 82) 19179* --msgstr-prefix, xgettext option: xgettext Invocation. (line 486) 19180* --msgstr-suffix, xgettext option: xgettext Invocation. (line 490) 19181* --multi-domain, msgcmp option: msgcmp Invocation. (line 35) 19182* --multi-domain, msgmerge option: msgmerge Invocation. (line 96) 19183* --newline, msgfilter option: msgfilter Invocation. 19184 (line 59) 19185* --newline, msgfilter option <1>: msgexec Invocation. (line 19) 19186* --no-changelog, gettextize option: gettextize Invocation. 19187 (line 50) 19188* --no-fuzzy, msgattrib option: msgattrib Invocation. 19189 (line 45) 19190* --no-fuzzy-matching, msgcmp option: msgcmp Invocation. (line 39) 19191* --no-fuzzy-matching, msgmerge option: msgmerge Invocation. (line 107) 19192* --no-hash, msgfmt option: msgfmt Invocation. (line 303) 19193* --no-location, msgattrib option: msgattrib Invocation. 19194 (line 134) 19195* --no-location, msgcat option: msgcat Invocation. (line 114) 19196* --no-location, msgcomm option: msgcomm Invocation. (line 96) 19197* --no-location, msgconv option: msgconv Invocation. (line 76) 19198* --no-location, msgen option: msgen Invocation. (line 79) 19199* --no-location, msgfilter option: msgfilter Invocation. 19200 (line 157) 19201* --no-location, msggrep option: msggrep Invocation. (line 148) 19202* --no-location, msgmerge option: msgmerge Invocation. (line 153) 19203* --no-location, msguniq option: msguniq Invocation. (line 93) 19204* --no-location, xgettext option: xgettext Invocation. (line 365) 19205* --no-obsolete, msgattrib option: msgattrib Invocation. 19206 (line 51) 19207* --no-translator, msginit option: msginit Invocation. (line 91) 19208* --no-wrap, msgattrib option: msgattrib Invocation. 19209 (line 169) 19210* --no-wrap, msgcat option: msgcat Invocation. (line 149) 19211* --no-wrap, msgcomm option: msgcomm Invocation. (line 131) 19212* --no-wrap, msgconv option: msgconv Invocation. (line 111) 19213* --no-wrap, msgen option: msgen Invocation. (line 114) 19214* --no-wrap, msgfilter option: msgfilter Invocation. 19215 (line 192) 19216* --no-wrap, msggrep option: msggrep Invocation. (line 183) 19217* --no-wrap, msginit option: msginit Invocation. (line 121) 19218* --no-wrap, msgmerge option: msgmerge Invocation. (line 188) 19219* --no-wrap, msgunfmt option: msgunfmt Invocation. (line 140) 19220* --no-wrap, msguniq option: msguniq Invocation. (line 128) 19221* --no-wrap, xgettext option: xgettext Invocation. (line 409) 19222* --obsolete, msgattrib option: msgattrib Invocation. 19223 (line 99) 19224* --omit-header, msgcomm option: msgcomm Invocation. (line 146) 19225* --omit-header, xgettext option: xgettext Invocation. (line 424) 19226* --only-file, msgattrib option: msgattrib Invocation. 19227 (line 87) 19228* --only-fuzzy, msgattrib option: msgattrib Invocation. 19229 (line 48) 19230* --only-obsolete, msgattrib option: msgattrib Invocation. 19231 (line 54) 19232* --output, xgettext option: xgettext Invocation. (line 39) 19233* --output-dir, xgettext option: xgettext Invocation. (line 44) 19234* --output-file, msgattrib option: msgattrib Invocation. 19235 (line 30) 19236* --output-file, msgcat option: msgcat Invocation. (line 46) 19237* --output-file, msgcomm option: msgcomm Invocation. (line 41) 19238* --output-file, msgconv option: msgconv Invocation. (line 30) 19239* --output-file, msgen option: msgen Invocation. (line 36) 19240* --output-file, msgfilter option: msgfilter Invocation. 19241 (line 45) 19242* --output-file, msgfmt option: msgfmt Invocation. (line 59) 19243* --output-file, msggrep option: msggrep Invocation. (line 30) 19244* --output-file, msginit option: msginit Invocation. (line 61) 19245* --output-file, msgmerge option: msgmerge Invocation. (line 51) 19246* --output-file, msgunfmt option: msgunfmt Invocation. (line 93) 19247* --output-file, msguniq option: msguniq Invocation. (line 37) 19248* --package-name, xgettext option: xgettext Invocation. (line 456) 19249* --package-version, xgettext option: xgettext Invocation. (line 459) 19250* --po-dir, gettextize option: gettextize Invocation. 19251 (line 43) 19252* --previous, msgattrib option: msgattrib Invocation. 19253 (line 77) 19254* --previous, msgmerge option: msgmerge Invocation. (line 111) 19255* --properties-input, msgattrib option: msgattrib Invocation. 19256 (line 107) 19257* --properties-input, msgcat option: msgcat Invocation. (line 74) 19258* --properties-input, msgcmp option: msgcmp Invocation. (line 57) 19259* --properties-input, msgcomm option: msgcomm Invocation. (line 69) 19260* --properties-input, msgconv option: msgconv Invocation. (line 49) 19261* --properties-input, msgen option: msgen Invocation. (line 46) 19262* --properties-input, msgexec option: msgexec Invocation. (line 65) 19263* --properties-input, msgfilter option: msgfilter Invocation. 19264 (line 126) 19265* --properties-input, msgfmt option: msgfmt Invocation. (line 214) 19266* --properties-input, msggrep option: msggrep Invocation. (line 122) 19267* --properties-input, msginit option: msginit Invocation. (line 72) 19268* --properties-input, msgmerge option: msgmerge Invocation. (line 119) 19269* --properties-input, msguniq option: msguniq Invocation. (line 58) 19270* --properties-output, msgattrib option: msgattrib Invocation. 19271 (line 153) 19272* --properties-output, msgcat option: msgcat Invocation. (line 133) 19273* --properties-output, msgcomm option: msgcomm Invocation. (line 115) 19274* --properties-output, msgconv option: msgconv Invocation. (line 95) 19275* --properties-output, msgen option: msgen Invocation. (line 98) 19276* --properties-output, msgfilter option: msgfilter Invocation. 19277 (line 176) 19278* --properties-output, msggrep option: msggrep Invocation. (line 167) 19279* --properties-output, msginit option: msginit Invocation. (line 105) 19280* --properties-output, msgmerge option: msgmerge Invocation. (line 172) 19281* --properties-output, msgunfmt option: msgunfmt Invocation. (line 124) 19282* --properties-output, msguniq option: msguniq Invocation. (line 112) 19283* --properties-output, xgettext option: xgettext Invocation. (line 385) 19284* --qt, msgfmt option: msgfmt Invocation. (line 46) 19285* --qt, xgettext option: xgettext Invocation. (line 321) 19286* --quiet, msgfilter option: msgfilter Invocation. 19287 (line 96) 19288* --quiet, msgmerge option: msgmerge Invocation. (line 220) 19289* --regexp=, msggrep option: msggrep Invocation. (line 102) 19290* --repeated, msguniq option: msguniq Invocation. (line 47) 19291* --resource, msgfmt option: msgfmt Invocation. (line 79) 19292* --resource, msgfmt option <1>: msgfmt Invocation. (line 102) 19293* --resource, msgunfmt option: msgunfmt Invocation. (line 41) 19294* --resource, msgunfmt option <1>: msgunfmt Invocation. (line 58) 19295* --sentence-end, xgettext option: xgettext Invocation. (line 152) 19296* --set-fuzzy, msgattrib option: msgattrib Invocation. 19297 (line 65) 19298* --set-obsolete, msgattrib option: msgattrib Invocation. 19299 (line 71) 19300* --silent, msgfilter option: msgfilter Invocation. 19301 (line 96) 19302* --silent, msgmerge option: msgmerge Invocation. (line 220) 19303* --sort-by-file, msgattrib option: msgattrib Invocation. 19304 (line 181) 19305* --sort-by-file, msgcat option: msgcat Invocation. (line 161) 19306* --sort-by-file, msgcomm option: msgcomm Invocation. (line 143) 19307* --sort-by-file, msgconv option: msgconv Invocation. (line 123) 19308* --sort-by-file, msgen option: msgen Invocation. (line 126) 19309* --sort-by-file, msgfilter option: msgfilter Invocation. 19310 (line 204) 19311* --sort-by-file, msggrep option: msggrep Invocation. (line 193) 19312* --sort-by-file, msgmerge option: msgmerge Invocation. (line 200) 19313* --sort-by-file, msguniq option: msguniq Invocation. (line 140) 19314* --sort-by-file, xgettext option: xgettext Invocation. (line 421) 19315* --sort-output, msgattrib option: msgattrib Invocation. 19316 (line 176) 19317* --sort-output, msgcat option: msgcat Invocation. (line 156) 19318* --sort-output, msgcomm option: msgcomm Invocation. (line 138) 19319* --sort-output, msgconv option: msgconv Invocation. (line 118) 19320* --sort-output, msgen option: msgen Invocation. (line 121) 19321* --sort-output, msgfilter option: msgfilter Invocation. 19322 (line 199) 19323* --sort-output, msggrep option: msggrep Invocation. (line 189) 19324* --sort-output, msgmerge option: msgmerge Invocation. (line 195) 19325* --sort-output, msgunfmt option: msgunfmt Invocation. (line 147) 19326* --sort-output, msguniq option: msguniq Invocation. (line 135) 19327* --sort-output, xgettext option: xgettext Invocation. (line 416) 19328* --source, msgfmt option: msgfmt Invocation. (line 91) 19329* --statistics, msgfmt option: msgfmt Invocation. (line 318) 19330* --strict, msgattrib option: msgattrib Invocation. 19331 (line 147) 19332* --strict, msgcat option: msgcat Invocation. (line 127) 19333* --strict, msgcomm option: msgcomm Invocation. (line 109) 19334* --strict, msgconv option: msgconv Invocation. (line 89) 19335* --strict, msgen option: msgen Invocation. (line 92) 19336* --strict, msgfilter option: msgfilter Invocation. 19337 (line 170) 19338* --strict, msgfmt option: msgfmt Invocation. (line 62) 19339* --strict, msggrep option: msggrep Invocation. (line 161) 19340* --strict, msgmerge option: msgmerge Invocation. (line 166) 19341* --strict, msgunfmt option: msgunfmt Invocation. (line 118) 19342* --strict, msguniq option: msguniq Invocation. (line 106) 19343* --strict, xgettext option: xgettext Invocation. (line 380) 19344* --stringtable-input, msgattrib option: msgattrib Invocation. 19345 (line 111) 19346* --stringtable-input, msgcat option: msgcat Invocation. (line 78) 19347* --stringtable-input, msgcmp option: msgcmp Invocation. (line 61) 19348* --stringtable-input, msgcomm option: msgcomm Invocation. (line 73) 19349* --stringtable-input, msgen option: msgen Invocation. (line 50) 19350* --stringtable-input, msgexec option: msgexec Invocation. (line 69) 19351* --stringtable-input, msgfilter option: msgfilter Invocation. 19352 (line 130) 19353* --stringtable-input, msgfmt option: msgfmt Invocation. (line 218) 19354* --stringtable-input, msggrep option: msggrep Invocation. (line 126) 19355* --stringtable-input, msginit option: msginit Invocation. (line 76) 19356* --stringtable-input, msgmerge option: msgmerge Invocation. (line 123) 19357* --stringtable-input, msgonv option: msgconv Invocation. (line 53) 19358* --stringtable-input, msguniq option: msguniq Invocation. (line 62) 19359* --stringtable-output, msgattrib option: msgattrib Invocation. 19360 (line 158) 19361* --stringtable-output, msgcat option: msgcat Invocation. (line 138) 19362* --stringtable-output, msgcomm option: msgcomm Invocation. (line 120) 19363* --stringtable-output, msgconv option: msgconv Invocation. (line 100) 19364* --stringtable-output, msgen option: msgen Invocation. (line 103) 19365* --stringtable-output, msgfilter option: msgfilter Invocation. 19366 (line 181) 19367* --stringtable-output, msggrep option: msggrep Invocation. (line 172) 19368* --stringtable-output, msginit option: msginit Invocation. (line 110) 19369* --stringtable-output, msgmerge option: msgmerge Invocation. (line 177) 19370* --stringtable-output, msgunfmt option: msgunfmt Invocation. (line 129) 19371* --stringtable-output, msguniq option: msguniq Invocation. (line 117) 19372* --stringtable-output, xgettext option: xgettext Invocation. (line 390) 19373* --style, msgattrib option: msgattrib Invocation. 19374 (line 123) 19375* --style, msgcat option: msgcat Invocation. (line 103) 19376* --style, msgcat option <1>: The --style option. (line 6) 19377* --style, msgcomm option: msgcomm Invocation. (line 85) 19378* --style, msgconv option: msgconv Invocation. (line 65) 19379* --style, msgen option: msgen Invocation. (line 68) 19380* --style, msgfilter option: msgfilter Invocation. 19381 (line 142) 19382* --style, msggrep option: msggrep Invocation. (line 138) 19383* --style, msginit option: msginit Invocation. (line 100) 19384* --style, msgmerge option: msgmerge Invocation. (line 142) 19385* --style, msgunfmt option: msgunfmt Invocation. (line 107) 19386* --style, msguniq option: msguniq Invocation. (line 82) 19387* --style, xgettext option: xgettext Invocation. (line 354) 19388* --suffix, msgmerge option: msgmerge Invocation. (line 65) 19389* --symlink, gettextize option: gettextize Invocation. 19390 (line 55) 19391* --tcl, msgfmt option: msgfmt Invocation. (line 43) 19392* --tcl, msgunfmt option: msgunfmt Invocation. (line 26) 19393* --template, msgfmt option: msgfmt Invocation. (line 136) 19394* --template, msgfmt option <1>: msgfmt Invocation. (line 176) 19395* --to-code, msgcat option: msgcat Invocation. (line 86) 19396* --to-code, msgconv option: msgconv Invocation. (line 40) 19397* --to-code, msguniq option: msguniq Invocation. (line 70) 19398* --translated, msgattrib option: msgattrib Invocation. 19399 (line 39) 19400* --trigraphs, xgettext option: xgettext Invocation. (line 316) 19401* --unique, msgcat option: msgcat Invocation. (line 66) 19402* --unique, msgcomm option: msgcomm Invocation. (line 61) 19403* --unique, msguniq option: msguniq Invocation. (line 51) 19404* --untranslated, msgattrib option: msgattrib Invocation. 19405 (line 42) 19406* --update, msgmerge option: msgmerge Invocation. (line 44) 19407* --use-first, msgcat option: msgcat Invocation. (line 89) 19408* --use-first, msguniq option: msguniq Invocation. (line 73) 19409* --use-fuzzy, msgcmp option: msgcmp Invocation. (line 43) 19410* --use-fuzzy, msgfmt option: msgfmt Invocation. (line 279) 19411* --use-untranslated, msgcmp option: msgcmp Invocation. (line 49) 19412* --variables, envsubst option: envsubst Invocation. (line 15) 19413* --verbose, msgfmt option: msgfmt Invocation. (line 324) 19414* --verbose, msgmerge option: msgmerge Invocation. (line 215) 19415* --verbose, msgunfmt option: msgunfmt Invocation. (line 163) 19416* --verbose, xgettext option: xgettext Invocation. (line 505) 19417* --version, autopoint option: autopoint Invocation. 19418 (line 42) 19419* --version, envsubst option: envsubst Invocation. (line 25) 19420* --version, gettext option: gettext Invocation. (line 45) 19421* --version, gettextize option: gettextize Invocation. 19422 (line 72) 19423* --version, msgattrib option: msgattrib Invocation. 19424 (line 192) 19425* --version, msgcat option: msgcat Invocation. (line 172) 19426* --version, msgcmp option: msgcmp Invocation. (line 73) 19427* --version, msgcomm option: msgcomm Invocation. (line 157) 19428* --version, msgconv option: msgconv Invocation. (line 134) 19429* --version, msgen option: msgen Invocation. (line 137) 19430* --version, msgexec option: msgexec Invocation. (line 81) 19431* --version, msgfilter option: msgfilter Invocation. 19432 (line 215) 19433* --version, msgfmt option: msgfmt Invocation. (line 315) 19434* --version, msggrep option: msggrep Invocation. (line 204) 19435* --version, msginit option: msginit Invocation. (line 135) 19436* --version, msgmerge option: msgmerge Invocation. (line 211) 19437* --version, msgunfmt option: msgunfmt Invocation. (line 159) 19438* --version, msguniq option: msguniq Invocation. (line 151) 19439* --version, ngettext option: ngettext Invocation. (line 40) 19440* --version, xgettext option: xgettext Invocation. (line 501) 19441* --width, msgattrib option: msgattrib Invocation. 19442 (line 163) 19443* --width, msgcat option: msgcat Invocation. (line 143) 19444* --width, msgcomm option: msgcomm Invocation. (line 125) 19445* --width, msgconv option: msgconv Invocation. (line 105) 19446* --width, msgen option: msgen Invocation. (line 108) 19447* --width, msgfilter option: msgfilter Invocation. 19448 (line 186) 19449* --width, msggrep option: msggrep Invocation. (line 177) 19450* --width, msginit option: msginit Invocation. (line 115) 19451* --width, msgmerge option: msgmerge Invocation. (line 182) 19452* --width, msgunfmt option: msgunfmt Invocation. (line 134) 19453* --width, msguniq option: msguniq Invocation. (line 122) 19454* --width, xgettext option: xgettext Invocation. (line 403) 19455* --xml, msgfmt option: msgfmt Invocation. (line 52) 19456* -<, msgcat option: msgcat Invocation. (line 56) 19457* -<, msgcomm option: msgcomm Invocation. (line 51) 19458* ->, msgcat option: msgcat Invocation. (line 61) 19459* ->, msgcomm option: msgcomm Invocation. (line 56) 19460* -a, msgfmt option: msgfmt Invocation. (line 288) 19461* -a, xgettext option: xgettext Invocation. (line 165) 19462* -c, gettext option: gettext Invocation. (line 16) 19463* -c, msgfmt option: msgfmt Invocation. (line 226) 19464* -C, msgfmt option: msgfmt Invocation. (line 263) 19465* -C, msggrep option: msggrep Invocation. (line 86) 19466* -C, msgmerge option: msgmerge Invocation. (line 36) 19467* -c, ngettext option: ngettext Invocation. (line 15) 19468* -C, xgettext option: xgettext Invocation. (line 63) 19469* -c, xgettext option: xgettext Invocation. (line 94) 19470* -d, autopoint option: autopoint Invocation. 19471 (line 31) 19472* -d, gettext option: gettext Invocation. (line 21) 19473* -d, gettextize option: gettextize Invocation. 19474 (line 64) 19475* -D, msgattrib option: msgattrib Invocation. 19476 (line 19) 19477* -D, msgcat option: msgcat Invocation. (line 35) 19478* -D, msgcmp option: msgcmp Invocation. (line 27) 19479* -D, msgcomm option: msgcomm Invocation. (line 30) 19480* -D, msgconv option: msgconv Invocation. (line 19) 19481* -D, msgen option: msgen Invocation. (line 25) 19482* -D, msgexec option: msgexec Invocation. (line 54) 19483* -D, msgfilter option: msgfilter Invocation. 19484 (line 34) 19485* -D, msgfmt option: msgfmt Invocation. (line 18) 19486* -d, msgfmt option: msgfmt Invocation. (line 88) 19487* -d, msgfmt option <1>: msgfmt Invocation. (line 111) 19488* -d, msgfmt option <2>: msgfmt Invocation. (line 127) 19489* -d, msgfmt option <3>: msgfmt Invocation. (line 151) 19490* -d, msgfmt option <4>: msgfmt Invocation. (line 189) 19491* -D, msggrep option: msggrep Invocation. (line 19) 19492* -D, msgmerge option: msgmerge Invocation. (line 30) 19493* -d, msgunfmt option: msgunfmt Invocation. (line 67) 19494* -d, msgunfmt option <1>: msgunfmt Invocation. (line 83) 19495* -D, msguniq option: msguniq Invocation. (line 26) 19496* -d, msguniq option: msguniq Invocation. (line 47) 19497* -d, ngettext option: ngettext Invocation. (line 20) 19498* -D, xgettext option: xgettext Invocation. (line 24) 19499* -d, xgettext option: xgettext Invocation. (line 35) 19500* -e, gettext option: gettext Invocation. (line 25) 19501* -E, gettext option: gettext Invocation. (line 32) 19502* -e, msgfilter option: msgfilter Invocation. 19503 (line 87) 19504* -E, msggrep option: msggrep Invocation. (line 94) 19505* -e, msggrep option: msggrep Invocation. (line 102) 19506* -e, ngettext option: ngettext Invocation. (line 24) 19507* -E, ngettext option: ngettext Invocation. (line 31) 19508* -f, autopoint option: autopoint Invocation. 19509 (line 27) 19510* -f, gettextize option: gettextize Invocation. 19511 (line 40) 19512* -F, msgattrib option: msgattrib Invocation. 19513 (line 181) 19514* -f, msgcat option: msgcat Invocation. (line 30) 19515* -F, msgcat option: msgcat Invocation. (line 161) 19516* -f, msgcomm option: msgcomm Invocation. (line 25) 19517* -F, msgcomm option: msgcomm Invocation. (line 143) 19518* -F, msgconv option: msgconv Invocation. (line 123) 19519* -F, msgen option: msgen Invocation. (line 126) 19520* -f, msgfilter option: msgfilter Invocation. 19521 (line 91) 19522* -F, msgfilter option: msgfilter Invocation. 19523 (line 204) 19524* -f, msgfmt option: msgfmt Invocation. (line 279) 19525* -F, msggrep option: msggrep Invocation. (line 98) 19526* -f, msggrep option: msggrep Invocation. (line 106) 19527* -F, msgmerge option: msgmerge Invocation. (line 200) 19528* -F, msguniq option: msguniq Invocation. (line 140) 19529* -f, xgettext option: xgettext Invocation. (line 19) 19530* -F, xgettext option: xgettext Invocation. (line 421) 19531* -h, envsubst option: envsubst Invocation. (line 21) 19532* -h, gettext option: gettext Invocation. (line 37) 19533* -h, msgattrib option: msgattrib Invocation. 19534 (line 188) 19535* -h, msgcat option: msgcat Invocation. (line 168) 19536* -h, msgcmp option: msgcmp Invocation. (line 69) 19537* -h, msgcomm option: msgcomm Invocation. (line 153) 19538* -h, msgconv option: msgconv Invocation. (line 130) 19539* -h, msgen option: msgen Invocation. (line 133) 19540* -h, msgexec option: msgexec Invocation. (line 77) 19541* -h, msgfilter option: msgfilter Invocation. 19542 (line 211) 19543* -h, msgfmt option: msgfmt Invocation. (line 311) 19544* -h, msggrep option: msggrep Invocation. (line 200) 19545* -h, msginit option: msginit Invocation. (line 131) 19546* -h, msgmerge option: msgmerge Invocation. (line 207) 19547* -h, msgunfmt option: msgunfmt Invocation. (line 155) 19548* -h, msguniq option: msguniq Invocation. (line 147) 19549* -h, ngettext option: ngettext Invocation. (line 36) 19550* -h, xgettext option: xgettext Invocation. (line 497) 19551* -i, msgattrib option: msgattrib Invocation. 19552 (line 131) 19553* -i, msgcat option: msgcat Invocation. (line 111) 19554* -i, msgcomm option: msgcomm Invocation. (line 93) 19555* -i, msgconv option: msgconv Invocation. (line 73) 19556* -i, msgen option: msgen Invocation. (line 76) 19557* -i, msgexec option: msgexec Invocation. (line 50) 19558* -i, msgfilter option: msgfilter Invocation. 19559 (line 30) 19560* -i, msggrep option: msggrep Invocation. (line 110) 19561* -i, msginit option: msginit Invocation. (line 51) 19562* -i, msgmerge option: msgmerge Invocation. (line 150) 19563* -i, msgunfmt option: msgunfmt Invocation. (line 115) 19564* -i, msguniq option: msguniq Invocation. (line 90) 19565* -i, xgettext option: xgettext Invocation. (line 362) 19566* -j, msgfmt option: msgfmt Invocation. (line 30) 19567* -J, msggrep option: msggrep Invocation. (line 74) 19568* -j, msgunfmt option: msgunfmt Invocation. (line 16) 19569* -j, xgettext option: xgettext Invocation. (line 85) 19570* -k, msgfmt option: msgfmt Invocation. (line 140) 19571* -K, msggrep option: msggrep Invocation. (line 78) 19572* -k, xgettext option: xgettext Invocation. (line 174) 19573* -l, msgfmt option: msgfmt Invocation. (line 83) 19574* -l, msgfmt option <1>: msgfmt Invocation. (line 106) 19575* -l, msgfmt option <2>: msgfmt Invocation. (line 122) 19576* -l, msgfmt option <3>: msgfmt Invocation. (line 146) 19577* -L, msgfmt option: msgfmt Invocation. (line 180) 19578* -l, msgfmt option <4>: msgfmt Invocation. (line 184) 19579* -l, msginit option: msginit Invocation. (line 84) 19580* -l, msgunfmt option: msgunfmt Invocation. (line 45) 19581* -l, msgunfmt option <1>: msgunfmt Invocation. (line 62) 19582* -l, msgunfmt option <2>: msgunfmt Invocation. (line 78) 19583* -L, xgettext option: xgettext Invocation. (line 54) 19584* -m, msgcmp option: msgcmp Invocation. (line 35) 19585* -M, msggrep option: msggrep Invocation. (line 70) 19586* -m, msgmerge option: msgmerge Invocation. (line 96) 19587* -m, xgettext option: xgettext Invocation. (line 486) 19588* -M, xgettext option: xgettext Invocation. (line 490) 19589* -n, gettext option: gettext Invocation. (line 40) 19590* -n, msgattrib option: msgattrib Invocation. 19591 (line 138) 19592* -n, msgcat option: msgcat Invocation. (line 118) 19593* -N, msgcmp option: msgcmp Invocation. (line 39) 19594* -n, msgcomm option: msgcomm Invocation. (line 100) 19595* -n, msgfilter option: msgfilter Invocation. 19596 (line 96) 19597* -N, msggrep option: msggrep Invocation. (line 65) 19598* -N, msgmerge option: msgmerge Invocation. (line 107) 19599* -n, msguniq option: msguniq Invocation. (line 97) 19600* -n, xgettext option: xgettext Invocation. (line 371) 19601* -o, msgattrib option: msgattrib Invocation. 19602 (line 30) 19603* -o, msgcat option: msgcat Invocation. (line 46) 19604* -o, msgcomm option: msgcomm Invocation. (line 41) 19605* -o, msgconv option: msgconv Invocation. (line 30) 19606* -o, msgen option: msgen Invocation. (line 36) 19607* -o, msgfilter option: msgfilter Invocation. 19608 (line 45) 19609* -o, msgfmt option: msgfmt Invocation. (line 59) 19610* -o, msggrep option: msggrep Invocation. (line 30) 19611* -o, msginit option: msginit Invocation. (line 61) 19612* -o, msgmerge option: msgmerge Invocation. (line 51) 19613* -o, msgunfmt option: msgunfmt Invocation. (line 93) 19614* -o, msguniq option: msguniq Invocation. (line 37) 19615* -o, xgettext option: xgettext Invocation. (line 39) 19616* -P, msgattrib option: msgattrib Invocation. 19617 (line 107) 19618* -p, msgattrib option: msgattrib Invocation. 19619 (line 153) 19620* -P, msgcat option: msgcat Invocation. (line 74) 19621* -p, msgcat option: msgcat Invocation. (line 133) 19622* -P, msgcmp option: msgcmp Invocation. (line 57) 19623* -P, msgcomm option: msgcomm Invocation. (line 69) 19624* -p, msgcomm option: msgcomm Invocation. (line 115) 19625* -P, msgconv option: msgconv Invocation. (line 49) 19626* -p, msgconv option: msgconv Invocation. (line 95) 19627* -P, msgen option: msgen Invocation. (line 46) 19628* -p, msgen option: msgen Invocation. (line 98) 19629* -P, msgexec option: msgexec Invocation. (line 65) 19630* -P, msgfilter option: msgfilter Invocation. 19631 (line 126) 19632* -p, msgfilter option: msgfilter Invocation. 19633 (line 176) 19634* -P, msgfmt option: msgfmt Invocation. (line 214) 19635* -P, msggrep option: msggrep Invocation. (line 122) 19636* -p, msggrep option: msggrep Invocation. (line 167) 19637* -P, msginit option: msginit Invocation. (line 72) 19638* -p, msginit option: msginit Invocation. (line 105) 19639* -P, msgmerge option: msgmerge Invocation. (line 119) 19640* -p, msgmerge option: msgmerge Invocation. (line 172) 19641* -p, msgunfmt option: msgunfmt Invocation. (line 124) 19642* -P, msguniq option: msguniq Invocation. (line 58) 19643* -p, msguniq option: msguniq Invocation. (line 112) 19644* -p, xgettext option: xgettext Invocation. (line 44) 19645* -q, msgmerge option: msgmerge Invocation. (line 220) 19646* -r, msgfmt option: msgfmt Invocation. (line 79) 19647* -r, msgfmt option <1>: msgfmt Invocation. (line 102) 19648* -r, msgunfmt option: msgunfmt Invocation. (line 41) 19649* -r, msgunfmt option <1>: msgunfmt Invocation. (line 58) 19650* -s, msgattrib option: msgattrib Invocation. 19651 (line 176) 19652* -s, msgcat option: msgcat Invocation. (line 156) 19653* -s, msgcomm option: msgcomm Invocation. (line 138) 19654* -s, msgconv option: msgconv Invocation. (line 118) 19655* -s, msgen option: msgen Invocation. (line 121) 19656* -s, msgfilter option: msgfilter Invocation. 19657 (line 199) 19658* -s, msgmerge option: msgmerge Invocation. (line 195) 19659* -s, msgunfmt option: msgunfmt Invocation. (line 147) 19660* -s, msguniq option: msguniq Invocation. (line 135) 19661* -s, xgettext option: xgettext Invocation. (line 416) 19662* -t, msgcat option: msgcat Invocation. (line 86) 19663* -t, msgconv option: msgconv Invocation. (line 40) 19664* -T, msggrep option: msggrep Invocation. (line 82) 19665* -t, msguniq option: msguniq Invocation. (line 70) 19666* -T, xgettext option: xgettext Invocation. (line 316) 19667* -u, msgcat option: msgcat Invocation. (line 66) 19668* -u, msgcomm option: msgcomm Invocation. (line 61) 19669* -U, msgmerge option: msgmerge Invocation. (line 44) 19670* -u, msguniq option: msguniq Invocation. (line 51) 19671* -v, envsubst option: envsubst Invocation. (line 15) 19672* -V, envsubst option: envsubst Invocation. (line 25) 19673* -V, gettext option: gettext Invocation. (line 45) 19674* -V, msgattrib option: msgattrib Invocation. 19675 (line 192) 19676* -V, msgcat option: msgcat Invocation. (line 172) 19677* -V, msgcmp option: msgcmp Invocation. (line 73) 19678* -V, msgcomm option: msgcomm Invocation. (line 157) 19679* -V, msgconv option: msgconv Invocation. (line 134) 19680* -V, msgen option: msgen Invocation. (line 137) 19681* -V, msgexec option: msgexec Invocation. (line 81) 19682* -V, msgfilter option: msgfilter Invocation. 19683 (line 215) 19684* -V, msgfmt option: msgfmt Invocation. (line 315) 19685* -v, msgfmt option: msgfmt Invocation. (line 324) 19686* -v, msggrep option: msggrep Invocation. (line 114) 19687* -V, msggrep option: msggrep Invocation. (line 204) 19688* -V, msginit option: msginit Invocation. (line 135) 19689* -V, msgmerge option: msgmerge Invocation. (line 211) 19690* -v, msgmerge option: msgmerge Invocation. (line 215) 19691* -V, msgunfmt option: msgunfmt Invocation. (line 159) 19692* -v, msgunfmt option: msgunfmt Invocation. (line 163) 19693* -V, msguniq option: msguniq Invocation. (line 151) 19694* -V, ngettext option: ngettext Invocation. (line 40) 19695* -V, xgettext option: xgettext Invocation. (line 501) 19696* -v, xgettext option: xgettext Invocation. (line 505) 19697* -w, msgattrib option: msgattrib Invocation. 19698 (line 163) 19699* -w, msgcat option: msgcat Invocation. (line 143) 19700* -w, msgcomm option: msgcomm Invocation. (line 125) 19701* -w, msgconv option: msgconv Invocation. (line 105) 19702* -w, msgen option: msgen Invocation. (line 108) 19703* -w, msgfilter option: msgfilter Invocation. 19704 (line 186) 19705* -w, msggrep option: msggrep Invocation. (line 177) 19706* -w, msginit option: msginit Invocation. (line 115) 19707* -w, msgmerge option: msgmerge Invocation. (line 182) 19708* -w, msgunfmt option: msgunfmt Invocation. (line 134) 19709* -w, msguniq option: msguniq Invocation. (line 122) 19710* -w, xgettext option: xgettext Invocation. (line 403) 19711* -X, msggrep option: msggrep Invocation. (line 90) 19712* -x, xgettext option: xgettext Invocation. (line 89) 19713 19714 19715File: gettext.info, Node: Variable Index, Next: PO Mode Index, Prev: Option Index, Up: Top 19716 19717Variable Index 19718************** 19719 19720[index] 19721* Menu: 19722 19723* GETTEXT_LOG_UNTRANSLATED, environment variable: Prioritizing messages. 19724 (line 22) 19725* LANG, environment variable: Locale Environment Variables. 19726 (line 15) 19727* LANG, environment variable <1>: gettext grok. (line 30) 19728* LANGUAGE, environment variable: Locale Environment Variables. 19729 (line 11) 19730* LANGUAGE, environment variable <1>: gettext grok. (line 28) 19731* LANGUAGE, environment variable <2>: po/Rules-*. (line 11) 19732* LC_ALL, environment variable: Locale Environment Variables. 19733 (line 11) 19734* LC_ALL, environment variable <1>: gettext grok. (line 28) 19735* LC_COLLATE, environment variable: Locale Environment Variables. 19736 (line 12) 19737* LC_COLLATE, environment variable <1>: gettext grok. (line 29) 19738* LC_CTYPE, environment variable: Locale Environment Variables. 19739 (line 12) 19740* LC_CTYPE, environment variable <1>: gettext grok. (line 29) 19741* LC_MESSAGES, environment variable: Locale Environment Variables. 19742 (line 12) 19743* LC_MESSAGES, environment variable <1>: gettext grok. (line 29) 19744* LC_MONETARY, environment variable: Locale Environment Variables. 19745 (line 12) 19746* LC_MONETARY, environment variable <1>: gettext grok. (line 29) 19747* LC_NUMERIC, environment variable: Locale Environment Variables. 19748 (line 12) 19749* LC_NUMERIC, environment variable <1>: gettext grok. (line 29) 19750* LC_TIME, environment variable: Locale Environment Variables. 19751 (line 12) 19752* LC_TIME, environment variable <1>: gettext grok. (line 29) 19753* LINGUAS, environment variable: Installers. (line 17) 19754* MSGEXEC_LOCATION, environment variable: msgexec Invocation. (line 21) 19755* MSGEXEC_MSGCTXT, environment variable: msgexec Invocation. (line 21) 19756* MSGEXEC_MSGID, environment variable: msgexec Invocation. (line 21) 19757* MSGEXEC_MSGID_PLURAL, environment variable: msgexec Invocation. 19758 (line 21) 19759* MSGEXEC_PLURAL_FORM, environment variable: msgexec Invocation. 19760 (line 21) 19761* MSGEXEC_PREV_MSGCTXT, environment variable: msgexec Invocation. 19762 (line 21) 19763* MSGEXEC_PREV_MSGID, environment variable: msgexec Invocation. 19764 (line 21) 19765* MSGEXEC_PREV_MSGID_PLURAL, environment variable: msgexec Invocation. 19766 (line 21) 19767* MSGFILTER_LOCATION, environment variable: msgfilter Invocation. 19768 (line 11) 19769* MSGFILTER_MSGCTXT, environment variable: msgfilter Invocation. 19770 (line 11) 19771* MSGFILTER_MSGID, environment variable: msgfilter Invocation. (line 11) 19772* MSGFILTER_MSGID_PLURAL, environment variable: msgfilter Invocation. 19773 (line 11) 19774* MSGFILTER_PLURAL_FORM, environment variable: msgfilter Invocation. 19775 (line 11) 19776* MSGFILTER_PREV_MSGCTXT, environment variable: msgfilter Invocation. 19777 (line 11) 19778* MSGFILTER_PREV_MSGID, environment variable: msgfilter Invocation. 19779 (line 11) 19780* MSGFILTER_PREV_MSGID_PLURAL, environment variable: msgfilter Invocation. 19781 (line 11) 19782* OUTPUT_CHARSET, environment variable: Working in a Windows console. 19783 (line 6) 19784* PO_STYLE, environment variable: The --style option. (line 10) 19785* TERM, environment variable: The TERM variable. (line 6) 19786* TEXTDOMAIN, environment variable: sh. (line 27) 19787* TEXTDOMAINDIR, environment variable: sh. (line 30) 19788 19789 19790File: gettext.info, Node: PO Mode Index, Next: Autoconf Macro Index, Prev: Variable Index, Up: Top 19791 19792PO Mode Index 19793************* 19794 19795[index] 19796* Menu: 19797 19798* #, PO Mode command: Modifying Comments. (line 24) 19799* #, PO Mode command <1>: Modifying Comments. (line 45) 19800* ,, PO Mode command: Marking. (line 43) 19801* ., PO Mode command: Entry Positioning. (line 20) 19802* ., PO Mode command <1>: Entry Positioning. (line 45) 19803* .emacs customizations: Installation. (line 13) 19804* 0, PO Mode command: Main PO Commands. (line 40) 19805* 0, PO Mode command <1>: Main PO Commands. (line 72) 19806* <, PO Mode command: Entry Positioning. (line 29) 19807* <, PO Mode command <1>: Entry Positioning. (line 73) 19808* =, PO Mode command: Main PO Commands. (line 47) 19809* =, PO Mode command <1>: Main PO Commands. (line 87) 19810* >, PO Mode command: Entry Positioning. (line 32) 19811* >, PO Mode command <1>: Entry Positioning. (line 73) 19812* ?, PO Mode command: Main PO Commands. (line 44) 19813* ?, PO Mode command <1>: Main PO Commands. (line 83) 19814* _, PO Mode command: Main PO Commands. (line 30) 19815* _, PO Mode command <1>: Main PO Commands. (line 52) 19816* a, PO Mode command: Auxiliary. (line 21) 19817* A, PO Mode command: Auxiliary. (line 28) 19818* A, PO Mode command <1>: Auxiliary. (line 35) 19819* a, PO Mode command <1>: Auxiliary. (line 39) 19820* auxiliary PO file: Auxiliary. (line 13) 19821* C-c C-a, PO Mode command: Subedit. (line 17) 19822* C-c C-a, PO Mode command <1>: Subedit. (line 36) 19823* C-c C-a, PO Mode command <2>: Auxiliary. (line 25) 19824* C-c C-a, PO Mode command <3>: Auxiliary. (line 48) 19825* C-c C-c, PO Mode command: Subedit. (line 11) 19826* C-c C-c, PO Mode command <1>: Subedit. (line 19) 19827* C-c C-k, PO Mode command: Subedit. (line 14) 19828* C-c C-k, PO Mode command <1>: Subedit. (line 27) 19829* C-j, PO Mode command: Modifying Translations. 19830 (line 26) 19831* C-j, PO Mode command <1>: Modifying Translations. 19832 (line 52) 19833* commands: Main PO Commands. (line 6) 19834* comment out PO file entry: Obsolete Entries. (line 46) 19835* consulting program sources: C Sources Context. (line 6) 19836* consulting translations to other languages: Auxiliary. (line 6) 19837* current entry of a PO file: Entry Positioning. (line 6) 19838* cut and paste for translated strings: Modifying Translations. 19839 (line 74) 19840* DEL, PO Mode command: Fuzzy Entries. (line 58) 19841* DEL, PO Mode command <1>: Obsolete Entries. (line 32) 19842* DEL, PO Mode command <2>: Obsolete Entries. (line 46) 19843* editing comments: Modifying Comments. (line 6) 19844* editing multiple entries: Subedit. (line 64) 19845* editing translations: Modifying Translations. 19846 (line 6) 19847* etags, using for marking strings: Marking. (line 17) 19848* exiting PO subedit: Subedit. (line 19) 19849* f, PO Mode command: Fuzzy Entries. (line 29) 19850* F, PO Mode command: Fuzzy Entries. (line 32) 19851* f, PO Mode command <1>: Fuzzy Entries. (line 37) 19852* F, PO Mode command <1>: Fuzzy Entries. (line 37) 19853* find source fragment for a PO file entry: C Sources Context. 19854 (line 33) 19855* h, PO Mode command: Main PO Commands. (line 44) 19856* h, PO Mode command <1>: Main PO Commands. (line 83) 19857* installing PO mode: Installation. (line 13) 19858* k, PO Mode command: Untranslated Entries. 19859 (line 33) 19860* k, PO Mode command <1>: Untranslated Entries. 19861 (line 40) 19862* k, PO Mode command <2>: Modifying Translations. 19863 (line 30) 19864* k, PO Mode command <3>: Modifying Translations. 19865 (line 74) 19866* K, PO Mode command: Modifying Comments. (line 27) 19867* K, PO Mode command <1>: Modifying Comments. (line 60) 19868* LFD, PO Mode command: Modifying Translations. 19869 (line 26) 19870* LFD, PO Mode command <1>: Modifying Translations. 19871 (line 52) 19872* looking at the source to aid translation: C Sources Context. 19873 (line 6) 19874* m, PO Mode command: Entry Positioning. (line 35) 19875* m, PO Mode command <1>: Entry Positioning. (line 91) 19876* M-,, PO Mode command: Marking. (line 47) 19877* M-., PO Mode command: Marking. (line 50) 19878* M-A, PO Mode command: Auxiliary. (line 32) 19879* M-A, PO Mode command <1>: Auxiliary. (line 35) 19880* M-s, PO Mode command: C Sources Context. (line 41) 19881* M-S, PO Mode command: C Sources Context. (line 49) 19882* M-s, PO Mode command <1>: C Sources Context. (line 52) 19883* M-S, PO Mode command <1>: C Sources Context. (line 88) 19884* marking strings for translation: Marking. (line 6) 19885* moving by fuzzy entries: Fuzzy Entries. (line 23) 19886* moving by obsolete entries: Obsolete Entries. (line 22) 19887* moving by translated entries: Translated Entries. (line 12) 19888* moving by untranslated entries: Untranslated Entries. 19889 (line 19) 19890* moving through a PO file: Entry Positioning. (line 14) 19891* n, PO Mode command: Entry Positioning. (line 23) 19892* n, PO Mode command <1>: Entry Positioning. (line 68) 19893* next-error, stepping through PO file validation results: Main PO Commands. 19894 (line 99) 19895* normalize, PO Mode command: Auxiliary. (line 63) 19896* o, PO Mode command: Obsolete Entries. (line 26) 19897* O, PO Mode command: Obsolete Entries. (line 29) 19898* o, PO Mode command <1>: Obsolete Entries. (line 35) 19899* O, PO Mode command <1>: Obsolete Entries. (line 35) 19900* obsolete active entry: Obsolete Entries. (line 46) 19901* p, PO Mode command: Entry Positioning. (line 26) 19902* p, PO Mode command <1>: Entry Positioning. (line 68) 19903* pending subedits: Subedit. (line 75) 19904* po-auto-edit-with-msgid, PO Mode variable: Modifying Translations. 19905 (line 57) 19906* po-auto-fuzzy-on-edit, PO Mode variable: Translated Entries. 19907 (line 27) 19908* po-auto-select-on-unfuzzy, PO Mode variable: Fuzzy Entries. (line 42) 19909* po-confirm-and-quit, PO Mode command: Main PO Commands. (line 61) 19910* po-consider-as-auxiliary, PO Mode command: Auxiliary. (line 35) 19911* po-consider-source-path, PO Mode command: C Sources Context. 19912 (line 88) 19913* po-current-entry, PO Mode command: Entry Positioning. (line 45) 19914* po-cycle-auxiliary, PO Mode command: Auxiliary. (line 39) 19915* po-cycle-source-reference, PO Mode command: C Sources Context. 19916 (line 52) 19917* po-edit-comment, PO Mode command: Modifying Comments. (line 45) 19918* po-edit-msgstr, PO Mode command: Modifying Translations. 19919 (line 41) 19920* po-exchange-location, PO Mode command: Entry Positioning. (line 105) 19921* po-fade-out-entry, PO Mode command: Fuzzy Entries. (line 58) 19922* po-fade-out-entry, PO Mode command <1>: Obsolete Entries. (line 46) 19923* po-first-entry, PO Mode command: Entry Positioning. (line 73) 19924* po-help, PO Mode command: Main PO Commands. (line 83) 19925* po-ignore-as-auxiliary, PO Mode command: Auxiliary. (line 35) 19926* po-ignore-source-path, PO Mode command: C Sources Context. (line 88) 19927* po-kill-comment, PO Mode command: Modifying Comments. (line 60) 19928* po-kill-msgstr, PO Mode command: Untranslated Entries. 19929 (line 40) 19930* po-kill-msgstr, PO Mode command <1>: Modifying Translations. 19931 (line 74) 19932* po-kill-ring-save-comment, PO Mode command: Modifying Comments. 19933 (line 60) 19934* po-kill-ring-save-msgstr, PO Mode command: Modifying Translations. 19935 (line 74) 19936* po-last-entry, PO Mode command: Entry Positioning. (line 73) 19937* po-mark-translatable, PO Mode command: Marking. (line 98) 19938* po-msgid-to-msgstr, PO Mode command: Modifying Translations. 19939 (line 52) 19940* po-next-entry, PO Mode command: Entry Positioning. (line 68) 19941* po-next-fuzzy-entry, PO Mode command: Fuzzy Entries. (line 37) 19942* po-next-obsolete-entry, PO Mode command: Obsolete Entries. (line 35) 19943* po-next-translated-entry, PO Mode command: Translated Entries. 19944 (line 22) 19945* po-next-untranslated-entry, PO Mode command: Untranslated Entries. 19946 (line 35) 19947* po-normalize, PO Mode command: Normalizing. (line 31) 19948* po-other-window, PO Mode command: Main PO Commands. (line 72) 19949* po-pop-location, PO Mode command: Entry Positioning. (line 91) 19950* po-previous-entry, PO Mode command: Entry Positioning. (line 68) 19951* po-previous-fuzzy-entry, PO Mode command: Fuzzy Entries. (line 37) 19952* po-previous-obsolete-entry, PO Mode command: Obsolete Entries. 19953 (line 35) 19954* po-previous-translated-entry, PO Mode command: Translated Entries. 19955 (line 22) 19956* po-previous-untransted-entry, PO Mode command: Untranslated Entries. 19957 (line 35) 19958* po-push-location, PO Mode command: Entry Positioning. (line 91) 19959* po-quit, PO Mode command: Main PO Commands. (line 61) 19960* po-select-auxiliary, PO Mode command: Auxiliary. (line 48) 19961* po-select-mark-and-mark, PO Mode command: Marking. (line 98) 19962* po-select-source-reference, PO Mode command: C Sources Context. 19963 (line 52) 19964* po-statistics, PO Mode command: Main PO Commands. (line 87) 19965* po-subedit-abort, PO Mode command: Subedit. (line 27) 19966* po-subedit-cycle-auxiliary, PO Mode command: Subedit. (line 36) 19967* po-subedit-exit, PO Mode command: Subedit. (line 19) 19968* po-subedit-mode-hook, PO Mode variable: Modifying Comments. (line 57) 19969* po-tags-search, PO Mode command: Marking. (line 54) 19970* po-undo, PO Mode command: Main PO Commands. (line 52) 19971* po-unfuzzy, PO Mode command: Fuzzy Entries. (line 42) 19972* po-validate, PO Mode command: Main PO Commands. (line 92) 19973* po-yank-comment, PO Mode command: Modifying Comments. (line 60) 19974* po-yank-msgstr, PO Mode command: Modifying Translations. 19975 (line 97) 19976* Q, PO Mode command: Main PO Commands. (line 33) 19977* q, PO Mode command: Main PO Commands. (line 36) 19978* Q, PO Mode command <1>: Main PO Commands. (line 61) 19979* q, PO Mode command <1>: Main PO Commands. (line 61) 19980* r, PO Mode command: Entry Positioning. (line 39) 19981* r, PO Mode command <1>: Entry Positioning. (line 91) 19982* RET, PO Mode command: Modifying Translations. 19983 (line 22) 19984* RET, PO Mode command <1>: Modifying Translations. 19985 (line 41) 19986* s, PO Mode command: C Sources Context. (line 37) 19987* S, PO Mode command: C Sources Context. (line 45) 19988* s, PO Mode command <1>: C Sources Context. (line 52) 19989* S, PO Mode command <1>: C Sources Context. (line 88) 19990* starting a string translation: Modifying Translations. 19991 (line 63) 19992* string normalization in entries: Normalizing. (line 30) 19993* subedit minor mode: Subedit. (line 6) 19994* t, PO Mode command: Translated Entries. (line 16) 19995* T, PO Mode command: Translated Entries. (line 19) 19996* t, PO Mode command <1>: Translated Entries. (line 22) 19997* T, PO Mode command <1>: Translated Entries. (line 22) 19998* TAB, PO Mode command: Fuzzy Entries. (line 35) 19999* TAB, PO Mode command <1>: Fuzzy Entries. (line 42) 20000* TAGS, and marking translatable strings: Marking. (line 30) 20001* u, PO Mode command: Untranslated Entries. 20002 (line 26) 20003* U, PO Mode command: Untranslated Entries. 20004 (line 29) 20005* u, PO Mode command <1>: Untranslated Entries. 20006 (line 35) 20007* U, PO Mode command <1>: Untranslated Entries. 20008 (line 35) 20009* use the source, Luke: C Sources Context. (line 6) 20010* using obsolete translations to make new entries: Modifying Translations. 20011 (line 123) 20012* using translation compendia: Compendium. (line 6) 20013* V, PO Mode command: Main PO Commands. (line 50) 20014* V, PO Mode command <1>: Main PO Commands. (line 92) 20015* w, PO Mode command: Modifying Translations. 20016 (line 34) 20017* w, PO Mode command <1>: Modifying Translations. 20018 (line 74) 20019* W, PO Mode command: Modifying Comments. (line 31) 20020* W, PO Mode command <1>: Modifying Comments. (line 60) 20021* x, PO Mode command: Entry Positioning. (line 42) 20022* x, PO Mode command <1>: Entry Positioning. (line 105) 20023* y, PO Mode command: Modifying Translations. 20024 (line 38) 20025* y, PO Mode command <1>: Modifying Translations. 20026 (line 97) 20027* Y, PO Mode command: Modifying Comments. (line 35) 20028* Y, PO Mode command <1>: Modifying Comments. (line 60) 20029 20030 20031File: gettext.info, Node: Autoconf Macro Index, Next: Index, Prev: PO Mode Index, Up: Top 20032 20033Autoconf Macro Index 20034******************** 20035 20036[index] 20037* Menu: 20038 20039* AM_GNU_GETTEXT: AM_GNU_GETTEXT. (line 6) 20040* AM_GNU_GETTEXT_NEED: AM_GNU_GETTEXT_NEED. (line 6) 20041* AM_GNU_GETTEXT_VERSION: AM_GNU_GETTEXT_VERSION. 20042 (line 6) 20043* AM_ICONV: AM_ICONV. (line 6) 20044* AM_PO_SUBDIRS: AM_PO_SUBDIRS. (line 6) 20045* AM_XGETTEXT_OPTION: AM_XGETTEXT_OPTION. (line 6) 20046 20047 20048File: gettext.info, Node: Index, Prev: Autoconf Macro Index, Up: Top 20049 20050General Index 20051************* 20052 20053[index] 20054* Menu: 20055 20056* _, a macro to mark strings for translation: Mark Keywords. (line 45) 20057* _nl_msg_cat_cntr: gettext grok. (line 59) 20058* ABOUT-NLS file: Installing Localizations. 20059 (line 13) 20060* ABOUT-NLS file <1>: The original ABOUT-NLS. 20061 (line 6) 20062* accumulating translations: Creating Compendia. (line 14) 20063* aclocal.m4 file: aclocal. (line 6) 20064* adding keywords, xgettext: xgettext Invocation. (line 178) 20065* ambiguities: Preparing Strings. (line 46) 20066* ANSI encoding: Working in a Windows console. 20067 (line 6) 20068* apply a filter to translations: msgfilter Invocation. 20069 (line 8) 20070* apply command to all translations in a catalog: msgexec Invocation. 20071 (line 8) 20072* Arabic digits: c-format. (line 28) 20073* attribute manipulation: msgattrib Invocation. 20074 (line 8) 20075* attribute, fuzzy: Fuzzy Entries. (line 6) 20076* attributes of a PO file entry: Fuzzy Entries. (line 6) 20077* attributes, manipulating: Manipulating. (line 56) 20078* autoconf macros for gettext: autoconf macros. (line 6) 20079* autopoint program, usage: autopoint Invocation. 20080 (line 6) 20081* auxiliary PO file: Auxiliary. (line 13) 20082* available translations: Installing Localizations. 20083 (line 6) 20084* awk: gawk. (line 6) 20085* awk-format flag: PO Files. (line 160) 20086* backup old file, and msgmerge program: msgmerge Invocation. (line 62) 20087* bash: bash. (line 6) 20088* bibliography: References. (line 6) 20089* big picture: Overview. (line 6) 20090* bind_textdomain_codeset: Charset conversion. (line 26) 20091* Boost format strings: xgettext Invocation. (line 329) 20092* boost-format flag: PO Files. (line 188) 20093* bug report address: Introduction. (line 24) 20094* C and C-like languages: C. (line 6) 20095* C trigraphs: xgettext Invocation. (line 316) 20096* C#: C#. (line 6) 20097* C# mode, and msgfmt program: msgfmt Invocation. (line 36) 20098* C# mode, and msgunfmt program: msgunfmt Invocation. (line 19) 20099* C# resources mode, and msgfmt program: msgfmt Invocation. (line 40) 20100* C# resources mode, and msgunfmt program: msgunfmt Invocation. 20101 (line 23) 20102* C#, string concatenation: Preparing Strings. (line 182) 20103* c-format flag: PO Files. (line 88) 20104* c-format, and xgettext: c-format Flag. (line 47) 20105* catalog encoding and msgexec output: msgexec Invocation. (line 35) 20106* catclose, a catgets function: Interface to catgets. 20107 (line 44) 20108* catgets, a catgets function: Interface to catgets. 20109 (line 25) 20110* catgets, X/Open specification: catgets. (line 6) 20111* catopen, a catgets function: Interface to catgets. 20112 (line 13) 20113* character encoding: Aspects. (line 67) 20114* charset conversion at runtime: Charset conversion. (line 6) 20115* charset of PO files: Header Entry. (line 101) 20116* check format strings: msgfmt Invocation. (line 230) 20117* checking of translations: Manipulating. (line 41) 20118* clisp: Common Lisp. (line 6) 20119* clisp C sources: clisp C. (line 6) 20120* codeset: Aspects. (line 67) 20121* comments in PO files: PO Files. (line 329) 20122* comments, automatic: PO Files. (line 36) 20123* comments, extracted: PO Files. (line 36) 20124* comments, translator: PO Files. (line 36) 20125* Common Lisp: Common Lisp. (line 6) 20126* compare PO files: msgcmp Invocation. (line 8) 20127* comparison of interfaces: Comparison. (line 6) 20128* compatibility with X/Open msgfmt: msgfmt Invocation. (line 263) 20129* compendium: Compendium. (line 6) 20130* compendium, creating: Creating Compendia. (line 6) 20131* concatenate PO files: msgcat Invocation. (line 8) 20132* concatenating PO files into a compendium: Creating Compendia. 20133 (line 14) 20134* concatenation of strings: Preparing Strings. (line 131) 20135* config.h.in file: config.h.in. (line 6) 20136* context: Contexts. (line 6) 20137* context, argument specification in xgettext: xgettext Invocation. 20138 (line 178) 20139* context, in MO files: MO Files. (line 71) 20140* context, in PO files: PO Files. (line 220) 20141* control characters: Preparing Strings. (line 230) 20142* convert binary message catalog into PO file: msgunfmt Invocation. 20143 (line 8) 20144* convert translations to a different encoding: msgconv Invocation. 20145 (line 8) 20146* converting a package to use gettext: Prerequisites. (line 6) 20147* country codes: Country Codes. (line 6) 20148* create new PO file: msginit Invocation. (line 8) 20149* creating a new PO file: Creating. (line 6) 20150* creating compendia: Creating Compendia. (line 6) 20151* csharp-format flag: PO Files. (line 128) 20152* currency symbols: Aspects. (line 80) 20153* date format: Aspects. (line 86) 20154* dcngettext: Plural forms. (line 160) 20155* dcpgettext: Contexts. (line 56) 20156* dcpgettext_expr: Contexts. (line 112) 20157* debugging messages marked as format strings: xgettext Invocation. 20158 (line 333) 20159* Desktop Entry mode, and msgfmt program: msgfmt Invocation. (line 49) 20160* dialect: Manipulating. (line 28) 20161* disabling NLS: lib/gettext.h. (line 6) 20162* distribution tarball: Release Management. (line 6) 20163* dngettext: Plural forms. (line 152) 20164* dollar substitution: envsubst Invocation. (line 8) 20165* domain ambiguities: Ambiguities. (line 6) 20166* dpgettext: Contexts. (line 56) 20167* dpgettext_expr: Contexts. (line 112) 20168* duplicate elimination: Manipulating. (line 45) 20169* duplicate removal: msguniq Invocation. (line 8) 20170* editing comments in PO files: Modifying Comments. (line 6) 20171* Editing PO Files: Editing. (line 6) 20172* editing translations: Modifying Translations. 20173 (line 6) 20174* elisp-format flag: PO Files. (line 144) 20175* Emacs Lisp: Emacs Lisp. (line 6) 20176* Emacs PO Mode: PO Mode. (line 6) 20177* encoding: Aspects. (line 67) 20178* encoding conversion: Manipulating. (line 17) 20179* encoding conversion at runtime: Charset conversion. (line 6) 20180* encoding for your language: Header Entry. (line 130) 20181* encoding list: Header Entry. (line 114) 20182* encoding of PO files: Header Entry. (line 101) 20183* environment variables: envsubst Invocation. (line 8) 20184* envsubst program, usage: envsubst Invocation. (line 6) 20185* eval_gettext function, usage: eval_gettext Invocation. 20186 (line 6) 20187* eval_ngettext function, usage: eval_ngettext Invocation. 20188 (line 6) 20189* eval_npgettext function, usage: eval_npgettext Invocation. 20190 (line 6) 20191* eval_pgettext function, usage: eval_pgettext Invocation. 20192 (line 6) 20193* evolution of packages: Overview. (line 127) 20194* extracting parts of a PO file into a compendium: Creating Compendia. 20195 (line 64) 20196* FDL, GNU Free Documentation License: GNU FDL. (line 6) 20197* file format, .mo: MO Files. (line 6) 20198* file format, .po: PO Files. (line 6) 20199* files, .po and .mo: Files. (line 6) 20200* files, .pot: Overview. (line 67) 20201* filter messages according to attributes: msgattrib Invocation. 20202 (line 8) 20203* find common messages: msgcomm Invocation. (line 8) 20204* force use of fuzzy entries: msgfmt Invocation. (line 279) 20205* format strings: c-format Flag. (line 6) 20206* Free Pascal: Pascal. (line 6) 20207* function attribute, __format_arg__: xgettext Invocation. (line 294) 20208* function attribute, __format__: xgettext Invocation. (line 280) 20209* fuzzy entries: Fuzzy Entries. (line 6) 20210* fuzzy flag: PO Files. (line 78) 20211* gawk: gawk. (line 6) 20212* gcc-internal-format flag: PO Files. (line 208) 20213* GCC-source: GCC-source. (line 6) 20214* generate binary message catalog from PO file: msgfmt Invocation. 20215 (line 8) 20216* generate translation catalog in English: msgen Invocation. (line 8) 20217* gettext files: Adjusting Files. (line 6) 20218* gettext installation: Installation. (line 6) 20219* gettext interface: Interface to gettext. 20220 (line 6) 20221* gettext program, usage: gettext Invocation. (line 6) 20222* gettext vs catgets: Comparison. (line 6) 20223* gettext, a programmer’s view: gettext. (line 6) 20224* gettext.h file: lib/gettext.h. (line 6) 20225* gettextize program, usage: gettextize Invocation. 20226 (line 34) 20227* gfc-internal-format flag: PO Files. (line 212) 20228* GNOME PO file editor: Gtranslator. (line 5) 20229* GPL, GNU General Public License: GNU GPL. (line 6) 20230* GUI programs: Contexts. (line 6) 20231* guile: Scheme. (line 6) 20232* hash table, inside MO files: MO Files. (line 55) 20233* he, she, and they: Introduction. (line 15) 20234* header entry of a PO file: Header Entry. (line 6) 20235* help option: Preparing Strings. (line 120) 20236* history of GNU gettext: History. (line 6) 20237* i18n: Concepts. (line 6) 20238* importing PO files: Normalizing. (line 54) 20239* include file libintl.h: Overview. (line 57) 20240* include file libintl.h <1>: Importing. (line 11) 20241* include file libintl.h <2>: Comparison. (line 33) 20242* include file libintl.h <3>: lib/gettext.h. (line 28) 20243* initialization: Triggering. (line 6) 20244* initialize new PO file: msginit Invocation. (line 8) 20245* initialize translations from a compendium: Using Compendia. (line 12) 20246* installing gettext: Installation. (line 6) 20247* interface to catgets: Interface to catgets. 20248 (line 6) 20249* internationalization: Concepts. (line 16) 20250* inttypes.h: Preparing Strings. (line 147) 20251* ISO 3166: Country Codes. (line 6) 20252* ISO 639: Language Codes. (line 6) 20253* Java: Java. (line 6) 20254* Java mode, and msgfmt program: msgfmt Invocation. (line 30) 20255* Java mode, and msgunfmt program: msgunfmt Invocation. (line 16) 20256* Java, string concatenation: Preparing Strings. (line 182) 20257* java-format flag: PO Files. (line 119) 20258* java-printf-format flag: PO Files. (line 124) 20259* javascript-format flag: PO Files. (line 132) 20260* KDE format strings: xgettext Invocation. (line 325) 20261* KDE PO file editor: KBabel. (line 5) 20262* kde-format flag: PO Files. (line 184) 20263* keyboard accelerator checking: msgfmt Invocation. (line 267) 20264* l10n: Concepts. (line 6) 20265* language codes: Language Codes. (line 6) 20266* language selection: Locale Environment Variables. 20267 (line 6) 20268* language selection at runtime: gettext grok. (line 14) 20269* large package: Ambiguities. (line 6) 20270* LGPL, GNU Lesser General Public License: GNU LGPL. (line 6) 20271* libiconv library: AM_ICONV. (line 20) 20272* libintl for C#: C#. (line 180) 20273* libintl for Java: Java. (line 109) 20274* libintl library: AM_GNU_GETTEXT. (line 43) 20275* librep Lisp: librep. (line 6) 20276* librep-format flag: PO Files. (line 148) 20277* License, GNU FDL: GNU FDL. (line 6) 20278* License, GNU GPL: GNU GPL. (line 6) 20279* License, GNU LGPL: GNU LGPL. (line 6) 20280* Licenses: Licenses. (line 6) 20281* LINGUAS file: po/LINGUAS. (line 6) 20282* link with libintl: Overview. (line 62) 20283* Linux: Aspects. (line 129) 20284* Linux <1>: Overview. (line 62) 20285* Linux <2>: Header Entry. (line 127) 20286* Lisp: Common Lisp. (line 6) 20287* lisp-format flag: PO Files. (line 140) 20288* list of translation teams, where to find: Header Entry. (line 54) 20289* locale categories: Aspects. (line 61) 20290* locale categories <1>: Aspects. (line 118) 20291* locale category, LC_ALL: Triggering. (line 23) 20292* locale category, LC_COLLATE: Triggering. (line 52) 20293* locale category, LC_CTYPE: Aspects. (line 67) 20294* locale category, LC_CTYPE <1>: Triggering. (line 23) 20295* locale category, LC_CTYPE <2>: Triggering. (line 52) 20296* locale category, LC_MESSAGES: Aspects. (line 112) 20297* locale category, LC_MESSAGES <1>: Triggering. (line 52) 20298* locale category, LC_MONETARY: Aspects. (line 80) 20299* locale category, LC_MONETARY <1>: Triggering. (line 52) 20300* locale category, LC_NUMERIC: Aspects. (line 97) 20301* locale category, LC_NUMERIC <1>: Triggering. (line 52) 20302* locale category, LC_RESPONSES: Triggering. (line 52) 20303* locale category, LC_TIME: Aspects. (line 86) 20304* locale category, LC_TIME <1>: Triggering. (line 52) 20305* locale program: Header Entry. (line 107) 20306* localization: Concepts. (line 26) 20307* lookup message translation: gettext Invocation. (line 9) 20308* lookup message translation <1>: eval_gettext Invocation. 20309 (line 8) 20310* lookup message translation with context: eval_pgettext Invocation. 20311 (line 8) 20312* lookup plural message translation: ngettext Invocation. (line 8) 20313* lookup plural message translation <1>: eval_ngettext Invocation. 20314 (line 8) 20315* lookup plural message translation with context: eval_npgettext Invocation. 20316 (line 8) 20317* lua-format flag: PO Files. (line 164) 20318* magic signature of MO files: MO Files. (line 9) 20319* Makefile.in.in extensions: po/Rules-*. (line 6) 20320* Makevars file: po/Makevars. (line 6) 20321* manipulating PO files: Manipulating. (line 6) 20322* marking Perl sources: Perl. (line 97) 20323* marking string initializers: Special cases. (line 6) 20324* marking strings that require translation: Mark Keywords. (line 6) 20325* marking strings, preparations: Preparing Strings. (line 6) 20326* marking translatable strings: Overview. (line 34) 20327* markup: Preparing Strings. (line 230) 20328* menu entries: Contexts. (line 6) 20329* menu, keyboard accelerator support: msgfmt Invocation. (line 267) 20330* merge PO files: msgcat Invocation. (line 8) 20331* merging two PO files: Manipulating. (line 10) 20332* message catalog files location: Locating Catalogs. (line 6) 20333* messages: Aspects. (line 112) 20334* migration from earlier versions of gettext: Prerequisites. (line 6) 20335* mkinstalldirs file: mkinstalldirs. (line 6) 20336* mnemonics of menu entries: msgfmt Invocation. (line 267) 20337* MO file’s format: MO Files. (line 6) 20338* modify message attributes: msgattrib Invocation. 20339 (line 59) 20340* msgattrib program, usage: msgattrib Invocation. 20341 (line 6) 20342* msgcat program, usage: msgcat Invocation. (line 6) 20343* msgcmp program, usage: msgcmp Invocation. (line 6) 20344* msgcomm program, usage: msgcomm Invocation. (line 6) 20345* msgconv program, usage: msgconv Invocation. (line 6) 20346* msgctxt: PO Files. (line 220) 20347* msgen program, usage: msgen Invocation. (line 6) 20348* msgexec program, usage: msgexec Invocation. (line 6) 20349* msgfilter filter and catalog encoding: msgfilter Invocation. 20350 (line 62) 20351* msgfilter program, usage: msgfilter Invocation. 20352 (line 6) 20353* msgfmt program, usage: msgfmt Invocation. (line 6) 20354* msggrep program, usage: msggrep Invocation. (line 6) 20355* msgid: PO Files. (line 55) 20356* msgid_plural: PO Files. (line 240) 20357* msginit program, usage: msginit Invocation. (line 6) 20358* msgmerge program, usage: msgmerge Invocation. (line 6) 20359* msgstr: PO Files. (line 55) 20360* msgunfmt program, usage: msgunfmt Invocation. (line 6) 20361* msguniq program, usage: msguniq Invocation. (line 6) 20362* multi-line strings: Normalizing. (line 64) 20363* Native Language Support: Concepts. (line 51) 20364* Natural Language Support: Concepts. (line 51) 20365* newlines in PO files: PO Files. (line 324) 20366* ngettext: Plural forms. (line 82) 20367* ngettext program, usage: ngettext Invocation. (line 6) 20368* NLS: Concepts. (line 51) 20369* no-awk-format flag: PO Files. (line 161) 20370* no-boost-format flag: PO Files. (line 189) 20371* no-c-format flag: PO Files. (line 89) 20372* no-c-format, and xgettext: c-format Flag. (line 47) 20373* no-csharp-format flag: PO Files. (line 129) 20374* no-elisp-format flag: PO Files. (line 145) 20375* no-gcc-internal-format flag: PO Files. (line 209) 20376* no-gfc-internal-format flag: PO Files. (line 213) 20377* no-java-format flag: PO Files. (line 120) 20378* no-java-printf-format flag: PO Files. (line 125) 20379* no-javascript-format flag: PO Files. (line 133) 20380* no-kde-format flag: PO Files. (line 185) 20381* no-librep-format flag: PO Files. (line 149) 20382* no-lisp-format flag: PO Files. (line 141) 20383* no-lua-format flag: PO Files. (line 165) 20384* no-objc-format flag: PO Files. (line 108) 20385* no-object-pascal-format flag: PO Files. (line 169) 20386* no-perl-brace-format flag: PO Files. (line 201) 20387* no-perl-format flag: PO Files. (line 197) 20388* no-php-format flag: PO Files. (line 205) 20389* no-python-brace-format flag: PO Files. (line 116) 20390* no-python-format flag: PO Files. (line 112) 20391* no-qt-format flag: PO Files. (line 177) 20392* no-qt-plural-format flag: PO Files. (line 181) 20393* no-ruby-format flag: PO Files. (line 153) 20394* no-scheme-format flag: PO Files. (line 137) 20395* no-sh-format flag: PO Files. (line 157) 20396* no-smalltalk-format flag: PO Files. (line 173) 20397* no-tcl-format flag: PO Files. (line 193) 20398* no-ycp-format flag: PO Files. (line 218) 20399* nplurals, in a PO file header: Plural forms. (line 179) 20400* number format: Aspects. (line 97) 20401* N_, a convenience macro: Comparison. (line 41) 20402* objc-format flag: PO Files. (line 107) 20403* Object Pascal: Pascal. (line 6) 20404* object-pascal-format flag: PO Files. (line 168) 20405* obsolete entries: Obsolete Entries. (line 6) 20406* OEM encoding: Working in a Windows console. 20407 (line 6) 20408* optimization of gettext functions: Optimized gettext. (line 6) 20409* orthography: Manipulating. (line 28) 20410* outdigits: c-format. (line 28) 20411* output to stdout, xgettext: xgettext Invocation. (line 46) 20412* overview of gettext: Overview. (line 6) 20413* package and version declaration in configure.ac: configure.ac. 20414 (line 9) 20415* package build and installation options: Installers. (line 6) 20416* package distributor’s view of gettext: Installers. (line 6) 20417* package installer’s view of gettext: Installers. (line 6) 20418* package maintainer’s view of gettext: Maintainers. (line 6) 20419* paragraphs: Preparing Strings. (line 112) 20420* Pascal: Pascal. (line 6) 20421* Perl: Perl. (line 6) 20422* Perl default keywords: Default Keywords. (line 6) 20423* Perl invalid string interpolation: Interpolation I. (line 6) 20424* Perl long lines: Long Lines. (line 6) 20425* Perl parentheses: Parentheses. (line 6) 20426* Perl pitfalls: Perl Pitfalls. (line 6) 20427* Perl quote-like expressions: Quote-like Expressions. 20428 (line 6) 20429* Perl special keywords for hash-lookups: Special Keywords. (line 6) 20430* Perl valid string interpolation: Interpolation II. (line 6) 20431* perl-brace-format flag: PO Files. (line 200) 20432* perl-format flag: PO Files. (line 196) 20433* pgettext: Contexts. (line 33) 20434* pgettext_expr: Contexts. (line 112) 20435* PHP: PHP. (line 6) 20436* php-format flag: PO Files. (line 204) 20437* Pike: Pike. (line 6) 20438* plural form formulas: Plural forms. (line 199) 20439* plural forms: Plural forms. (line 6) 20440* plural forms, in MO files: MO Files. (line 74) 20441* plural forms, in PO files: PO Files. (line 240) 20442* plural forms, translating: Translating plural forms. 20443 (line 6) 20444* plural, in a PO file header: Plural forms. (line 179) 20445* PO files’ format: PO Files. (line 6) 20446* PO mode (Emacs) commands: Main PO Commands. (line 6) 20447* PO template file: Template. (line 6) 20448* Pology: Other tools. (line 6) 20449* portability problems with sed: msgfilter Invocation. 20450 (line 73) 20451* POTFILES.in file: po/POTFILES.in. (line 6) 20452* po_file_check_all: Checking API. (line 6) 20453* po_file_create: po_file_t API. (line 10) 20454* po_file_domains: po_file_t API. (line 42) 20455* po_file_domain_header: PO Header Entry API. (line 11) 20456* po_file_free: po_file_t API. (line 37) 20457* po_file_read: po_file_t API. (line 14) 20458* po_file_write: po_file_t API. (line 26) 20459* po_format_list: Format Type API. (line 6) 20460* po_format_pretty_name: Format Type API. (line 9) 20461* po_header_field: PO Header Entry API. (line 18) 20462* po_header_set_field: PO Header Entry API. (line 24) 20463* po_message_add_filepos: po_filepos_t API. (line 24) 20464* po_message_check_all: Checking API. (line 12) 20465* po_message_check_format: Checking API. (line 20) 20466* po_message_comments: po_message_t API. (line 83) 20467* po_message_create: po_message_t API. (line 10) 20468* po_message_extracted_comments: po_message_t API. (line 95) 20469* po_message_filepos: po_filepos_t API. (line 13) 20470* po_message_is_format: po_message_t API. (line 167) 20471* po_message_is_fuzzy: po_message_t API. (line 158) 20472* po_message_is_obsolete: po_message_t API. (line 149) 20473* po_message_is_range: po_message_t API. (line 179) 20474* po_message_iterator: po_message_iterator_t API. 20475 (line 10) 20476* po_message_iterator_free: po_message_iterator_t API. 20477 (line 17) 20478* po_message_msgctxt: po_message_t API. (line 19) 20479* po_message_msgid: po_message_t API. (line 31) 20480* po_message_msgid_plural: po_message_t API. (line 42) 20481* po_message_msgstr: po_message_t API. (line 56) 20482* po_message_msgstr_plural: po_message_t API. (line 68) 20483* po_message_prev_msgctxt: po_message_t API. (line 107) 20484* po_message_prev_msgid: po_message_t API. (line 121) 20485* po_message_prev_msgid_plural: po_message_t API. (line 134) 20486* po_message_remove_filepos: po_filepos_t API. (line 19) 20487* po_message_set_comments: po_message_t API. (line 88) 20488* po_message_set_extracted_comments: po_message_t API. (line 101) 20489* po_message_set_format: po_message_t API. (line 173) 20490* po_message_set_fuzzy: po_message_t API. (line 162) 20491* po_message_set_msgctxt: po_message_t API. (line 24) 20492* po_message_set_msgid: po_message_t API. (line 35) 20493* po_message_set_msgid_plural: po_message_t API. (line 48) 20494* po_message_set_msgstr: po_message_t API. (line 61) 20495* po_message_set_msgstr_plural: po_message_t API. (line 74) 20496* po_message_set_obsolete: po_message_t API. (line 153) 20497* po_message_set_prev_msgctxt: po_message_t API. (line 113) 20498* po_message_set_prev_msgid: po_message_t API. (line 126) 20499* po_message_set_prev_msgid_plural: po_message_t API. (line 141) 20500* po_message_set_range: po_message_t API. (line 186) 20501* po_next_message: po_message_iterator_t API. 20502 (line 22) 20503* preparing programs for translation: Sources. (line 6) 20504* preparing rules for XML translation: Preparing ITS Rules. (line 6) 20505* preparing shell scripts for translation: Preparing Shell Scripts. 20506 (line 6) 20507* problems with catgets interface: Problems with catgets. 20508 (line 6) 20509* programming languages: Language Implementors. 20510 (line 6) 20511* Python: Python. (line 6) 20512* python-brace-format flag: PO Files. (line 115) 20513* python-format flag: PO Files. (line 111) 20514* Qt format strings: xgettext Invocation. (line 321) 20515* Qt mode, and msgfmt program: msgfmt Invocation. (line 46) 20516* qt-format flag: PO Files. (line 176) 20517* qt-plural-format flag: PO Files. (line 180) 20518* quotation marks: Header Entry. (line 160) 20519* quotation marks <1>: po/Rules-*. (line 11) 20520* quote characters, use in PO files: Header Entry. (line 160) 20521* range: flag: PO Files. (line 271) 20522* recode-sr-latin program: msgfilter Invocation. 20523 (line 101) 20524* related reading: References. (line 6) 20525* release: Release Management. (line 6) 20526* RSJ: RST. (line 6) 20527* RST: RST. (line 6) 20528* Ruby: Ruby. (line 6) 20529* ruby-format flag: PO Files. (line 152) 20530* Scheme: Scheme. (line 6) 20531* scheme-format flag: PO Files. (line 136) 20532* scripting languages: Language Implementors. 20533 (line 6) 20534* search messages in a catalog: msggrep Invocation. (line 8) 20535* selecting message language: Locale Environment Variables. 20536 (line 6) 20537* sentence end markers, xgettext: xgettext Invocation. (line 152) 20538* sentences: Preparing Strings. (line 52) 20539* setting up gettext at build time: Installers. (line 6) 20540* setting up gettext at run time: Locale Environment Variables. 20541 (line 6) 20542* several domains: Ambiguities. (line 6) 20543* sex: Introduction. (line 15) 20544* sh-format flag: PO Files. (line 156) 20545* she, he, and they: Introduction. (line 15) 20546* shell format string: envsubst Invocation. (line 8) 20547* shell scripts: sh. (line 6) 20548* Smalltalk: Smalltalk. (line 6) 20549* smalltalk-format flag: PO Files. (line 172) 20550* sorting msgcat output: msgcat Invocation. (line 156) 20551* sorting msgmerge output: msgmerge Invocation. (line 195) 20552* sorting msgunfmt output: msgunfmt Invocation. (line 147) 20553* sorting output of xgettext: xgettext Invocation. (line 416) 20554* specifying plural form in a PO file: Plural forms. (line 179) 20555* standard output, and msgcat: msgcat Invocation. (line 48) 20556* standard output, and msgmerge program: msgmerge Invocation. (line 53) 20557* string concatenation: Preparing Strings. (line 131) 20558* string normalization in entries: Normalizing. (line 6) 20559* style: Preparing Strings. (line 29) 20560* supported languages, msgfmt: msgfmt Invocation. (line 180) 20561* supported languages, xgettext: xgettext Invocation. (line 54) 20562* supported syntax checks, xgettext: xgettext Invocation. (line 116) 20563* Tcl: Tcl. (line 6) 20564* Tcl mode, and msgfmt program: msgfmt Invocation. (line 43) 20565* Tcl mode, and msgunfmt program: msgunfmt Invocation. (line 26) 20566* tcl-format flag: PO Files. (line 192) 20567* template PO file: Overview. (line 67) 20568* testing .po files for equivalence: xgettext Invocation. (line 426) 20569* Tk’s scripting language: Tcl. (line 6) 20570* translated entries: Translated Entries. (line 6) 20571* translating menu entries: Contexts. (line 6) 20572* translation aspects: Aspects. (line 6) 20573* Translation Matrix: Installing Localizations. 20574 (line 6) 20575* Translation Project: Why. (line 17) 20576* turning off NLS support: lib/gettext.h. (line 6) 20577* tutorial of gettext usage: Overview. (line 6) 20578* unify duplicate translations: msguniq Invocation. (line 8) 20579* untranslated entries: Untranslated Entries. 20580 (line 6) 20581* update translations from a compendium: Using Compendia. (line 20) 20582* upgrading to new versions of gettext: Prerequisites. (line 6) 20583* version control for backup files, msgmerge: msgmerge Invocation. 20584 (line 67) 20585* Windows: Working in a Windows console. 20586 (line 6) 20587* wxWidgets library: wxWidgets. (line 6) 20588* xargs, and output from msgexec: msgexec Invocation. (line 14) 20589* xerror: Error Handling. (line 15) 20590* xerror2: Error Handling. (line 38) 20591* xgettext program, usage: xgettext Invocation. (line 6) 20592* XML mode, and msgfmt program: msgfmt Invocation. (line 52) 20593* xmodmap program, and typing quotation marks: Header Entry. (line 172) 20594* YaST2 scripting language: YCP. (line 6) 20595* YCP: YCP. (line 6) 20596* ycp-format flag: PO Files. (line 217) 20597 20598 20599 20600Tag Table: 20601Node: Top2954 20602Node: Introduction19578 20603Node: Why21295 20604Ref: Why-Footnote-124530 20605Node: Concepts24686 20606Node: Aspects28141 20607Node: Files34753 20608Node: Overview36703 20609Node: Users46790 20610Node: System Installation47782 20611Node: Setting the GUI Locale49461 20612Node: Setting the POSIX Locale50869 20613Node: Locale Names51855 20614Node: Locale Environment Variables54310 20615Node: The LANGUAGE variable56653 20616Node: Working in a Windows console58674 20617Node: Installing Localizations60337 20618Node: PO Files61627 20619Ref: PO Files-Footnote-175029 20620Node: Sources75164 20621Node: Importing76406 20622Node: Triggering77094 20623Node: Preparing Strings80452 20624Node: Mark Keywords90566 20625Node: Marking95134 20626Node: c-format Flag103091 20627Node: Special cases107137 20628Node: Bug Report Address109921 20629Node: Names111900 20630Node: Libraries116207 20631Node: Template119297 20632Node: xgettext Invocation120062 20633Node: Creating140501 20634Node: msginit Invocation141410 20635Node: Header Entry146017 20636Node: Updating155475 20637Node: msgmerge Invocation155694 20638Node: Editing162528 20639Node: KBabel162892 20640Node: Gtranslator163016 20641Node: PO Mode163160 20642Node: Installation164820 20643Node: Main PO Commands166820 20644Node: Entry Positioning172092 20645Node: Normalizing177737 20646Node: Translated Entries182298 20647Node: Fuzzy Entries183707 20648Node: Untranslated Entries187018 20649Node: Obsolete Entries189021 20650Node: Modifying Translations192324 20651Node: Modifying Comments200470 20652Node: Subedit205019 20653Node: C Sources Context209037 20654Node: Auxiliary214270 20655Node: Compendium217594 20656Node: Creating Compendia218213 20657Node: Using Compendia220756 20658Node: Manipulating221714 20659Node: msgcat Invocation225728 20660Node: msgconv Invocation231191 20661Node: msggrep Invocation235182 20662Node: msgfilter Invocation242004 20663Node: msguniq Invocation250358 20664Node: msgcomm Invocation255098 20665Node: msgcmp Invocation259999 20666Node: msgattrib Invocation262240 20667Node: msgen Invocation268009 20668Node: msgexec Invocation272418 20669Node: Colorizing275742 20670Node: The --color option276924 20671Node: The TERM variable278792 20672Node: The --style option280346 20673Node: Style rules281724 20674Node: Customizing less288730 20675Node: Other tools290185 20676Node: libgettextpo290849 20677Node: Error Handling293732 20678Node: po_file_t API295715 20679Node: po_message_iterator_t API297933 20680Node: po_message_t API299154 20681Node: PO Header Entry API307773 20682Node: po_filepos_t API309004 20683Node: Format Type API310160 20684Node: Checking API310745 20685Node: Binaries311966 20686Node: msgfmt Invocation312318 20687Node: msgunfmt Invocation322976 20688Node: MO Files327660 20689Node: Programmers336281 20690Node: catgets337495 20691Node: Interface to catgets338901 20692Node: Problems with catgets340954 20693Node: gettext341879 20694Node: Interface to gettext343402 20695Node: Ambiguities345754 20696Node: Locating Catalogs348821 20697Ref: Locating Catalogs-Footnote-1350086 20698Ref: Locating Catalogs-Footnote-2350318 20699Node: Charset conversion350471 20700Node: Contexts352991 20701Node: Plural forms358611 20702Ref: Plural forms-Footnote-1375355 20703Node: Optimized gettext375723 20704Node: Comparison377074 20705Node: Using libintl.a381441 20706Node: gettext grok381896 20707Node: Temp Programmers384605 20708Node: Temp Implementations385137 20709Node: Temp catgets386530 20710Node: Temp WSI388257 20711Node: Temp Notes390320 20712Node: Translators390834 20713Node: Trans Intro 0391379 20714Node: Trans Intro 1394216 20715Node: Discussions396189 20716Node: Organization399907 20717Node: Central Coordination401993 20718Node: National Teams403120 20719Node: Sub-Cultures405654 20720Node: Organizational Ideas406572 20721Node: Mailing Lists407607 20722Node: Information Flow409444 20723Node: Translating plural forms411711 20724Node: Prioritizing messages415154 20725Node: Maintainers419540 20726Node: Flat and Non-Flat421517 20727Node: Prerequisites423035 20728Node: gettextize Invocation427188 20729Node: Adjusting Files433876 20730Node: po/POTFILES.in435659 20731Node: po/LINGUAS436934 20732Node: po/Makevars438741 20733Node: po/Rules-*439730 20734Node: configure.ac441291 20735Node: config.guess443096 20736Node: mkinstalldirs444470 20737Node: aclocal444817 20738Node: config.h.in446837 20739Node: Makefile447604 20740Node: src/Makefile449895 20741Node: lib/gettext.h454149 20742Node: autoconf macros456414 20743Node: AM_GNU_GETTEXT457239 20744Node: AM_GNU_GETTEXT_VERSION460733 20745Node: AM_GNU_GETTEXT_NEED461212 20746Node: AM_PO_SUBDIRS462132 20747Node: AM_XGETTEXT_OPTION462964 20748Node: AM_ICONV463875 20749Node: Version Control Issues466260 20750Node: Distributed Development467015 20751Node: Files under Version Control469019 20752Node: Translations under Version Control472508 20753Ref: Translations under Version Control-Footnote-1474584 20754Node: autopoint Invocation474674 20755Node: Release Management477052 20756Node: Installers477593 20757Node: Programming Languages478856 20758Node: Language Implementors479639 20759Node: Programmers for other Languages485613 20760Node: Translators for other Languages486207 20761Node: c-format488121 20762Node: objc-format489855 20763Node: python-format490218 20764Node: java-format490995 20765Node: csharp-format491910 20766Node: javascript-format492297 20767Node: scheme-format493090 20768Node: lisp-format493368 20769Node: elisp-format493728 20770Node: librep-format494224 20771Node: ruby-format494627 20772Node: sh-format495403 20773Node: awk-format496251 20774Node: lua-format496566 20775Node: object-pascal-format496907 20776Node: smalltalk-format497300 20777Node: qt-format497839 20778Node: qt-plural-format498282 20779Node: kde-format498641 20780Node: kde-kuit-format499073 20781Node: boost-format499715 20782Node: tcl-format500308 20783Node: perl-format500612 20784Node: php-format501407 20785Node: gcc-internal-format501783 20786Node: gfc-internal-format502942 20787Node: ycp-format503692 20788Node: Maintainers for other Languages504090 20789Node: List of Programming Languages505030 20790Node: C506439 20791Node: Python507946 20792Node: Java510445 20793Node: C#516603 20794Node: JavaScript526137 20795Node: Scheme526955 20796Node: Common Lisp527868 20797Node: clisp C528746 20798Node: Emacs Lisp529532 20799Node: librep530338 20800Node: Ruby531150 20801Node: sh532015 20802Node: Preparing Shell Scripts533618 20803Node: gettext.sh537262 20804Node: gettext Invocation537954 20805Node: ngettext Invocation540370 20806Node: envsubst Invocation542384 20807Node: eval_gettext Invocation543865 20808Node: eval_ngettext Invocation544332 20809Node: eval_pgettext Invocation544885 20810Node: eval_npgettext Invocation545422 20811Node: bash546007 20812Node: gawk548056 20813Node: Lua549187 20814Node: Pascal550519 20815Node: Smalltalk551978 20816Node: Vala553109 20817Node: wxWidgets554073 20818Node: Tcl555076 20819Node: Perl556598 20820Node: General Problems560008 20821Node: Default Keywords565663 20822Node: Special Keywords567534 20823Node: Quote-like Expressions569096 20824Node: Interpolation I571413 20825Node: Interpolation II575357 20826Node: Parentheses577741 20827Node: Long Lines579266 20828Node: Perl Pitfalls581133 20829Node: PHP585467 20830Node: Pike586502 20831Node: GCC-source587244 20832Node: YCP588090 20833Node: Data Formats588884 20834Node: Internationalizable Data589285 20835Node: POT589985 20836Node: RST590260 20837Node: Glade590770 20838Node: GSettings591239 20839Node: AppData591591 20840Node: Preparing ITS Rules592200 20841Ref: Preparing ITS Rules-Footnote-1598508 20842Node: Localized Data598840 20843Node: Editable Message Catalogs599324 20844Node: PO599928 20845Node: Java .properties600109 20846Node: GNUstep .strings600315 20847Node: Compiled Message Catalogs600525 20848Node: MO601155 20849Node: Java ResourceBundle601383 20850Node: C# Satellite Assembly601734 20851Node: C# Resource602014 20852Node: Tcl message catalog602280 20853Node: Qt message catalog602607 20854Node: Desktop Entry602890 20855Node: Icons603557 20856Node: XML605147 20857Node: Conclusion605376 20858Node: History605937 20859Node: The original ABOUT-NLS610333 20860Node: INSTALL Matters611755 20861Node: Using This Package613450 20862Node: Translating Teams616593 20863Node: Available Packages618112 20864Node: Using gettext in own code697651 20865Node: References698776 20866Node: Language Codes700490 20867Node: Usual Language Codes701005 20868Node: Rare Language Codes706045 20869Node: Country Codes707895 20870Node: Licenses715021 20871Node: GNU GPL716877 20872Node: GNU LGPL736177 20873Node: GNU FDL764418 20874Node: Program Index786954 20875Node: Option Index789364 20876Node: Variable Index841875 20877Node: PO Mode Index846690 20878Node: Autoconf Macro Index863388 20879Node: Index864053 20880 20881End Tag Table 20882 20883 20884Local Variables: 20885coding: utf-8 20886End: 20887