Make it possible to tell wxXmlResource which domain to pull
translatable strings from. Make the wxLocale::GetString methods virtual so they can be overridden in derived classes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40728 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1536,15 +1536,19 @@ This function is deprecated, use \helpref{wxString}{wxstring} class instead.
|
||||
|
||||
\membersection{::wxGetTranslation}\label{wxgettranslation}
|
||||
|
||||
\func{const char *}{wxGetTranslation}{\param{const char * }{str}}
|
||||
\func{const wxChar *}{wxGetTranslation}{\param{const wxChar* }{str},
|
||||
\param{const wxChar* }{domain = NULL}}
|
||||
|
||||
\func{const char *}{wxGetTranslation}{\param{const char * }{str}, \param{const char * }{strPlural}, \param{size\_t }{n}}
|
||||
\func{const wxChar *}{wxGetTranslation}{\param{const wxChar* }{str}, \param{const wxChar* }{strPlural}, \param{size\_t }{n},
|
||||
\param{const wxChar* }{domain = NULL}}}
|
||||
|
||||
This function returns the translation of string {\it str} in the current
|
||||
\helpref{locale}{wxlocale}. If the string is not found in any of the loaded
|
||||
message catalogs (see \helpref{internationalization overview}{internationalization}), the
|
||||
original string is returned. In debug build, an error message is logged -- this
|
||||
should help to find the strings which were not yet translated. As this function
|
||||
should help to find the strings which were not yet translated. If
|
||||
{\it domain} is specified then only that domain/catalog is searched
|
||||
for a matching string. As this function
|
||||
is used very often, an alternative (and also common in Unix world) syntax is
|
||||
provided: the \helpref{\_()}{underscore} macro is defined to do the same thing
|
||||
as wxGetTranslation.
|
||||
|
@@ -35,7 +35,9 @@ enum wxXmlResourceFlags
|
||||
|
||||
\membersection{wxXmlResource::wxXmlResource}\label{wxxmlresourcector}
|
||||
|
||||
\func{}{wxXmlResource}{\param{const wxString\& }{filemask}, \param{int }{flags = wxXRC\_USE\_LOCALE}}
|
||||
\func{}{wxXmlResource}{\param{const wxString\& }{filemask},
|
||||
\param{int }{flags = wxXRC\_USE\_LOCALE},
|
||||
\param{const wxString& }{domain = wxEmptyString}}
|
||||
|
||||
Constructor.
|
||||
|
||||
@@ -46,7 +48,13 @@ load all resource files inside a zip archive.}
|
||||
wxXRC\_NO\_SUBCLASSING: subclass property of object nodes will be ignored
|
||||
(useful for previews in XRC editors).}
|
||||
|
||||
\func{}{wxXmlResource}{\param{int }{flags = wxXRC\_USE\_LOCALE}}
|
||||
\docparam{domain}{The name of the gettext catalog to search for
|
||||
translatable strings. By default all loaded catalogs will be
|
||||
searched. This provides a way to allow the strings to only come
|
||||
from a specific catalog.}
|
||||
|
||||
\func{}{wxXmlResource}{\param{int }{flags = wxXRC\_USE\_LOCALE},
|
||||
\param{const wxString& }{domain = wxEmptyString}}
|
||||
|
||||
Constructor.
|
||||
|
||||
@@ -56,6 +64,11 @@ wxXRC\_NO\_SUBCLASSING: subclass property of object nodes will be ignored
|
||||
XRC files from being reloaded from disk in case they have been modified there
|
||||
since being last loaded (may slightly speed up loading them).}
|
||||
|
||||
\docparam{domain}{The name of the gettext catalog to search for
|
||||
translatable strings. By default all loaded catalogs will be
|
||||
searched. This provides a way to allow the strings to only come
|
||||
from a specific catalog.}
|
||||
|
||||
|
||||
\membersection{wxXmlResource::\destruct{wxXmlResource}}\label{wxxmlresourcedtor}
|
||||
|
||||
@@ -254,3 +267,19 @@ This function unloads a resource previously loaded by
|
||||
Returns \true if the resource was successfully unloaded and \false if it hasn't
|
||||
been found in the list of loaded resources.
|
||||
|
||||
|
||||
|
||||
\membersection{wxXmlResource::GetDomain}\label{wxxmlresourcegetdomain}
|
||||
|
||||
\func{wxChar*}{GetDomain}{}
|
||||
|
||||
Returns the domain (message catalog) that will be used to load
|
||||
translatable strings in the XRC.
|
||||
|
||||
|
||||
\membersection{wxXmlResource::SetDomain}\label{wxxmlresourcesetdomain}
|
||||
|
||||
\func{wxChar*}{SetDomain}{\param{const wxChar* }{domain}}
|
||||
|
||||
Sets the domain (message catalog) that will be used to load
|
||||
translatable strings in the XRC.
|
||||
|
Reference in New Issue
Block a user