• Home
  • Raw
  • Download

Lines Matching +refs:po +refs:string +refs:start

2 @c %**start of header
211 * c-format Flag:: Telling something about the following string
352 * po/POTFILES.in:: @file{POTFILES.in} in @file{po/}
353 * po/LINGUAS:: @file{LINGUAS} in @file{po/}
354 * po/Makevars:: @file{Makevars} in @file{po/}
355 * po/Rules-*:: Extending @file{Makefile} in @file{po/}
370 * AM_PO_SUBDIRS:: AM_PO_SUBDIRS in @file{po.m4}
371 * AM_XGETTEXT_OPTION:: AM_XGETTEXT_OPTION in @file{po.m4}
879 @cindex files, @file{.po} and @file{.mo}
880 The letters PO in @file{.po} files means Portable Object, to
887 original, translatable string of a given package with its translation
937 │ ├────> msgmerge ──────> LANG.po ────>────────╯ │
941 │ ├─── New LANG.po <────────────────────╯
963 | +----> msgmerge ------> LANG.po ---->--------' |
967 | +--- New LANG.po <--------------------'
1030 exactly where in C sources each string is used. All translations
1040 The first time through, there is no @file{@var{lang}.po} yet, so the
1042 @file{@var{package}.pot} to @file{@var{lang}.po}, where @var{lang}
1054 While adding the translated messages into the @file{@var{lang}.po}
1086 evolving over time, so the translations carried by @file{@var{lang}.po}
1092 package, and not something which is done once and for all at the start.
1099 existing @file{@var{lang}.po} file, by comparing it with a newer
1104 obsolete, in @file{@var{lang}.po}, those already translated entries
1112 @file{@var{lang}.po} file offering translations for all strings.
1216 system, you can start it from the command-line, after having set some
1429 For programs that participate in the Translation Project, you can start
1440 contains some @file{@var{ll}.po} files; often they are kept together in a
1441 directory called @file{po/}. Each @file{@var{ll}.po} file contains the
1447 @cindex file format, @file{.po}
1455 between an original untranslated string and its corresponding
1467 #| msgid @var{previous-untranslated-string}
1468 msgid @var{untranslated-string}
1469 msgstr @var{translated-string}
1502 contain the previous untranslated string for which the translator gave
1510 first the untranslated string as it appears in the original program
1511 sources, and then, the translation of this string. The original
1512 string is introduced by the keyword @code{msgid}, and the translation,
1523 On the other hand, the @code{msgstr} string, as well as translator
1538 string might not be a correct translation (anymore). Only the translator
1554 The @code{c-format} flag indicates that the untranslated string and the
1557 string happens to look like a C format string (with @samp{%} directives).
1559 When the @code{c-format} flag is given for a string the @code{msgfmt}
1745 #| msgid @var{previous-untranslated-string}
1747 msgid @var{untranslated-string}
1748 msgstr @var{translated-string}
1752 @var{untranslated-string}. It is possible to have several entries with
1753 the same @var{untranslated-string} in a PO file, provided that they each
1754 have a different @var{context}. Note that an empty @var{context} string
1768 #| msgid @var{previous-untranslated-string-singular}
1769 #| msgid_plural @var{previous-untranslated-string-plural}
1770 msgid @var{untranslated-string-singular}
1771 msgid_plural @var{untranslated-string-plural}
1772 msgstr[0] @var{translated-string-case-0}
1774 msgstr[N] @var{translated-string-case-n}
1780 #: src/msgcmp.c:338 src/po-lex.c:699
1803 The @var{previous-untranslated-string} is optionally inserted by the
1806 on the @var{untranslated-string}.
1818 An empty @var{untranslated-string} is reserved to contain the header
1821 @var{untranslated-string} is reserved for this purpose and must
1824 Each of @var{untranslated-string} and @var{translated-string} respects
1825 the C syntax for a character string, including the surrounding quotes
1829 line to be continued, and an opening quote should resume the string
1834 "Here is an example of how one might continue a very long string\n"
1835 "for the common case the string represents multi-line output.\n"
1839 In this example, the empty string is used on the first line, to
1843 to be concatenated. Concatenating the empty string does not change
1844 the resulting overall string, but it is a way for us to comply with
1845 the necessity of @code{msgid} to be followed by a string on the same
1847 we find this to be a cleaner disposition. The empty string could have
1848 been omitted, but only if the string starting with @samp{Here} was
1859 string, and end of lines in the PO file itself, outside string quotes,
1860 which have no incidence on the represented string.
1864 Comments start at the beginning of a line with @samp{#} and extend
1892 * c-format Flag:: Telling something about the following string
1913 calls with a format string that could be a translated C string (even if
1914 the C string comes from a different C module) should contain the line:
1999 declared in the @code{<string.h>} and @code{<stdlib.h>} standard headers.
2019 be adjusted. Usually preparing a string for translation is done right
2035 Use format strings instead of string concatenation.
2088 string @code{"File %s is %s protected"}, which is unintelligible. Change
2107 and then combining these two half-sentences through dumb string concatenation
2152 translatable string changes, the translator is faced with the task of
2153 updating the entire translated string. Maybe only a single word will
2154 have changed in the English string, but the translator doesn't see that
2167 @subheading No string concatenation
2169 @cindex string concatenation
2171 Hardcoded string concatenation is sometimes used to construct English
2186 to use a format string:
2196 integer through @code{printf}. It expands to a constant string, usually
2213 The PO file will contain the string "The amount is %0<PRId64>\n".
2216 contain the appropriate constant string, "d" or "ld" or "lld".
2235 @cindex Java, string concatenation
2236 @cindex C#, string concatenation
2238 Java and C#, string concatenation is very frequently used, because it is a
2246 into a statement involving a format string:
2262 into a statement involving a format string:
2280 of the string.
2316 string. This is flawed. Some translators may convert it to a simple
2333 is done in such a way that each translatable string appears to be
2339 produced by formatting. The format string needs translation, as
2349 argument string. Most localizable strings are found in executable
2373 and write @samp{_("Translatable string")} instead of @samp{gettext
2374 ("Translatable string")}. Further, the coding rule, from GNU standards,
2377 So, the textual overhead per translatable string is reduced to
2393 string as sole argument. It is also possible to define marking functions
2399 in @ref{po/Makevars} and @ref{AM_XGETTEXT_OPTION}.
2402 adjacent string tokens. Automatic string concatenation is performed
2407 you add or modify a string, you will have to ask yourself if the
2408 new or altered string requires translation, and include it within
2410 is an example of string @emph{not} requiring translation. But
2463 Search through program sources for a string which looks like a
2464 candidate for translation (@code{po-tags-search}).
2468 Mark the last string found with @samp{_()} (@code{po-mark-translatable}).
2472 Mark the last string found with a keyword taken from a set of possible
2474 keywords (@code{po-select-mark-and-mark}).
2478 @efindex po-tags-search@r{, PO Mode command}
2479 The @kbd{,} (@code{po-tags-search}) command searches for the next
2480 occurrence of a string which looks like a possible candidate for
2482 positioned in such a way that the string is near the top of this other
2483 window. If the string is too big to fit whole in this window, it is
2485 is left in the PO file window. If the shown string would be better
2488 and skip to the next string by merely repeating the @kbd{,} command.
2490 A string is a good candidate for translation if it contains a sequence
2491 of three or more letters. A string containing at most two letters in
2520 @efindex po-mark-translatable@r{, PO Mode command}
2521 @efindex po-select-mark-and-mark@r{, PO Mode command}
2522 The @kbd{M-,} (@code{po-mark-translatable}) command will mark the
2523 recently found string with the @samp{_} keyword. The @kbd{M-.}
2524 (@code{po-select-mark-and-mark}) command will request that you type
2526 the string. Both commands will automatically create a new PO file
2527 untranslated entry for the string being marked, and make it the
2537 @kbd{,} for the next string, say.
2586 A possible German translation for the above string might be:
2596 string is regarded as the address.
2600 translation string match in type and number. If this is not the case
2618 useful for @code{msgfmt} to test all the strings in the @file{.po} file.
2619 This might cause problems because the string might contain what looks
2620 like a format specifier, but the string is not used in @code{printf}.
2623 thinks might be a format string. There is no absolute rule for this,
2624 only a heuristic. In the @file{.po} file the entry is marked using the
2635 @code{xgettext:c-format}, it will mark the string in any case with
2637 @code{xgettext} does not recognize the string as a format string but
2640 before the string to be translated.
2645 @code{xgettext} does not recognize this as a format string but what
2651 round, i.e.@: a string marked as a format string actually is not a format
2652 string. In this case the @code{msgfmt} might give too many warnings and
2653 would prevent translating the @file{.po} file. The method to prevent
2655 to use must contain the string @code{xgettext:no-c-format}.
2657 If a string is marked with @code{c-format} and this is not correct the
2665 @cindex marking string initializers
2667 to mark translatable string with @code{gettext} or something like this.
2677 const char *string;
2679 string
2682 fputs (string);
2688 While it is no problem to mark the string @code{"a default message"} it
2689 is not possible to mark the string initializers for @code{messages}.
2692 can find them, and second we have to translate the string at runtime
2696 no-op. For the second we have to mark all access points to a string
2708 const char *string;
2710 string
2713 fputs (string);
2719 Please convince yourself that the string which is written by
2736 const char *string;
2738 string
2741 fputs (gettext (string));
2748 he uses @code{gettext_noop} for the string @code{"a default message"}.
3008 @code{xgettext} creates a file named @file{@var{domainname}.po}. You
3031 @file{@var{LANG}.po}, as a copy of the @file{@var{package}.pot} template
3040 $ cd po
3046 @file{@var{LANG}.po}. Then she modifies the initial comments and
3070 type @kbd{M-x po-mode RET} and then @kbd{RET} again to start editing the
3370 (cons '("\\.po\\'\\|\\.po\\." . po-mode) auto-mode-alist))
3371 (autoload 'po-mode "po-mode" "Major mode for translators to edit PO files" t)
3374 Later, whenever you edit some @file{.po}
3375 file, or any file having the string @samp{.po.} within its name,
3376 Emacs loads @file{po-mode.elc} (or @file{po-mode.el}) as needed, and
3378 The string @emph{PO} appears in the mode line for any buffer for
3390 (modify-coding-system-alist 'file "\\.po\\'\\|\\.po\\."
3391 'po-find-file-coding-system)
3392 (autoload 'po-find-file-coding-system "po-mode")
3408 po-mode-map, which is a genuine Emacs mode, in a way that is not derived
3409 from text mode in any way. Functions found on @code{po-mode-hook},
3415 the string @samp{132t+3f+10u+2o} would tell the translator that the
3431 Undo last modification to the PO file (@code{po-undo}).
3435 Quit processing and save the PO file (@code{po-quit}).
3439 Quit processing, possibly after confirmation (@code{po-confirm-and-quit}).
3443 Temporary leave the PO file window (@code{po-other-window}).
3449 Show help about PO mode (@code{po-help}).
3453 Give some PO file statistics (@code{po-statistics}).
3457 Batch validate the format of the whole PO file (@code{po-validate}).
3462 @efindex po-undo@r{, PO Mode command}
3463 The command @kbd{_} (@code{po-undo}) interfaces to the Emacs
3475 @efindex po-quit@r{, PO Mode command}
3476 @efindex po-confirm-and-quit@r{, PO Mode command}
3477 The commands @kbd{Q} (@code{po-quit}) and @kbd{q}
3478 (@code{po-confirm-and-quit}) are used when the translator is done with the
3488 @efindex po-other-window@r{, PO Mode command}
3489 The command @kbd{0} (@code{po-other-window}) is another, softer way,
3502 @efindex po-help@r{, PO Mode command}
3503 The command @kbd{h} (@code{po-help}) displays a summary of all available PO
3509 @efindex po-statistics@r{, PO Mode command}
3510 The command @kbd{=} (@code{po-statistics}) computes the total number of
3516 @efindex po-validate@r{, PO Mode command}
3517 The command @kbd{V} (@code{po-validate}) launches @code{msgfmt} in
3557 Redisplay the current entry (@code{po-current-entry}).
3561 Select the entry after the current one (@code{po-next-entry}).
3565 Select the entry before the current one (@code{po-previous-entry}).
3569 Select the first entry in the PO file (@code{po-first-entry}).
3573 Select the last entry in the PO file (@code{po-last-entry}).
3578 (@code{po-push-location}).
3582 Return to a previously saved entry location (@code{po-pop-location}).
3587 (@code{po-exchange-location}).
3592 @efindex po-current-entry@r{, PO Mode command}
3599 (@code{po-current-entry}) has the sole purpose of redisplaying the
3618 @efindex po-next-entry@r{, PO Mode command}
3620 @efindex po-previous-entry@r{, PO Mode command}
3621 The commands @kbd{n} (@code{po-next-entry}) and @kbd{p}
3622 (@code{po-previous-entry}) move the cursor the entry following,
3628 @efindex po-first-entry@r{, PO Mode command}
3630 @efindex po-last-entry@r{, PO Mode command}
3631 The commands @kbd{<} (@code{po-first-entry}) and @kbd{>}
3632 (@code{po-last-entry}) move the cursor to the first entry, or last
3650 @efindex po-push-location@r{, PO Mode command}
3652 @efindex po-pop-location@r{, PO Mode command}
3654 onto a special stack. The command @kbd{m} (@code{po-push-location})
3657 @kbd{r} (@code{po-pop-location}) consumes the top stack element and
3669 @efindex po-exchange-location@r{, PO Mode command}
3670 The command @kbd{x} (@code{po-exchange-location}) simultaneously
3681 @cindex string normalization in entries
3683 There are many different ways for encoding a particular string into a
3688 particular string encoded into the @code{msgid} field of some entry.
3707 @emindex string normalization in entries
3709 @item M-x po-normalize
3710 @efindex po-normalize@r{, PO Mode command}
3715 The special command @kbd{M-x po-normalize}, which has no associated
3722 speeding up @code{msgid} string lookup for some other PO mode commands.
3724 @kbd{M-x po-normalize} presently makes three passes over the entries.
3727 fields were using K&R style C string syntax for multi-line strings.
3744 string format is given below, for the particular benefit of those not
3749 Right now, in PO mode, strings are single line or multi-line. A string
3772 We might lump together all initial newlines into the empty string,
3775 string), so making the previous example appear:
3784 There are a few yet undecided little points about string normalization,
3803 Find the next translated entry (@code{po-next-translated-entry}).
3807 Find the previous translated entry (@code{po-previous-translated-entry}).
3812 @efindex po-next-translated-entry@r{, PO Mode command}
3814 @efindex po-previous-translated-entry@r{, PO Mode command}
3815 The commands @kbd{t} (@code{po-next-translated-entry}) and @kbd{T}
3816 (@code{po-previous-translated-entry}) move forwards or backwards, chasing
3820 @evindex po-auto-fuzzy-on-edit@r{, PO Mode variable}
3823 variable @code{po-auto-fuzzy-on-edit} is not @code{nil}, the entry having
3847 The slight alteration in the original string (the @code{msgid} string)
3848 should often be reflected in the translated string, and this requires
3862 Find the next fuzzy entry (@code{po-next-fuzzy-entry}).
3866 Find the previous fuzzy entry (@code{po-previous-fuzzy-entry}).
3870 Remove the fuzzy attribute of the current entry (@code{po-unfuzzy}).
3875 @efindex po-next-fuzzy-entry@r{, PO Mode command}
3877 @efindex po-previous-fuzzy-entry@r{, PO Mode command}
3878 The commands @kbd{f} (@code{po-next-fuzzy-entry}) and @kbd{F}
3879 (@code{po-previous-fuzzy-entry}) move forwards or backwards, chasing for
3884 @efindex po-unfuzzy@r{, PO Mode command}
3885 @evindex po-auto-select-on-unfuzzy@r{, PO Mode variable}
3886 The command @kbd{@key{TAB}} (@code{po-unfuzzy}) removes the fuzzy
3888 Further, if the variable @code{po-auto-select-on-unfuzzy} has not
3891 @code{po-auto-select-on-unfuzzy} is @code{nil}.
3893 The initial value of @code{po-auto-fuzzy-on-edit} is @code{nil}. However,
3894 if the variable @code{po-auto-fuzzy-on-edit} is set to @code{t}, any entry
3904 @efindex po-fade-out-entry@r{, PO Mode command}
3906 (@code{po-fade-out-entry}) over any translated entry to mark it as being
3911 command, the translator is asked for confirmation, if fuzzy string
3920 string, and leaves the @code{msgstr} string to be empty. Such entries,
3922 Later, when the programmer slightly modifies some string right in
3924 by the appearance of a new untranslated entry for the modified string.
3940 Find the next untranslated entry (@code{po-next-untranslated-entry}).
3944 Find the previous untranslated entry (@code{po-previous-untransted-entry}).
3948 Turn the current entry into an untranslated one (@code{po-kill-msgstr}).
3953 @efindex po-next-untranslated-entry@r{, PO Mode command}
3955 @efindex po-previous-untransted-entry@r{, PO Mode command}
3956 The commands @kbd{u} (@code{po-next-untranslated-entry}) and @kbd{U}
3957 (@code{po-previous-untransted-entry}) move forwards or backwards,
3962 @efindex po-kill-msgstr@r{, PO Mode command}
3965 (@code{po-kill-msgstr}). @xref{Modifying Translations}.
3969 if some untranslated string still exists.
3981 easily recognizable by the fact that all their lines start with
3985 to the original untranslated string. Commands interfacing with the
3998 Find the next obsolete entry (@code{po-next-obsolete-entry}).
4002 Find the previous obsolete entry (@code{po-previous-obsolete-entry}).
4007 (@code{po-fade-out-entry}).
4012 @efindex po-next-obsolete-entry@r{, PO Mode command}
4014 @efindex po-previous-obsolete-entry@r{, PO Mode command}
4015 The commands @kbd{o} (@code{po-next-obsolete-entry}) and @kbd{O}
4016 (@code{po-previous-obsolete-entry}) move forwards or backwards,
4022 untranslated string which does not correspond to any marked string
4027 @efindex po-fade-out-entry@r{, PO Mode command}
4032 disappearance of a translation by using the untranslated string.
4033 The command @kbd{@key{DEL}} (@code{po-fade-out-entry}) pushes the current entry
4045 entries, for initializing the translation of a newly appeared string.
4047 we have to develop good and efficient measures of string similarity.
4075 Interactively edit the translation (@code{po-edit-msgstr}).
4081 Reinitialize the translation with the original, untranslated string
4082 (@code{po-msgid-to-msgstr}).
4086 Save the translation on the kill ring, and delete it (@code{po-kill-msgstr}).
4091 (@code{po-kill-ring-save-msgstr}).
4096 (@code{po-yank-msgstr}).
4101 @efindex po-edit-msgstr@r{, PO Mode command}
4102 The command @kbd{@key{RET}} (@code{po-edit-msgstr}) opens a new Emacs
4114 @efindex po-msgid-to-msgstr@r{, PO Mode command}
4115 The command @kbd{@key{LFD}} (@code{po-msgid-to-msgstr}) initializes, or
4116 reinitializes the translation with the original string. This command is
4118 the original string, disregarding any previous work.
4120 @evindex po-auto-edit-with-msgid@r{, PO Mode variable}
4123 @code{po-auto-edit-with-msgid} to @code{t}, the translation gets
4124 initialised with the original string, in case none exists already.
4125 The default value for @code{po-auto-edit-with-msgid} is @code{nil}.
4127 @emindex starting a string translation
4128 In fact, whether it is best to start a translation with an empty
4129 string, or rather with a copy of the original string, is a matter of
4131 target language are so different that is simply best to start writing
4134 already being written in the original string. A translator may also
4135 like having the original string right under her eyes, as she will
4141 @efindex po-kill-msgstr@r{, PO Mode command}
4143 @efindex po-kill-ring-save-msgstr@r{, PO Mode command}
4144 The command @kbd{k} (@code{po-kill-msgstr}) merely empties the
4145 translation string, so turning the entry into an untranslated
4148 (@code{po-kill-ring-save-msgstr}) has also the effect of taking a
4163 translation string put on the kill ring by the @kbd{k} command is fully
4170 @efindex po-yank-msgstr@r{, PO Mode command}
4171 The command @kbd{y} (@code{po-yank-msgstr}) completely replaces the
4172 translation of the current entry by a string taken from the kill ring.
4174 string is @dfn{yanked} into the PO file buffer.
4182 until she finds the string she really wanted.
4184 When a string is yanked into a PO file entry, it is fully and
4187 push the inserted string inside comments. Once again, translators
4189 course, the necessity of the translated string itself respective to
4194 strings (or the translator comments) automatically saves the old string
4201 programmer slightly modifies some string right in the program, his
4203 of a new untranslated entry for the modified string, and the fact
4204 that the entry translating the original or unmodified string becomes
4215 to the unmodified string. Once found, she uses the @kbd{@key{DEL}} command
4222 then @kbd{m} again, for going on with the next untranslated string.
4255 Interactively edit the translator comments (@code{po-edit-comment}).
4260 (@code{po-kill-comment}).
4265 (@code{po-kill-ring-save-comment}).
4270 (@code{po-yank-comment}).
4282 @efindex po-edit-comment@r{, PO Mode command}
4283 The command @kbd{#} (@code{po-edit-comment}) opens a new Emacs window
4294 @evindex po-subedit-mode-hook@r{, PO Mode variable}
4295 Functions found on @code{po-subedit-mode-hook}, if any, are executed after
4296 the string has been inserted in the edit buffer.
4299 @efindex po-kill-comment@r{, PO Mode command}
4301 @efindex po-kill-ring-save-comment@r{, PO Mode command}
4303 @efindex po-yank-comment@r{, PO Mode command}
4304 The command @kbd{K} (@code{po-kill-comment}) gets rid of all
4306 The command @kbd{W} (@code{po-kill-ring-save-comment}) takes
4309 (@code{po-yank-comment}) completely replaces the translator comments
4310 by a string taken at the front of the kill ring. When this command
4346 Complete edition (@code{po-subedit-exit}).
4350 Abort edition (@code{po-subedit-abort}).
4354 Consult auxiliary PO files (@code{po-subedit-cycle-auxiliary}).
4360 @efindex po-subedit-exit@r{, PO Mode command}
4364 (@code{po-subedit-exit}) may be used to return the edited translation into
4369 @efindex po-subedit-abort@r{, PO Mode command}
4373 (@code{po-subedit-abort}) to merely get rid of edition, while preserving
4379 @efindex po-subedit-cycle-auxiliary@r{, PO Mode command}
4380 The command @w{@kbd{C-c C-a}} (@code{po-subedit-cycle-auxiliary})
4387 Functions found on @code{po-subedit-mode-hook}, if any, are executed after
4388 the string has been inserted in the edit buffer.
4392 the translated string if those are not meant to be there, or to removing
4396 at the end of the string being edited, but this @code{<} is not really
4397 part of the string. On exiting the editing window with @w{@kbd{C-c C-c}},
4400 looses its delimiting property and integrally becomes part of the string.
4401 If she removes the delimiting @code{<}, then the edited string is taken
4403 the translated string ought to end itself with a genuine @code{<}, then
4404 the delimiting @code{<} may not be removed; so the string should appear,
4411 PO file buffer, she may decide to start modifying another entry. Each entry
4434 exactly where the untranslated string appears in the program sources.
4437 often faced with an original string which is not as informative as
4439 Before choosing how to translate the string, she needs to understand
4440 better what the string really means and how tight the translation has
4443 string originated, searching for surrounding comments the programmer
4465 (@code{po-cycle-source-reference}).
4470 (@code{po-select-source-reference}).
4475 (@code{po-consider-source-path}).
4480 (@code{po-ignore-source-path}).
4485 @efindex po-cycle-source-reference@r{, PO Mode command}
4487 @efindex po-select-source-reference@r{, PO Mode command}
4488 The commands @kbd{s} (@code{po-cycle-source-reference}) and @kbd{M-s}
4489 (@code{po-select-source-reference}) both open another window displaying
4491 it shows an actual use of the string to be translated. By doing
4492 so, the command gives source program context for the string. But if
4522 available for a single string to translate.
4525 @efindex po-consider-source-path@r{, PO Mode command}
4527 @efindex po-ignore-source-path@r{, PO Mode command}
4537 The command @kbd{S} (@code{po-consider-source-path}) is used to interactively
4539 @kbd{M-S} (@code{po-ignore-source-path}) is used to select, with completion,
4566 (@code{po-cycle-auxiliary}).
4570 Switch to a particular auxiliary file (@code{po-select-auxiliary}).
4574 Declare this PO file as an auxiliary file (@code{po-consider-as-auxiliary}).
4579 (@code{po-ignore-as-auxiliary}).
4584 @efindex po-consider-as-auxiliary@r{, PO Mode command}
4586 @efindex po-ignore-as-auxiliary@r{, PO Mode command}
4587 Command @kbd{A} (@code{po-consider-as-auxiliary}) adds the current
4589 (@code{po-ignore-as-auxiliary} just removes it.
4592 @efindex po-cycle-auxiliary@r{, PO Mode command}
4593 The command @kbd{a} (@code{po-cycle-auxiliary}) seeks all auxiliary PO
4603 @efindex po-select-auxiliary@r{, PO Mode command}
4604 The command @kbd{C-c C-a} (@code{po-select-auxiliary}) asks the translator
4614 ways for representing the same string, different writing would break the
4660 msgcat -o compendium.po file1.po file2.po
4664 for the same string. Those occurrences will be marked as @code{fuzzy}
4666 @file{file1.po}:
4676 and @file{file2.po}:
4693 "#-#-#-#-# file1.po #-#-#-#-#\n"
4695 "#-#-#-#-# file2.po #-#-#-#-#\n"
4710 msgcat --use-first -o compendium.po file1.po file2.po
4727 msggrep --location src/getopt.c -o compendium.po file.po
4743 msgmerge --compendium compendium.po -o file.po /dev/null file.pot
4754 msgcat --use-first -o update.po compendium1.po compendium2.po file.po
4755 msgmerge update.po file.pot | msgattrib --no-obsolete > file.po
4951 Thus, a command like @samp{msgcat vi.po} will produce colorized output
4953 @samp{msgcat vi.po | less -R}, it will not produce colorized output. To
4955 @samp{msgcat --color vi.po | less -R}.
5018 The default style file is @file{$prefix/share/gettext/styles/po-default.css},
5023 @item po-vim.css
5026 @item po-emacs-x.css
5029 @item po-emacs-xterm.css
5030 @itemx po-emacs-xterm16.css
5031 @itemx po-emacs-xterm256.css
5108 #| msgid @var{previous-untranslated-string}
5109 msgid @var{untranslated-string}
5110 msgstr @var{translated-string}
5143 This matches the comments containing the previous untranslated string (entire
5147 This matches the previous untranslated string including the string delimiters,
5151 This matches the untranslated string including the string delimiters,
5155 This matches the translated string including the string delimiters,
5161 @item .string
5162 This matches strings, including the string delimiters (double quotes).
5170 This matches the entire contents of a string (excluding the string delimiters,
5177 This matches a format string directive (starting with a @samp{%} sign in the
5184 This matches an invalid format string directive.
5187 In an untranslated string, this matches a part of the string that was not
5188 present in the previous untranslated string. (Not yet implemented in this
5192 In an untranslated string or in a previous untranslated string, this matches
5193 a part of the string that is changed or replaced. (Not yet implemented in
5197 In a previous untranslated string, this matches a part of the string that
5198 is not present in the current untranslated string. (Not yet implemented in
5252 msgcat --to-code=UTF-8 --color xyz.po | less -R
5258 less xyz.po
5286 *.po)
5331 The functions are declared in the header file @samp{<gettext-po.h>}, and are
5468 @samp{<gettext-po.h>}.
5479 @samp{<gettext-po.h>}.
5553 English string) of @var{message}. This is guaranteed to be non-@code{NULL}.
5558 (untranslated English string) of @var{message} to the value provided through
5559 @var{msgid}, a non-@code{NULL} string.
5564 (untranslated English plural string) of @var{message}, a message with plurals,
5570 @code{msgid_plural} (untranslated English plural string) of a message to
5578 string.
5584 non-@code{NULL} string.
5606 a multiline string, ending in a newline, or a non-@code{NULL} empty string.
5611 @var{message} to the value @var{comments}, a multiline string, ending in a
5612 newline, or a non-@code{NULL} empty string.
5617 comments of @var{message}, a multiline string, ending in a newline, or a
5618 non-@code{NULL} empty string.
5624 string, ending in a newline, or a non-@code{NULL} empty string.
5642 @code{msgid} (untranslated English string) of @var{message}, or
5648 @code{msgid} (untranslated English string) of @var{message} to the value
5655 @code{msgid_plural} (untranslated English plural string) of
5662 previous @code{msgid_plural} (untranslated English plural string) of a
5690 is marked as being a format string of @var{format_type}.
5717 the empty string as @code{msgid}.
5727 value is either a freshly allocated string, to be freed by the caller,
5732 Returns a freshly allocated string which contains the entry from
5741 This is a pointer type that refers to a string's position within a
5759 Adds a reference to the string from @var{file} starting at
5795 format string if the message is marked as being a format string. If it
5800 the inclusion of @samp{<gettext-po.h>}.
5861 of string descriptors can be found. In both tables, each string
5862 descriptor uses two 32 bits integers, one for the string length,
5863 another for the offset of the string in the MO file, counting in bytes
5864 from the start of the file. The first table contains descriptors
5874 the MO file. This also has another advantage, as the empty string
5877 empty string necessarily becomes the first in both the original and
5891 the length which appears in the string descriptor. The @code{msgfmt}
5893 With this option, each string is separately aligned so it starts at
5899 @key{EOT} byte, and the original string, instead of the original string.
5902 Plural forms are stored by letting the plural of the original string
5903 follow the singular of the original string, separated through a
5904 @key{NUL} byte. The length which appears in the string descriptor
5905 includes both. However, only the singular of the original string
5908 @key{NUL} byte. Here also, the length in the string descriptor
5926 start somewhere, and the MO file format described here is a good start.
5952 O | length & offset 0th string ----------------.
5953 O + 8 | length & offset 1st string ------------------.
5955 O + ((N-1)*8)| length & offset (N-1)th string | | |
5962 H | start hash table | | | | |
5966 | NUL terminated 0th string <----------------' | | |
5968 | NUL terminated 1st string <------------------' | |
6067 char *translation = catgets (catd, set_no, msg_id, "original string");
6084 is @code{char *} the resulting string @emph{must not} be changed. It
6152 perhaps impossible) and b) to access a string in a selected domain.
6164 argument is a null-terminated string, whose characters must be legal in
6182 The translation of the string @var{msgid} is returned if it is available
6268 wide string (in UTF-16 encoding, as usual on Windows).
6348 string containing the name of the selected codeset. The string is
6378 translation lookup is when a translation for a given string is searched,
6379 that is limited to a given context. The translation for the same string
6381 the same string in different contexts can be stored in the in the same
6393 In a call of this macro, @var{msgctxt} and @var{msgid} must be string
6397 The @var{msgctxt} string is visible in the PO file to the translator.
6402 Finding a canonical @var{msgctxt} string that doesn't change over time can
6444 family. But in two places the string passed into the function would be
6478 string literals, more general macros are available:
6492 Here @var{msgctxt} and @var{msgid} can be arbitrary string-valued expressions.
6494 are string literals, the macros without the @samp{_expr} suffix are more
6585 These extra functions are taking instead of the one key string two
6587 the numerical argument and the first string as a key, the implementation
6589 form. The two string arguments then will be used to provide a return
6592 is used and it is assumed that the first string argument is the singular
6607 form of the string to be converted. It is also used as the key for the
6632 are not consumed by the format string.
6634 If this function is meant to yield a format string that takes two or more
6716 header entry of the PO file (the one with the empty @code{msgid} string).
6724 many different plural forms exist for this language. The string
7058 string has to be translated in an inner loop. While this is unavoidable
7059 when the string varies from one run of the loop to the other it is
7060 simply a waste of time when the string is always the same. Take the
7076 string is always the same. One way to use this is:
7114 Only when we come to a string which might be seen by the users and thus
7128 additional characters per translatable string to @emph{3} (in words:
7164 the @file{po/} directory of GNU @code{gettext} knows by default both of the
7169 programmer. Every time he comes to a translatable string he has to
7179 @code{catgets}. If you have a single word in a string and this string
7190 Here we have to translate two times the string @code{"number"}. Even
7210 difficult one can also consider changing one of the conflicting string a
7489 start one, please write to @w{@file{coordinator@@translationproject.org}};
7852 Please start saving somewhere a quick history of each PO file. I know
8016 $ msguniq $HOME/gettextlogused > missing.po
8026 $ sed -n -e 's,^domain "\(.*\)"$,\1,p' < missing.po | sort | uniq
8039 She takes the latest copy of @file{$lang.po} from the Translation Project,
8040 or from the package (in most cases, @file{$package/po/$lang.po}), or
8048 $ msggrep --domain=$domain missing.po | grep -v '^domain' \
8049 > $domain-missing.po
8050 $ msgattrib --set-obsolete --ignore-file $domain-missing.po $domain.$lang.po \
8051 > $domain.$lang-urgent.po
8054 The she translates @file{$domain.$lang-urgent.po} by use of a PO file editor
8062 $ msgmerge --no-fuzzy-matching $domain.$lang-urgent.po $package/po/$domain.pot \
8063 > $domain.$lang.po
8066 Then she can submit @file{$domain.$lang.po} and proceed to the next domain.
8157 tool and the @file{Makefile} in the @file{po/} directory therefore
8181 Your @file{po/} directory should receive all PO files submitted to you
8182 by the translator teams, each having @file{@var{ll}.po} as a name.
8185 Since the cycle has to start somewhere, the easiest for the maintainer
8186 is to start with absolutely no PO files, and wait until various
8198 PO files in @file{po/} for distribution.
8243 * po/POTFILES.in:: @file{POTFILES.in} in @file{po/}
8244 * po/LINGUAS:: @file{LINGUAS} in @file{po/}
8245 * po/Makevars:: @file{Makevars} in @file{po/}
8246 * po/Rules-*:: Extending @file{Makefile} in @file{po/}
8257 @node po/POTFILES.in
8258 @subsection @file{POTFILES.in} in @file{po/}
8261 The @file{po/} directory should receive a file named
8292 it is recommended to list in @file{po/POTFILES.in} the real source file
8296 @node po/LINGUAS
8297 @subsection @file{LINGUAS} in @file{po/}
8300 The @file{po/} directory should also receive a file named
8333 in the @file{po/} directory. You can copy them from GNU gettext's @file{po/}
8336 @node po/Makevars
8337 @subsection @file{Makevars} in @file{po/}
8340 The @file{po/} directory also has a file named @file{Makevars}. It
8341 contains variables that are specific to your project. @file{po/Makevars}
8342 gets inserted into the @file{po/Makefile} when the latter is created.
8347 single message domain and, accordingly, a single @file{po/} directory.
8348 Only packages which have multiple @file{po/} directories at different
8356 @node po/Rules-*
8357 @subsection Extending @file{Makefile} in @file{po/}
8360 All files called @file{Rules-*} in the @file{po/} directory get appended to
8361 the @file{po/Makefile} when it is created. They present an opportunity to
8363 with @file{po/Makefile.in.in}.
8368 building catalogs @file{en@@quot.po} and @file{en@@boldquot.po}. The
8369 effect of @file{en@@quot.po} is that people who set their @code{LANGUAGE}
8373 enable this catalog, simply add @code{en@@quot} to the @file{po/LINGUAS}
8374 file. The effect of @file{en@@boldquot.po} is that people who set
8379 @file{po/LINGUAS} file.
8439 AC_OUTPUT([@var{existing configuration files} po/Makefile.in],
8444 for substitution in the @file{po/} directory.
8445 Note the @samp{.in} suffix used for @file{po/} only. This is because
8446 the distributed file is really @file{po/Makefile.in.in}.
8496 @file{po.m4}, @file{progtest.m4} from GNU @code{gettext}'s @file{m4/}
8511 @file{lib-prefix.m4}, @file{nls.m4}, @file{po.m4}, @file{progtest.m4} from
8579 you also process the subdirectory @samp{po}. Special
8593 SUBDIRS = doc lib src po
8597 A delicate point is the @samp{dist:} goal, as @file{po/Makefile} will later
8849 * AM_PO_SUBDIRS:: AM_PO_SUBDIRS in @file{po.m4}
8850 * AM_XGETTEXT_OPTION:: AM_XGETTEXT_OPTION in @file{po.m4}
8861 @code{AM_PO_SUBDIRS}, thus preparing the @file{po/} directories of the
8968 @subsection AM_PO_SUBDIRS in @file{po.m4}
8971 The @code{AM_PO_SUBDIRS} macro prepares the @file{po/} directories of the
8981 variables in each @file{po/} directory.
8984 @subsection AM_XGETTEXT_OPTION in @file{po.m4}
8988 used in the invocations of @code{xgettext} in the @file{po/} directories
8992 @samp{error_at_line} whose fifth argument is a format string, you can use
9004 @samp{XGETTEXT_OPTIONS} variable in @file{po/Makevars}.
9118 from @code{@var{parser}.y}, or @code{po/Makefile.in.in} autoinstalled
9225 file and do @code{make update-po} manually.
9260 $ (cd po; make update-po)
9285 Internationalized packages have usually many @file{@var{ll}.po}
9324 example, in C we use the syntax @code{_("string")}, and in GNU awk we use
9325 the shorthand @code{_"string"}.
9328 You should arrange that evaluation of such a translatable string at
9371 What does a string literal look like? What escape characters exist
9372 inside a string?
9385 If the string extractor is best integrated into your language's parser,
9386 GNU @code{xgettext} can function as a front end to your string extractor.
9389 The language's library should have a string formatting facility.
9393 There must be a way, in the format string, to denote the arguments by a
9403 Based on this, the GNU @code{gettext} maintainers can add a format string
9406 format string.
9420 your language to @file{po-mode.el}.
9449 @code{xgettext} string extractor recognizes other languages based on the
9533 untranslated string. (Putting the @samp{I} format directive flag into an
9534 @var{msgid} string would lead to undefined behaviour on platforms without
9557 @uref{https://docs.python.org/2/library/stdtypes.html#string-formatting-operations}.
9594 Node.JS. In such a format string, a directive starts with @samp{%}
9596 sign, @samp{c} denotes a character, @samp{s} denotes a string,
9666 ASCII characters, not start with a digit and be nonempty; otherwise such
9680 @uref{https://www.lua.org/manual/5.1/manual.html#pdf-string.format}.
9705 directive cannot occur more than once in a format string.
9727 string, through XML markup tags. For example, if the first format
9728 directive in a string is a filename, programmers could indicate that
9740 In summary, a directive has either the same syntax as in a C format string,
9779 string, a directive starts with @samp{%}, is optionally followed by a
9782 percent sign, @samp{c} denotes a character, @samp{s} denotes a string,
9784 denote an unsigned integer, @samp{.*s} denotes a string preceded by a
9798 string, a directive starts with @samp{%} and is finished by a
9801 denotes a character, @samp{s} denotes a string, @samp{i} and @samp{d}
9823 variable in @file{po/Makevars} (@pxref{po/Makevars}) should be adjusted to
9827 in @file{po/Makefile.in.in}. It is recommended to make one @code{xgettext}
9977 @item po-mode marking
10019 @code{pot}, @code{po}
10030 RST is the format of resource string table files of the Free Pascal compiler
10031 versions older than 3.0.0. RSJ is the new format of resource string table
10182 <p>A translatable string</p>
10185 <p translatable="no">A non-translatable string</p>
10190 To extract the first text content ("A translatable string"), but not the
10191 second ("A non-translatable string"), the following ITS rules can be used:
10318 @code{po}
10420 @code{xgettext} (usually by listing the template in @code{po/POTFILES.in}).