]>
Commit | Line | Data |
---|---|---|
c1b7dab0 VZ |
1 | \section{\class{wxLocale}}\label{wxlocale} |
2 | ||
dbdb39b2 JS |
3 | wxLocale class encapsulates all language-dependent settings and is a |
4 | generalization of the C locale concept. | |
c1b7dab0 | 5 | |
fc2171bd | 6 | In wxWidgets this class manages message catalogs which contain the translations |
c1b7dab0 VZ |
7 | of the strings used to the current language. |
8 | ||
0a67eeac MB |
9 | \perlnote{In wxPerl you can't use the '\_' function name, so |
10 | the {\tt Wx::Locale} module can export the {\tt gettext} and | |
11 | {\tt gettext\_noop} under any given name. | |
d2c2afc9 | 12 | |
5873607e | 13 | \begin{verbatim} |
0a67eeac MB |
14 | # this imports gettext ( equivalent to Wx::GetTranslation |
15 | # and gettext_noop ( a noop ) | |
16 | # into your module | |
17 | use Wx::Locale qw(:default); | |
5873607e VZ |
18 | |
19 | # .... | |
20 | ||
0a67eeac MB |
21 | # use the functions |
22 | print gettext( ``Panic!'' ); | |
5873607e | 23 | |
0a67eeac MB |
24 | button = Wx::Button->new( window, -1, gettext( ``Label'' ) ); |
25 | \end{verbatim} | |
d2c2afc9 | 26 | |
0a67eeac MB |
27 | If you need to translate a lot of strings, then adding gettext( ) around |
28 | each one is a long task ( that is why \_( ) was introduced ), so just choose | |
29 | a shorter name for gettext: | |
d2c2afc9 | 30 | |
0a67eeac MB |
31 | \begin{verbatim} |
32 | # | |
33 | use Wx::Locale 'gettext' => 't', | |
34 | 'gettext_noop' => 'gettext_noop'; | |
35 | ||
36 | # ... | |
37 | ||
38 | # use the functions | |
39 | print t( ``Panic!!'' ); | |
40 | ||
41 | # ... | |
5873607e | 42 | \end{verbatim} |
d2c2afc9 | 43 | }% |
5873607e | 44 | |
c1b7dab0 VZ |
45 | \wxheading{Derived from} |
46 | ||
47 | No base class | |
48 | ||
ed93168b VZ |
49 | \wxheading{See also} |
50 | ||
5db9e0e8 VZ |
51 | \helpref{Internationalization overview}{internationalization},\\ |
52 | \helpref{Internat sample}{sampleinternat} | |
ed93168b | 53 | |
dbdb39b2 JS |
54 | \wxheading{Include files} |
55 | ||
56 | <wx/intl.h> | |
57 | ||
8ec77cd7 | 58 | |
c1b7dab0 VZ |
59 | \latexignore{\rtfignore{\wxheading{Members}}} |
60 | ||
8ec77cd7 | 61 | |
f0ab09cc | 62 | |
8ec77cd7 VS |
63 | \membersection{Supported languages}\label{wxlanguage} |
64 | ||
429ffcc4 VS |
65 | See \helpref{list of recognized language constants}{languagecodes}. |
66 | These constants may be used to specify the language | |
8ec77cd7 VS |
67 | in \helpref{Init}{wxlocaleinit} and are returned by |
68 | \helpref{GetSystemLanguage}{wxlocalegetsystemlanguage}: | |
69 | ||
41780009 | 70 | |
c1b7dab0 VZ |
71 | \membersection{wxLocale::wxLocale}\label{wxlocaledefctor} |
72 | ||
73 | \func{}{wxLocale}{\void} | |
74 | ||
75 | This is the default constructor and it does nothing to initialize the object: | |
dbdb39b2 | 76 | \helpref{Init()}{wxlocaleinit} must be used to do that. |
c1b7dab0 | 77 | |
8ec77cd7 VS |
78 | \func{}{wxLocale}{\param{int }{language}, \param{int }{flags = |
79 | wxLOCALE\_LOAD\_DEFAULT | wxLOCALE\_CONV\_ENCODING}} | |
80 | ||
81 | See \helpref{Init()}{wxlocaleinit} for parameters description. | |
82 | ||
31b7522e | 83 | \func{}{wxLocale}{\param{const wxString\& }{name}, \param{const wxString\& }{short = wxEmptyString}, \param{const wxString\& }{locale = wxEmptyString}, \param{bool }{bLoadDefault = true}, \param{bool }{bConvertEncoding = false}} |
c1b7dab0 | 84 | |
8ec77cd7 | 85 | See \helpref{Init()}{wxlocaleinit} for parameters description. |
c1b7dab0 VZ |
86 | |
87 | The call of this function has several global side effects which you should | |
88 | understand: first of all, the application locale is changed - note that this | |
89 | will affect many of standard C library functions such as printf() or strftime(). | |
90 | Second, this wxLocale object becomes the new current global locale for the | |
91 | application and so all subsequent calls to wxGetTranslation() will try to | |
92 | translate the messages using the message catalogs for this locale. | |
93 | ||
8ec77cd7 | 94 | |
f0ab09cc | 95 | |
c1b7dab0 VZ |
96 | \membersection{wxLocale::\destruct{wxLocale}}\label{wxlocaledtor} |
97 | ||
98 | \func{}{\destruct{wxLocale}}{\void} | |
99 | ||
dbdb39b2 | 100 | The destructor, like the constructor, also has global side effects: the previously |
c1b7dab0 VZ |
101 | set locale is restored and so the changes described in |
102 | \helpref{Init}{wxlocaleinit} documentation are rolled back. | |
103 | ||
f0ab09cc | 104 | |
c1b7dab0 VZ |
105 | \membersection{wxLocale::AddCatalog}\label{wxlocaleaddcatalog} |
106 | ||
31b7522e | 107 | \func{bool}{AddCatalog}{\param{const wxString\& }{domain}} |
c1b7dab0 | 108 | |
31b7522e | 109 | \func{bool}{AddCatalog}{\param{const wxString\& }{domain}, \param{wxLanguage}{msgIdLanguage}, \param{const wxString\& }{msgIdCharset}} |
d721baa9 | 110 | |
f6bcfd97 | 111 | Add a catalog for use with the current locale: it is searched for in standard |
dbdb39b2 | 112 | places (current directory first, then the system one), but you may also prepend |
c1b7dab0 | 113 | additional directories to the search path with |
dbdb39b2 | 114 | \helpref{AddCatalogLookupPathPrefix()}{wxlocaleaddcataloglookuppathprefix}. |
c1b7dab0 | 115 | |
d721baa9 VS |
116 | All loaded catalogs will be used for message lookup by |
117 | \helpref{GetString()}{wxlocalegetstring} for the current locale. | |
c1b7dab0 | 118 | |
cc81d32f | 119 | Returns true if catalog was successfully loaded, false otherwise (which might |
c1b7dab0 VZ |
120 | mean that the catalog is not found or that it isn't in the correct format). |
121 | ||
d721baa9 VS |
122 | The second form of this method takes two additional arguments, |
123 | \arg{msgIdLanguage} and \arg{msgIdCharset}. | |
124 | ||
125 | \arg{msgIdLanguage} specifies the language of "msgid" strings in source code | |
126 | (i.e. arguments to \helpref{GetString}{wxlocalegetstring}, | |
127 | \helpref{wxGetTranslation}{wxgettranslation} and the | |
128 | \helpref{\_()}{underscore} macro). It is used if AddCatalog cannot find any | |
129 | catalog for current language: if the language is same as source code language, | |
130 | then strings from source code are used instead. | |
131 | ||
132 | \arg{msgIdCharset} lets you specify the charset used for msgids in sources | |
133 | in case they use 8-bit characters (e.g. German or French strings). This | |
134 | argument has no effect in Unicode build, because literals in sources are | |
135 | Unicode strings; you have to use compiler-specific method of setting the right | |
136 | charset when compiling with Unicode. | |
137 | ||
138 | By default (i.e. when you use the first form), msgid strings are assumed | |
139 | to be in English and written only using 7-bit ASCII characters. | |
140 | ||
141 | If you have to deal with non-English strings or 8-bit characters in the source | |
142 | code, see the instructions in | |
143 | \helpref{Writing non-English applications}{nonenglishoverview}. | |
144 | ||
f0ab09cc | 145 | |
c1b7dab0 VZ |
146 | \membersection{wxLocale::AddCatalogLookupPathPrefix}\label{wxlocaleaddcataloglookuppathprefix} |
147 | ||
148 | \func{void}{AddCatalogLookupPathPrefix}{\param{const wxString\& }{prefix}} | |
149 | ||
150 | Add a prefix to the catalog lookup path: the message catalog files will be | |
d0a0dbd5 | 151 | looked up under prefix/<lang>/LC\_MESSAGES, prefix/<lang> and prefix |
c1b7dab0 VZ |
152 | (in this order). |
153 | ||
d0a0dbd5 | 154 | This only applies to subsequent invocations of AddCatalog(). |
f0ab09cc | 155 | |
8ec77cd7 VS |
156 | \membersection{wxLocale::AddLanguage}\label{wxlocaleaddlanguage} |
157 | ||
41780009 | 158 | \func{static void}{AddLanguage}{\param{const wxLanguageInfo\& }{info}} |
8ec77cd7 VS |
159 | |
160 | Adds custom, user-defined language to the database of known languages. This | |
2edb0bde | 161 | database is used in conjunction with the first form of |
8ec77cd7 VS |
162 | \helpref{Init}{wxlocaleinit}. |
163 | ||
164 | wxLanguageInfo is defined as follows: | |
165 | ||
166 | \begin{verbatim} | |
167 | struct WXDLLEXPORT wxLanguageInfo | |
168 | { | |
169 | int Language; // wxLanguage id | |
170 | wxString CanonicalName; // Canonical name, e.g. fr_FR | |
171 | #ifdef __WIN32__ | |
172 | wxUint32 WinLang, WinSublang; // Win32 language identifiers | |
173 | // (LANG_xxxx, SUBLANG_xxxx) | |
174 | #endif | |
175 | wxString Description; // human-readable name of the language | |
176 | }; | |
177 | \end{verbatim} | |
178 | ||
179 | ||
180 | {\it Language} should be greater than wxLANGUAGE\_USER\_DEFINED. | |
181 | ||
0a67eeac MB |
182 | \perlnote{In wxPerl Wx::LanguageInfo has only one method:\par |
183 | Wx::LanguageInfo->new( language, canonicalName, WinLang, WinSubLang, Description )} | |
8ec77cd7 | 184 | |
f0ab09cc | 185 | |
f0e8a2d0 | 186 | \membersection{wxLocale::FindLanguageInfo}\label{wxlocalefindlanguageinfo} |
9d1e1be4 | 187 | |
f6e9a818 | 188 | \func{static wxLanguageInfo *}{FindLanguageInfo}{\param{const wxString\& }{locale}} |
9d1e1be4 VZ |
189 | |
190 | This function may be used to find the language description structure for the | |
191 | given locale, specified either as a two letter ISO language code (for example, | |
192 | "pt"), a language code followed by the country code ("pt\_BR") or a full, human | |
193 | readable, language description ("Portuguese-Brazil"). | |
194 | ||
195 | Returns the information for the given language or {\tt NULL} if this language | |
196 | is unknown. Note that even if the returned pointer is valid, the caller should | |
197 | {\it not} delete it. | |
198 | ||
199 | \wxheading{See also} | |
200 | ||
201 | \helpref{GetLanguageInfo}{wxlocalegetlanguageinfo} | |
8ec77cd7 | 202 | |
f0ab09cc | 203 | |
8ec77cd7 VS |
204 | \membersection{wxLocale::GetCanonicalName}\label{wxlocalegetcanonicalname} |
205 | ||
393103d8 | 206 | \constfunc{wxString}{GetCanonicalName}{\void} |
8ec77cd7 VS |
207 | |
208 | Returns the canonical form of current locale name. Canonical form is the | |
209 | one that is used on UNIX systems: it is a two- or five-letter string in xx or | |
210 | xx\_YY format, where xx is ISO 639 code of language and YY is ISO 3166 code of | |
211 | the country. Examples are "en", "en\_GB", "en\_US" or "fr\_FR". | |
212 | ||
213 | This form is internally used when looking up message catalogs. | |
214 | ||
215 | Compare \helpref{GetSysName}{wxlocalegetsysname}. | |
216 | ||
217 | ||
218 | ||
f0ab09cc | 219 | |
8ec77cd7 VS |
220 | \membersection{wxLocale::GetLanguage}\label{wxlocalegetlanguage} |
221 | ||
222 | \constfunc{int}{GetLanguage}{\void} | |
223 | ||
224 | Returns \helpref{wxLanguage}{wxlanguage} constant of current language. | |
225 | Note that you can call this function only if you used the form of | |
226 | \helpref{Init}{wxlocaleinit} that takes wxLanguage argument. | |
227 | ||
f0ab09cc | 228 | |
14f8fa9d VZ |
229 | \membersection{wxLocale::GetLanguageInfo}\label{wxlocalegetlanguageinfo} |
230 | ||
231 | \constfunc{static wxLanguageInfo *}{GetLanguageInfo}{\param{int }{lang}} | |
232 | ||
233 | Returns a pointer to wxLanguageInfo structure containing information about the | |
234 | given language or {\tt NULL} if this language is unknown. Note that even if the | |
235 | returned pointer is valid, the caller should {\it not} delete it. | |
236 | ||
237 | See \helpref{AddLanguage}{wxlocaleaddlanguage} for the wxLanguageInfo | |
238 | description. | |
239 | ||
f0ab09cc VZ |
240 | As with \helpref{Init}{wxlocaleinit}, \texttt{wxLANGUAGE\_DEFAULT} has the |
241 | special meaning if passed as an argument to this function and in this case the | |
242 | result of \helpref{GetSystemLanguage()}{wxlocalegetsystemlanguage} is used. | |
243 | ||
244 | ||
4a6e4a46 VS |
245 | \membersection{wxLocale::GetLanguageName}\label{wxlocalegetlanguagename} |
246 | ||
247 | \constfunc{static wxString}{GetLanguageName}{\param{int }{lang}} | |
248 | ||
249 | Returns English name of the given language or empty string if this | |
250 | language is unknown. | |
251 | ||
f0ab09cc VZ |
252 | See \helpref{GetLanguageInfo}{wxlocalegetlanguageinfo} for a remark about |
253 | special meaning of \texttt{wxLANGUAGE\_DEFAULT}. | |
254 | ||
8ec77cd7 | 255 | |
3ca6a5f0 BP |
256 | \membersection{wxLocale::GetLocale}\label{wxlocalegetlocale} |
257 | ||
31b7522e | 258 | \constfunc{const wxString\& }{GetLocale}{\void} |
3ca6a5f0 BP |
259 | |
260 | Returns the locale name as passed to the constructor or | |
8ec77cd7 VS |
261 | \helpref{Init()}{wxlocaleinit}. This is full, human-readable name, |
262 | e.g. "English" or "French". | |
263 | ||
3ca6a5f0 | 264 | |
f0ab09cc | 265 | |
3ca6a5f0 BP |
266 | \membersection{wxLocale::GetName}\label{wxlocalegetname} |
267 | ||
31b7522e | 268 | \constfunc{const wxString\& }{GetName}{\void} |
3ca6a5f0 BP |
269 | |
270 | Returns the current short name for the locale (as given to the constructor or | |
271 | the Init() function). | |
272 | ||
f0ab09cc | 273 | |
3ca6a5f0 BP |
274 | \membersection{wxLocale::GetString}\label{wxlocalegetstring} |
275 | ||
31b7522e | 276 | \constfunc{const wxString\& }{GetString}{\param{const wxString\& }{origString}, \param{const wxString\& }{domain = wxEmptyString}} |
3ca6a5f0 | 277 | |
31b7522e | 278 | \constfunc{const wxString\& }{GetString}{\param{const wxString\& }{origString}, \param{const wxString\& }{origString2}, \param{size\_t }{n}, \param{const wxString\& }{domain = NULL}} |
6f80247a | 279 | |
3ca6a5f0 BP |
280 | Retrieves the translation for a string in all loaded domains unless the szDomain |
281 | parameter is specified (and then only this catalog/domain is searched). | |
282 | ||
283 | Returns original string if translation is not available | |
284 | (in this case an error message is generated the first time | |
285 | a string is not found; use \helpref{wxLogNull}{wxlogoverview} to suppress it). | |
286 | ||
6f80247a VS |
287 | The second form is used when retrieving translation of string that has |
288 | different singular and plural form in English or different plural forms in some | |
31b7522e | 289 | other language. It takes two extra arguments: \arg{origString} |
9e3b313e VS |
290 | parameter must contain the singular form of the string to be converted. |
291 | It is also used as the key for the search in the catalog. | |
31b7522e | 292 | The \arg{origString2} parameter is the plural form (in English). |
9e3b313e | 293 | The parameter \arg{n} is used to determine the plural form. If no |
31b7522e VS |
294 | message catalog is found \arg{origString} is returned if `n == 1', |
295 | otherwise \arg{origString2}. | |
296 | See \urlref{GNU gettext manual}{http://www.gnu.org/manual/gettext/html\_chapter/gettext\_10.html\#SEC150} for additional information on plural forms handling. | |
6f80247a | 297 | |
d721baa9 VS |
298 | This method is called by the \helpref{wxGetTranslation}{wxgettranslation} |
299 | function and \helpref{\_()}{underscore} macro. | |
300 | ||
3ca6a5f0 BP |
301 | \wxheading{Remarks} |
302 | ||
303 | Domains are searched in the last to first order, i.e. catalogs | |
304 | added later override those added before. | |
305 | ||
f0ab09cc | 306 | |
c48908df VZ |
307 | \membersection{wxLocale::GetHeaderValue}\label{wxlocalegetheadervalue} |
308 | ||
31b7522e | 309 | \constfunc{wxString}{GetHeaderValue}{\param{const wxString\& }{header}, \param{const wxString\& }{domain = wxEmptyString}} |
c48908df | 310 | |
31b7522e | 311 | Returns the header value for header \arg{header}. The search for \arg{header} is case sensitive. If an \arg{domain} |
c48908df VZ |
312 | is passed, this domain is searched. Else all domains will be searched until a header has been found. |
313 | The return value is the value of the header if found. Else this will be empty. | |
314 | ||
8ec77cd7 VS |
315 | \membersection{wxLocale::GetSysName}\label{wxlocalegetsysname} |
316 | ||
317 | \constfunc{wxString}{GetSysName}{\void} | |
318 | ||
319 | Returns current platform-specific locale name as passed to setlocale(). | |
320 | ||
321 | Compare \helpref{GetCanonicalName}{wxlocalegetcanonicalname}. | |
322 | ||
323 | ||
f0ab09cc | 324 | |
dccce9ea VZ |
325 | \membersection{wxLocale::GetSystemEncoding}\label{wxlocalegetsystemencoding} |
326 | ||
327 | \constfunc{static wxFontEncoding}{GetSystemEncoding}{\void} | |
328 | ||
329 | Tries to detect the user's default font encoding. | |
330 | Returns \helpref{wxFontEncoding}{wxfont} value or | |
331 | {\bf wxFONTENCODING\_SYSTEM} if it couldn't be determined. | |
332 | ||
f0ab09cc | 333 | |
dccce9ea VZ |
334 | \membersection{wxLocale::GetSystemEncodingName}\label{wxlocalegetsystemencodingname} |
335 | ||
336 | \constfunc{static wxString}{GetSystemEncodingName}{\void} | |
337 | ||
338 | Tries to detect the name of the user's default font encoding. This string isn't | |
339 | particularly useful for the application as its form is platform-dependent and | |
340 | so you should probably use | |
341 | \helpref{GetSystemEncoding}{wxlocalegetsystemencoding} instead. | |
342 | ||
343 | Returns a user-readable string value or an empty string if it couldn't be | |
344 | determined. | |
345 | ||
f0ab09cc | 346 | |
8ec77cd7 VS |
347 | \membersection{wxLocale::GetSystemLanguage}\label{wxlocalegetsystemlanguage} |
348 | ||
41780009 | 349 | \constfunc{static int}{GetSystemLanguage}{\void} |
8ec77cd7 VS |
350 | |
351 | Tries to detect the user's default language setting. | |
352 | Returns \helpref{wxLanguage}{wxlanguage} value or | |
353 | {\bf wxLANGUAGE\_UNKNOWN} if the language-guessing algorithm failed. | |
354 | ||
355 | ||
f0ab09cc | 356 | |
c1b7dab0 VZ |
357 | \membersection{wxLocale::Init}\label{wxlocaleinit} |
358 | ||
8ec77cd7 VS |
359 | |
360 | \func{bool}{Init}{\param{int }{language = wxLANGUAGE\_DEFAULT}, \param{int }{flags = | |
361 | wxLOCALE\_LOAD\_DEFAULT | wxLOCALE\_CONV\_ENCODING}} | |
362 | ||
31b7522e | 363 | \func{bool}{Init}{\param{const wxString\& }{name}, \param{const wxString\& }{short = wxEmptyString}, \param{const wxString\& }{locale = wxEmptyString}, \param{bool }{bLoadDefault = true}, \param{bool }{bConvertEncoding = false}} |
c1b7dab0 | 364 | |
8ec77cd7 VS |
365 | The second form is deprecated, use the first one unless you know what you are |
366 | doing. | |
dbdb39b2 | 367 | |
8ec77cd7 VS |
368 | |
369 | \wxheading{Parameters} | |
370 | ||
371 | \docparam{language}{\helpref{wxLanguage}{wxlanguage} identifier of the locale. | |
372 | wxLANGUAGE\_DEFAULT has special meaning -- wxLocale will use system's default | |
373 | language (see \helpref{GetSystemLanguage}{wxlocalegetsystemlanguage}).} | |
374 | ||
375 | \docparam{flags}{Combination of the following: | |
75173186 JS |
376 | |
377 | ||
8ec77cd7 VS |
378 | \begin{twocollist}\itemsep=0pt |
379 | \twocolitem{\windowstyle{wxLOCALE\_LOAD\_DEFAULT}}{Load the message catalog | |
fc2171bd | 380 | for the given locale containing the translations of standard wxWidgets messages |
8ec77cd7 VS |
381 | automatically.} |
382 | \twocolitem{\windowstyle{wxLOCALE\_CONV\_ENCODING}}{Automatically convert message | |
ae71a6e8 | 383 | catalogs to platform's default encoding. Note that it will do only basic |
8ec77cd7 VS |
384 | conversion between well-known pair like iso8859-1 and windows-1252 or |
385 | iso8859-2 and windows-1250. See \helpref{Writing non-English applications}{nonenglishoverview} for detailed | |
ae71a6e8 | 386 | description of this behaviour. Note that this flag is meaningless in Unicode build.} |
8ec77cd7 VS |
387 | \end{twocollist} |
388 | } | |
389 | ||
31b7522e | 390 | \docparam{name}{The name of the locale. Only used in diagnostic messages.} |
8ec77cd7 | 391 | |
31b7522e | 392 | \docparam{short}{The standard 2 letter locale abbreviation; it is used as the |
8ec77cd7 VS |
393 | directory prefix when looking for the message catalog files.} |
394 | ||
31b7522e | 395 | \docparam{locale}{The parameter for the call to setlocale(). Note that it is |
8ec77cd7 VS |
396 | platform-specific.} |
397 | ||
cc81d32f | 398 | \docparam{bLoadDefault}{May be set to false to prevent loading of the message catalog |
fc2171bd | 399 | for the given locale containing the translations of standard wxWidgets messages. |
8ec77cd7 VS |
400 | This parameter would be rarely used in normal circumstances.} |
401 | ||
cc81d32f | 402 | \docparam{bConvertEncoding}{May be set to true to do automatic conversion of message |
a4313e3b VS |
403 | catalogs to platform's native encoding. Note that it will do only basic |
404 | conversion between well-known pair like iso8859-1 and windows-1252 or | |
405 | iso8859-2 and windows-1250. | |
406 | See \helpref{Writing non-English applications}{nonenglishoverview} for detailed | |
8ec77cd7 VS |
407 | description of this behaviour.} |
408 | ||
c1b7dab0 VZ |
409 | |
410 | The call of this function has several global side effects which you should | |
411 | understand: first of all, the application locale is changed - note that this | |
412 | will affect many of standard C library functions such as printf() or strftime(). | |
413 | Second, this wxLocale object becomes the new current global locale for the | |
d721baa9 VS |
414 | application and so all subsequent calls to |
415 | \helpref{wxGetTranslation()}{wxgettranslation} will try to | |
c1b7dab0 VZ |
416 | translate the messages using the message catalogs for this locale. |
417 | ||
cc81d32f | 418 | Returns true on success or false if the given locale couldn't be set. |
c1b7dab0 | 419 | |
f0ab09cc | 420 | |
cec5ffc4 VZ |
421 | \membersection{wxLocale::IsAvailable}\label{wxlocaleisavailable} |
422 | ||
423 | \func{static bool}{IsAvailable}{\param{int }{lang}} | |
424 | ||
425 | Check whether the operating system and/or C run time environment supports | |
426 | this locale. For example in Windows 2000 and Windows XP, support for many | |
427 | locales is not installed by default. Returns \true if the locale is | |
428 | supported. | |
429 | ||
430 | The argument \arg{lang} is the wxLanguage identifier. To obtain this for a | |
431 | given a two letter ISO language code, use | |
432 | \helpref{FindLanguageInfo}{wxlocalefindlanguageinfo} to obtain its | |
433 | wxLanguageInfo structure. See \helpref{AddLanguage}{wxlocaleaddlanguage} for | |
434 | the wxLanguageInfo description. | |
435 | ||
327bf990 | 436 | \newsince{2.7.1}. |
cec5ffc4 VZ |
437 | |
438 | ||
c1b7dab0 VZ |
439 | \membersection{wxLocale::IsLoaded}\label{wxlocaleisloaded} |
440 | ||
dbdb39b2 JS |
441 | \constfunc{bool}{IsLoaded}{\param{const char* }{domain}} |
442 | ||
cc81d32f | 443 | Check if the given catalog is loaded, and returns true if it is. |
c1b7dab0 | 444 | |
dbdb39b2 JS |
445 | According to GNU gettext tradition, each catalog |
446 | normally corresponds to 'domain' which is more or less the application name. | |
c1b7dab0 VZ |
447 | |
448 | See also: \helpref{AddCatalog}{wxlocaleaddcatalog} | |
449 | ||
f0ab09cc | 450 | |
3ca6a5f0 | 451 | \membersection{wxLocale::IsOk}\label{wxlocaleisok} |
c1b7dab0 | 452 | |
3ca6a5f0 | 453 | \constfunc{bool}{IsOk}{\void} |
dbdb39b2 | 454 | |
cc81d32f | 455 | Returns true if the locale could be set successfully. |
dbdb39b2 | 456 |