From: Bruno Haible Date: Fri, 20 Oct 2006 13:29:58 +0000 (+0000) Subject: Explain the syntax that xgettext understands. X-Git-Tag: 0.16.x-branchpoint~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73d9fc78d55e20be296f136d67fa78e22b61af56;p=thirdparty%2Fgettext.git Explain the syntax that xgettext understands. --- diff --git a/gettext-tools/doc/ChangeLog b/gettext-tools/doc/ChangeLog index aee3b8625..42307c0dd 100644 --- a/gettext-tools/doc/ChangeLog +++ b/gettext-tools/doc/ChangeLog @@ -1,3 +1,8 @@ +2006-10-20 Bruno Haible + + * gettext.texi (Mark Keywords): Explain the syntax that xgettext + understands. Fix example of a non-translatable string. + 2006-10-19 Paul Eggert * gettext.texi (Mark Keywords): keyword are -> keyword is. diff --git a/gettext-tools/doc/gettext.texi b/gettext-tools/doc/gettext.texi index 309143537..69578511b 100644 --- a/gettext-tools/doc/gettext.texi +++ b/gettext-tools/doc/gettext.texi @@ -1962,11 +1962,25 @@ it does not offer it officially. The real, genuine keyword is truly @noindent instead of merely using @samp{#include }. +The marking keywords @samp{gettext} and @samp{_} take the translatable +string as sole argument. It is also possible to define marking functions +that take it at another argument position. It is even possible to make +the marked argument position depend on the total number of arguments of +the function call; this is useful in C++. All this is achieved using +@code{xgettext}'s @samp{--keyword} option. + +Note also that long strings can be split across lines, into multiple +adjacent string tokens. Automatic string concatenation is performed +at compile time according to ISO C and ISO C++; @code{xgettext} also +supports this syntax. + Later on, the maintenance is relatively easy. If, as a programmer, you add or modify a string, you will have to ask yourself if the new or altered string requires translation, and include it within -@samp{_()} if you think it should be translated. @samp{"%s: %d"} is -an example of string @emph{not} requiring translation! +@samp{_()} if you think it should be translated. For example, @samp{"%s"} +is an example of string @emph{not} requiring translation. But +@samp{"%s: %d"} @emph{does} require translation, because in French, unlike +in English, it's customary to put a space before a colon. @node Marking, c-format Flag, Mark Keywords, Sources @section Marking Translatable Strings