X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6f80247a06535977aec8e9f0b8cf24104473fbb4..f973828cd9b31d3b80386fab5e6f7c4a106d97fc:/docs/latex/wx/locale.tex diff --git a/docs/latex/wx/locale.tex b/docs/latex/wx/locale.tex index 151f4c65e5..64264e5418 100644 --- a/docs/latex/wx/locale.tex +++ b/docs/latex/wx/locale.tex @@ -9,6 +9,7 @@ of the strings used to the current language. \perlnote{In wxPerl you can't use the '\_' function name, so the {\tt Wx::Locale} module can export the {\tt gettext} and {\tt gettext\_noop} under any given name. + \begin{verbatim} # this imports gettext ( equivalent to Wx::GetTranslation # and gettext_noop ( a noop ) @@ -22,9 +23,11 @@ the {\tt Wx::Locale} module can export the {\tt gettext} and button = Wx::Button->new( window, -1, gettext( ``Label'' ) ); \end{verbatim} + If you need to translate a lot of strings, then adding gettext( ) around each one is a long task ( that is why \_( ) was introduced ), so just choose a shorter name for gettext: + \begin{verbatim} # use Wx::Locale 'gettext' => 't', @@ -37,7 +40,7 @@ a shorter name for gettext: # ... \end{verbatim} -} +}% \wxheading{Derived from} @@ -485,8 +488,14 @@ a string is not found; use \helpref{wxLogNull}{wxlogoverview} to suppress it). The second form is used when retrieving translation of string that has different singular and plural form in English or different plural forms in some -other language. \arg{szOrigString2} is plural form of the string in English and -\arg{n} is used to determine the plural form. +other language. It takes two extra arguments: \arg{szOrigString} +parameter must contain the singular form of the string to be converted. +It is also used as the key for the search in the catalog. +The \arg{szOrigString2} parameter is the plural form (in English). +The parameter \arg{n} is used to determine the plural form. If no +message catalog is found \arg{szOrigString} is returned if `n == 1', +otherwise \arg{szOrigString2}. +See \urlref{GNU gettext manual}{http://www.gnu.org/manual/gettext/html\_chapter/gettext\_10.html\#SEC150} for additional information on plural forms handling. \wxheading{Remarks}