From: Bruno Haible Date: Sun, 2 Sep 2007 10:42:12 +0000 (+0000) Subject: Add some examples. X-Git-Tag: v0.17~261 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c18cec611ad01297b62220ba4c764ab4d5896176;p=thirdparty%2Fgettext.git Add some examples. --- diff --git a/gettext-tools/doc/ChangeLog b/gettext-tools/doc/ChangeLog index 82d6e0b73..a251ebf24 100644 --- a/gettext-tools/doc/ChangeLog +++ b/gettext-tools/doc/ChangeLog @@ -1,3 +1,9 @@ +2007-09-02 Bruno Haible + + * msggrep.texi: Add some examples. + * msgfilter.texi: Likewise. + Suggested by Guido at . + 2007-09-02 Bruno Haible Implement msgctxt for C# ResourceManagers. diff --git a/gettext-tools/doc/msgfilter.texi b/gettext-tools/doc/msgfilter.texi index 1e2b3b37e..daa9d47ef 100644 --- a/gettext-tools/doc/msgfilter.texi +++ b/gettext-tools/doc/msgfilter.texi @@ -219,3 +219,17 @@ Display this help and exit. Output version information and exit. @end table + +@subsection Examples + +To convert German translations to Swiss orthography (in an UTF-8 locale): + +@smallexample +msgconv -t UTF-8 de.po | msgfilter sed -e 's/@ss{}/ss/g' +@end smallexample + +To convert Serbian translations in Cyrillic script to Latin script: + +@smallexample +msgfilter recode-sr-latin sr.po +@end smallexample diff --git a/gettext-tools/doc/msggrep.texi b/gettext-tools/doc/msggrep.texi index 8c21a492c..34df18622 100644 --- a/gettext-tools/doc/msggrep.texi +++ b/gettext-tools/doc/msggrep.texi @@ -44,7 +44,7 @@ or if it is @samp{-}. @example [-N @var{sourcefile}]... [-M @var{domainname}]... - [-J @var{msgctxt-pattern} [-K @var{msgid-pattern}] [-T @var{msgstr-pattern}] + [-J @var{msgctxt-pattern}] [-K @var{msgid-pattern}] [-T @var{msgstr-pattern}] [-C @var{comment-pattern}] @end example @@ -65,7 +65,7 @@ A message is selected if When more than one selection criterion is specified, the set of selected messages is the union of the selected messages of each criterion. -@var{msgid-pattern} or @var{msgstr-pattern} syntax: +@var{msgctxt-pattern} or @var{msgid-pattern} or @var{msgstr-pattern} syntax: @example [-E | -F] [-e @var{pattern} | -f @var{file}]... @end example @@ -253,3 +253,33 @@ Display this help and exit. Output version information and exit. @end table + +@subsection Examples + +To extract the messages that come from the source files +@code{gnulib-lib/error.c} and @code{gnulib-lib/getopt.c}: + +@smallexample +msggrep -N gnulib-lib/error.c -N gnulib-lib/getopt.c input.po +@end smallexample + +To extract the messages that contain the string ``Please specify'' in the +original string: + +@smallexample +msggrep --msgid -F -e 'Please specify' input.po +@end smallexample + +To extract the messages that have a context specifier of either ``Menu>File'' +or ``Menu>Edit'' or a submenu of them: + +@smallexample +msggrep --msgctxt -E -e '^Menu>(File|Edit)' input.po +@end smallexample + +To extract the messages whose translation contains one of the strings in the +file @code{wordlist.txt}: + +@smallexample +msggrep --msgstr -F -f wordlist.txt input.po +@end smallexample