From: Bruno Haible Date: Mon, 3 Apr 2006 11:20:33 +0000 (+0000) Subject: Document the default keywords. X-Git-Tag: v0.15~263 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ed1b88435b4fca7e936325fd6473359a0af2aac;p=thirdparty%2Fgettext.git Document the default keywords. --- diff --git a/gettext-tools/doc/ChangeLog b/gettext-tools/doc/ChangeLog index f816739f2..2ebf28b6d 100644 --- a/gettext-tools/doc/ChangeLog +++ b/gettext-tools/doc/ChangeLog @@ -1,3 +1,8 @@ +2006-04-01 Bruno Haible + + * xgettext.texi (--keyword): Document the default keywords. + Suggested by Bjoern Voigt . + 2006-03-28 Bruno Haible * msgfilter.texi: Explain built-in filters and recode-sr-latin. diff --git a/gettext-tools/doc/xgettext.texi b/gettext-tools/doc/xgettext.texi index e8e2b00ed..f5eeccbc1 100644 --- a/gettext-tools/doc/xgettext.texi +++ b/gettext-tools/doc/xgettext.texi @@ -176,17 +176,77 @@ extracting a message from the specified argument strings, adds an extracted comment @var{xcomment} to the message. Note that when used through a normal shell command line, the double-quotes around the @var{xcomment} need to be escaped. -@* + +This option has an effect with most languages, namely C, C++, ObjectiveC, +Shell, Python, Lisp, EmacsLisp, librep, Java, C#, awk, Tcl, Perl, PHP, +GCC-source, Glade. + The default keyword specifications, which are always looked for if not -explicitly disabled, are @code{gettext}, @code{dgettext:2}, +explicitly disabled, are language dependent. They are: + +@itemize +@item +For C, C++, and GCC-source: @code{gettext}, @code{dgettext:2}, @code{dcgettext:2}, @code{ngettext:1,2}, @code{dngettext:2,3}, @code{dcngettext:2,3}, @code{gettext_noop}, and @code{pgettext:1c,2}, @code{dpgettext:2c,3}, @code{dcpgettext:2c,3}, @code{npgettext:1c,2,3}, @code{dnpgettext:2c,3,4}, @code{dcnpgettext:2c,3,4}. -@* -This option has an effect with most languages, namely C, C++, ObjectiveC, -Shell, Python, Lisp, EmacsLisp, librep, Java, C#, awk, Tcl, Perl, PHP, -GCC-source, Glade. + +@item +For Objective C: Like for C, and also @code{NSLocalizedString}, @code{_}, +@code{NSLocalizedStaticString}, @code{__}. + +@item +For Shell scripts: @code{gettext}, @code{ngettext:1,2}, @code{eval_gettext}, +@code{eval_ngettext:1,2}. + +@item +For Python: @code{gettext}, @code{ugettext}, @code{dgettext:2}, +@code{ngettext:1,2}, @code{ungettext:1,2}, @code{dngettext:2,3}, @code{_}. + +@item +For Lisp: @code{gettext}, @code{ngettext:1,2}, @code{gettext-noop}. + +@item +For EmacsLisp: @code{_}. + +@item +For librep: @code{_}. + +@item +For Scheme: @code{gettext}, @code{ngettext:1,2}, @code{gettext-noop}. + +@item +For Java: @code{GettextResource.gettext:2}, +@code{GettextResource.ngettext:2,3}, @code{gettext}, @code{ngettext:1,2}, +@code{getString}. + +@item +For C#: @code{GetString}, @code{GetPluralString:1,2}. + +@item +For awk: @code{dcgettext}, @code{dcngettext:1,2}. + +@item +For Tcl: @code{::msgcat::mc}. + +@item +For Perl: @code{gettext}, @code{%gettext}, @code{$gettext}, @code{dgettext:2}, +@code{dcgettext:2}, @code{ngettext:1,2}, @code{dngettext:2,3}, +@code{dcngettext:2,3}, @code{gettext_noop}. + +@item +For PHP: @code{_}, @code{gettext}, @code{dgettext:2}, @code{dcgettext:2}, +@code{ngettext:1,2}, @code{dngettext:2,3}, @code{dcngettext:2,3}. + +@item +For Glade 1: @code{label}, @code{title}, @code{text}, @code{format}, +@code{copyright}, @code{comments}, @code{preview_text}, @code{tooltip}. +@end itemize + +To disable the default keyword specifications, the option @samp{-k} or +@samp{--keyword} or @samp{--keyword=}, without a @var{keywordspec}, can be +used. @item --flag=@var{word}:@var{arg}:@var{flag} @opindex --flag@r{, @code{xgettext} option} diff --git a/gettext-tools/src/x-awk.c b/gettext-tools/src/x-awk.c index ac0347cba..50d74993d 100644 --- a/gettext-tools/src/x-awk.c +++ b/gettext-tools/src/x-awk.c @@ -1,5 +1,5 @@ /* xgettext awk backend. - Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc. This file was written by Bruno Haible , 2002. @@ -90,6 +90,8 @@ init_keywords () { if (default_keywords) { + /* When adding new keywords here, also update the documentation in + xgettext.texi! */ x_awk_keyword ("dcgettext"); x_awk_keyword ("dcngettext:1,2"); default_keywords = false; diff --git a/gettext-tools/src/x-c.c b/gettext-tools/src/x-c.c index 31d48c6a7..4e1631209 100644 --- a/gettext-tools/src/x-c.c +++ b/gettext-tools/src/x-c.c @@ -147,6 +147,8 @@ init_keywords () { if (default_keywords) { + /* When adding new keywords here, also update the documentation in + xgettext.texi! */ x_c_keyword ("gettext"); x_c_keyword ("dgettext:2"); x_c_keyword ("dcgettext:2"); diff --git a/gettext-tools/src/x-csharp.c b/gettext-tools/src/x-csharp.c index cbdb19950..4d87cb997 100644 --- a/gettext-tools/src/x-csharp.c +++ b/gettext-tools/src/x-csharp.c @@ -1,5 +1,5 @@ /* xgettext C# backend. - Copyright (C) 2003, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify @@ -99,6 +99,8 @@ init_keywords () { if (default_keywords) { + /* When adding new keywords here, also update the documentation in + xgettext.texi! */ x_csharp_keyword ("GetString"); /* Resource{Manager,Set}.GetString */ x_csharp_keyword ("GetPluralString:1,2"); /* GettextResource{Manager,Set}.GetPluralString */ default_keywords = false; diff --git a/gettext-tools/src/x-elisp.c b/gettext-tools/src/x-elisp.c index c93854aa9..df00643fa 100644 --- a/gettext-tools/src/x-elisp.c +++ b/gettext-tools/src/x-elisp.c @@ -1,5 +1,5 @@ /* xgettext Emacs Lisp backend. - Copyright (C) 2001-2003, 2005 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2006 Free Software Foundation, Inc. This file was written by Bruno Haible , 2001-2002. @@ -105,6 +105,8 @@ init_keywords () { if (default_keywords) { + /* When adding new keywords here, also update the documentation in + xgettext.texi! */ x_elisp_keyword ("_"); default_keywords = false; } diff --git a/gettext-tools/src/x-glade.c b/gettext-tools/src/x-glade.c index cf6bc615b..7754ec758 100644 --- a/gettext-tools/src/x-glade.c +++ b/gettext-tools/src/x-glade.c @@ -1,5 +1,5 @@ /* xgettext glade backend. - Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc. This file was written by Bruno Haible , 2002. @@ -91,6 +91,8 @@ init_keywords () { if (default_keywords) { + /* When adding new keywords here, also update the documentation in + xgettext.texi! */ x_glade_keyword ("label"); x_glade_keyword ("title"); x_glade_keyword ("text"); diff --git a/gettext-tools/src/x-java.c b/gettext-tools/src/x-java.c index c11392870..34064d498 100644 --- a/gettext-tools/src/x-java.c +++ b/gettext-tools/src/x-java.c @@ -1,5 +1,5 @@ /* xgettext Java backend. - Copyright (C) 2003, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify @@ -97,6 +97,8 @@ init_keywords () { if (default_keywords) { + /* When adding new keywords here, also update the documentation in + xgettext.texi! */ x_java_keyword ("GettextResource.gettext:2"); /* static method */ x_java_keyword ("GettextResource.ngettext:2,3"); /* static method */ x_java_keyword ("gettext"); diff --git a/gettext-tools/src/x-librep.c b/gettext-tools/src/x-librep.c index 1a88998bc..6705ced3c 100644 --- a/gettext-tools/src/x-librep.c +++ b/gettext-tools/src/x-librep.c @@ -1,5 +1,5 @@ /* xgettext librep backend. - Copyright (C) 2001-2003, 2005 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2006 Free Software Foundation, Inc. This file was written by Bruno Haible , 2001. @@ -107,6 +107,8 @@ init_keywords () { if (default_keywords) { + /* When adding new keywords here, also update the documentation in + xgettext.texi! */ x_librep_keyword ("_"); default_keywords = false; } diff --git a/gettext-tools/src/x-lisp.c b/gettext-tools/src/x-lisp.c index 19f307361..35416ee78 100644 --- a/gettext-tools/src/x-lisp.c +++ b/gettext-tools/src/x-lisp.c @@ -1,5 +1,5 @@ /* xgettext Lisp backend. - Copyright (C) 2001-2003, 2005 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2006 Free Software Foundation, Inc. This file was written by Bruno Haible , 2001. @@ -167,6 +167,8 @@ init_keywords () { if (default_keywords) { + /* When adding new keywords here, also update the documentation in + xgettext.texi! */ x_lisp_keyword ("gettext"); /* I18N:GETTEXT */ x_lisp_keyword ("ngettext:1,2"); /* I18N:NGETTEXT */ x_lisp_keyword ("gettext-noop"); diff --git a/gettext-tools/src/x-perl.c b/gettext-tools/src/x-perl.c index 10b933729..3dfea728e 100644 --- a/gettext-tools/src/x-perl.c +++ b/gettext-tools/src/x-perl.c @@ -97,6 +97,8 @@ init_keywords () { if (default_keywords) { + /* When adding new keywords here, also update the documentation in + xgettext.texi! */ x_perl_keyword ("gettext"); x_perl_keyword ("%gettext"); x_perl_keyword ("$gettext"); diff --git a/gettext-tools/src/x-php.c b/gettext-tools/src/x-php.c index 90a336067..77c2b67a8 100644 --- a/gettext-tools/src/x-php.c +++ b/gettext-tools/src/x-php.c @@ -94,6 +94,8 @@ init_keywords () { if (default_keywords) { + /* When adding new keywords here, also update the documentation in + xgettext.texi! */ x_php_keyword ("_"); x_php_keyword ("gettext"); x_php_keyword ("dgettext:2"); diff --git a/gettext-tools/src/x-python.c b/gettext-tools/src/x-python.c index b256a6d76..87b49db15 100644 --- a/gettext-tools/src/x-python.c +++ b/gettext-tools/src/x-python.c @@ -1,5 +1,5 @@ /* xgettext Python backend. - Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc. This file was written by Bruno Haible , 2002. @@ -107,6 +107,8 @@ init_keywords () { if (default_keywords) { + /* When adding new keywords here, also update the documentation in + xgettext.texi! */ x_python_keyword ("gettext"); x_python_keyword ("ugettext"); x_python_keyword ("dgettext:2"); diff --git a/gettext-tools/src/x-scheme.c b/gettext-tools/src/x-scheme.c index d678b1f43..9b33efba0 100644 --- a/gettext-tools/src/x-scheme.c +++ b/gettext-tools/src/x-scheme.c @@ -1,5 +1,5 @@ /* xgettext Scheme backend. - Copyright (C) 2004-2005 Free Software Foundation, Inc. + Copyright (C) 2004-2006 Free Software Foundation, Inc. This file was written by Bruno Haible , 2004-2005. @@ -126,6 +126,8 @@ init_keywords () { if (default_keywords) { + /* When adding new keywords here, also update the documentation in + xgettext.texi! */ x_scheme_keyword ("gettext"); /* libguile/i18n.c */ x_scheme_keyword ("ngettext:1,2"); /* libguile/i18n.c */ x_scheme_keyword ("gettext-noop"); diff --git a/gettext-tools/src/x-sh.c b/gettext-tools/src/x-sh.c index 07e5d9d26..45bef34b4 100644 --- a/gettext-tools/src/x-sh.c +++ b/gettext-tools/src/x-sh.c @@ -1,5 +1,5 @@ /* xgettext sh backend. - Copyright (C) 2003, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify @@ -108,6 +108,8 @@ init_keywords () { if (default_keywords) { + /* When adding new keywords here, also update the documentation in + xgettext.texi! */ x_sh_keyword ("gettext"); x_sh_keyword ("ngettext:1,2"); x_sh_keyword ("eval_gettext"); diff --git a/gettext-tools/src/x-tcl.c b/gettext-tools/src/x-tcl.c index 3271fdcce..301467b2f 100644 --- a/gettext-tools/src/x-tcl.c +++ b/gettext-tools/src/x-tcl.c @@ -1,5 +1,5 @@ /* xgettext Tcl backend. - Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc. This file was written by Bruno Haible , 2002. @@ -110,6 +110,8 @@ init_keywords () { if (default_keywords) { + /* When adding new keywords here, also update the documentation in + xgettext.texi! */ x_tcl_keyword ("::msgcat::mc"); default_keywords = false; }