]>
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 VZ |
5 | |
6 | In wxWindows this class manages message catalogs which contain the translations | |
7 | of the strings used to the current language. | |
8 | ||
5873607e VZ |
9 | \perlnote{In wxPerl the {\tt Wx} module exports a '_' function |
10 | that corresponds to the '_' C++ macro. | |
11 | \begin{verbatim} | |
12 | use Wx qw(_); | |
13 | ||
14 | # .... | |
15 | ||
16 | print _( ``Panic!'' ); | |
17 | ||
18 | my( \$button ) = Wx::Button->new( \$window, -1, _( ``Label'' ) ); | |
19 | \end{verbatim} | |
20 | } | |
21 | ||
c1b7dab0 VZ |
22 | \wxheading{Derived from} |
23 | ||
24 | No base class | |
25 | ||
ed93168b VZ |
26 | \wxheading{See also} |
27 | ||
28 | \helpref{I18n overview}{internationalization} | |
29 | ||
dbdb39b2 JS |
30 | \wxheading{Include files} |
31 | ||
32 | <wx/intl.h> | |
33 | ||
8ec77cd7 | 34 | |
c1b7dab0 VZ |
35 | \latexignore{\rtfignore{\wxheading{Members}}} |
36 | ||
8ec77cd7 VS |
37 | |
38 | \membersection{Supported languages}\label{wxlanguage} | |
39 | ||
40 | The following wxLanguage constants may be used to specify the language | |
41 | in \helpref{Init}{wxlocaleinit} and are returned by | |
42 | \helpref{GetSystemLanguage}{wxlocalegetsystemlanguage}: | |
43 | ||
44 | %% This enum is generated by misc/languages/genlang.py | |
45 | %% When making changes, please put them into misc/languages/langtabl.txt | |
46 | \begin{itemize}\itemsep=0pt | |
47 | \item wxLANGUAGE_DEFAULT -- user's default language as obtained from the operating system | |
48 | \item wxLANGUAGE_UNKNOWN -- returned by \helpref{GetSystemLanguage}{wxlocalegetsystemlanguage} | |
49 | if it fails to detect the default language | |
50 | \item wxLANGUAGE_USER_DEFINED -- user defined languages' integer identifiers should start from | |
51 | this | |
52 | \item wxLANGUAGE\_ABKHAZIAN | |
53 | \item wxLANGUAGE\_AFAR | |
54 | \item wxLANGUAGE\_AFRIKAANS | |
55 | \item wxLANGUAGE\_ALBANIAN | |
56 | \item wxLANGUAGE\_AMHARIC | |
57 | \item wxLANGUAGE\_ARABIC | |
58 | \item wxLANGUAGE\_ARABIC\_ALGERIA | |
59 | \item wxLANGUAGE\_ARABIC\_BAHRAIN | |
60 | \item wxLANGUAGE\_ARABIC\_EGYPT | |
61 | \item wxLANGUAGE\_ARABIC\_IRAQ | |
62 | \item wxLANGUAGE\_ARABIC\_JORDAN | |
63 | \item wxLANGUAGE\_ARABIC\_KUWAIT | |
64 | \item wxLANGUAGE\_ARABIC\_LEBANON | |
65 | \item wxLANGUAGE\_ARABIC\_LIBYA | |
66 | \item wxLANGUAGE\_ARABIC\_MOROCCO | |
67 | \item wxLANGUAGE\_ARABIC\_OMAN | |
68 | \item wxLANGUAGE\_ARABIC\_QATAR | |
69 | \item wxLANGUAGE\_ARABIC\_SAUDI\_ARABIA | |
70 | \item wxLANGUAGE\_ARABIC\_SUDAN | |
71 | \item wxLANGUAGE\_ARABIC\_SYRIA | |
72 | \item wxLANGUAGE\_ARABIC\_TUNISIA | |
73 | \item wxLANGUAGE\_ARABIC\_UAE | |
74 | \item wxLANGUAGE\_ARABIC\_YEMEN | |
75 | \item wxLANGUAGE\_ARMENIAN | |
76 | \item wxLANGUAGE\_ASSAMESE | |
77 | \item wxLANGUAGE\_AYMARA | |
78 | \item wxLANGUAGE\_AZERI | |
79 | \item wxLANGUAGE\_AZERI\_CYRILLIC | |
80 | \item wxLANGUAGE\_AZERI\_LATIN | |
81 | \item wxLANGUAGE\_BASHKIR | |
82 | \item wxLANGUAGE\_BASQUE | |
83 | \item wxLANGUAGE\_BELARUSIAN | |
84 | \item wxLANGUAGE\_BENGALI | |
85 | \item wxLANGUAGE\_BHUTANI | |
86 | \item wxLANGUAGE\_BIHARI | |
87 | \item wxLANGUAGE\_BISLAMA | |
88 | \item wxLANGUAGE\_BRETON | |
89 | \item wxLANGUAGE\_BULGARIAN | |
90 | \item wxLANGUAGE\_BURMESE | |
91 | \item wxLANGUAGE\_CAMBODIAN | |
92 | \item wxLANGUAGE\_CATALAN | |
93 | \item wxLANGUAGE\_CHINESE | |
94 | \item wxLANGUAGE\_CHINESE\_SIMPLIFIED | |
95 | \item wxLANGUAGE\_CHINESE\_TRADITIONAL | |
96 | \item wxLANGUAGE\_CHINESE\_HONGKONG | |
97 | \item wxLANGUAGE\_CHINESE\_MACAU | |
98 | \item wxLANGUAGE\_CHINESE\_SINGAPORE | |
99 | \item wxLANGUAGE\_CHINESE\_TAIWAN | |
100 | \item wxLANGUAGE\_CORSICAN | |
101 | \item wxLANGUAGE\_CROATIAN | |
102 | \item wxLANGUAGE\_CZECH | |
103 | \item wxLANGUAGE\_DANISH | |
104 | \item wxLANGUAGE\_DUTCH | |
105 | \item wxLANGUAGE\_DUTCH\_BELGIAN | |
106 | \item wxLANGUAGE\_ENGLISH | |
107 | \item wxLANGUAGE\_ENGLISH\_UK | |
108 | \item wxLANGUAGE\_ENGLISH\_US | |
109 | \item wxLANGUAGE\_ENGLISH\_AUSTRALIA | |
110 | \item wxLANGUAGE\_ENGLISH\_BELIZE | |
111 | \item wxLANGUAGE\_ENGLISH\_BOTSWANA | |
112 | \item wxLANGUAGE\_ENGLISH\_CANADA | |
113 | \item wxLANGUAGE\_ENGLISH\_CARIBBEAN | |
114 | \item wxLANGUAGE\_ENGLISH\_DENMARK | |
115 | \item wxLANGUAGE\_ENGLISH\_EIRE | |
116 | \item wxLANGUAGE\_ENGLISH\_JAMAICA | |
117 | \item wxLANGUAGE\_ENGLISH\_NEW\_ZEALAND | |
118 | \item wxLANGUAGE\_ENGLISH\_PHILIPPINES | |
119 | \item wxLANGUAGE\_ENGLISH\_SOUTH\_AFRICA | |
120 | \item wxLANGUAGE\_ENGLISH\_TRINIDAD | |
121 | \item wxLANGUAGE\_ENGLISH\_ZIMBABWE | |
122 | \item wxLANGUAGE\_ESPERANTO | |
123 | \item wxLANGUAGE\_ESTONIAN | |
124 | \item wxLANGUAGE\_FAEROESE | |
125 | \item wxLANGUAGE\_FARSI | |
126 | \item wxLANGUAGE\_FIJI | |
127 | \item wxLANGUAGE\_FINNISH | |
128 | \item wxLANGUAGE\_FRENCH | |
129 | \item wxLANGUAGE\_FRENCH\_BELGIAN | |
130 | \item wxLANGUAGE\_FRENCH\_CANADIAN | |
131 | \item wxLANGUAGE\_FRENCH\_LUXEMBOURG | |
132 | \item wxLANGUAGE\_FRENCH\_MONACO | |
133 | \item wxLANGUAGE\_FRENCH\_SWISS | |
134 | \item wxLANGUAGE\_FRISIAN | |
135 | \item wxLANGUAGE\_GALICIAN | |
136 | \item wxLANGUAGE\_GEORGIAN | |
137 | \item wxLANGUAGE\_GERMAN | |
138 | \item wxLANGUAGE\_GERMAN\_AUSTRIAN | |
139 | \item wxLANGUAGE\_GERMAN\_BELGIUM | |
140 | \item wxLANGUAGE\_GERMAN\_LIECHTENSTEIN | |
141 | \item wxLANGUAGE\_GERMAN\_LUXEMBOURG | |
142 | \item wxLANGUAGE\_GERMAN\_SWISS | |
143 | \item wxLANGUAGE\_GREEK | |
144 | \item wxLANGUAGE\_GREENLANDIC | |
145 | \item wxLANGUAGE\_GUARANI | |
146 | \item wxLANGUAGE\_GUJARATI | |
147 | \item wxLANGUAGE\_HAUSA | |
148 | \item wxLANGUAGE\_HEBREW | |
149 | \item wxLANGUAGE\_HINDI | |
150 | \item wxLANGUAGE\_HUNGARIAN | |
151 | \item wxLANGUAGE\_ICELANDIC | |
152 | \item wxLANGUAGE\_INDONESIAN | |
153 | \item wxLANGUAGE\_INTERLINGUA | |
154 | \item wxLANGUAGE\_INTERLINGUE | |
155 | \item wxLANGUAGE\_INUKTITUT | |
156 | \item wxLANGUAGE\_INUPIAK | |
157 | \item wxLANGUAGE\_IRISH | |
158 | \item wxLANGUAGE\_ITALIAN | |
159 | \item wxLANGUAGE\_ITALIAN\_SWISS | |
160 | \item wxLANGUAGE\_JAPANESE | |
161 | \item wxLANGUAGE\_JAVANESE | |
162 | \item wxLANGUAGE\_KANNADA | |
163 | \item wxLANGUAGE\_KASHMIRI | |
164 | \item wxLANGUAGE\_KASHMIRI\_INDIA | |
165 | \item wxLANGUAGE\_KAZAKH | |
166 | \item wxLANGUAGE\_KERNEWEK | |
167 | \item wxLANGUAGE\_KINYARWANDA | |
168 | \item wxLANGUAGE\_KIRGHIZ | |
169 | \item wxLANGUAGE\_KIRUNDI | |
170 | \item wxLANGUAGE\_KONKANI | |
171 | \item wxLANGUAGE\_KOREAN | |
172 | \item wxLANGUAGE\_KURDISH | |
173 | \item wxLANGUAGE\_LAOTHIAN | |
174 | \item wxLANGUAGE\_LATIN | |
175 | \item wxLANGUAGE\_LATVIAN | |
176 | \item wxLANGUAGE\_LINGALA | |
177 | \item wxLANGUAGE\_LITHUANIAN | |
178 | \item wxLANGUAGE\_MACEDONIAN | |
179 | \item wxLANGUAGE\_MALAGASY | |
180 | \item wxLANGUAGE\_MALAY | |
181 | \item wxLANGUAGE\_MALAYALAM | |
182 | \item wxLANGUAGE\_MALAY\_BRUNEI\_DARUSSALAM | |
183 | \item wxLANGUAGE\_MALAY\_MALAYSIA | |
184 | \item wxLANGUAGE\_MALTESE | |
185 | \item wxLANGUAGE\_MANIPURI | |
186 | \item wxLANGUAGE\_MAORI | |
187 | \item wxLANGUAGE\_MARATHI | |
188 | \item wxLANGUAGE\_MOLDAVIAN | |
189 | \item wxLANGUAGE\_MONGOLIAN | |
190 | \item wxLANGUAGE\_NAURU | |
191 | \item wxLANGUAGE\_NEPALI | |
192 | \item wxLANGUAGE\_NEPALI\_INDIA | |
193 | \item wxLANGUAGE\_NORWEGIAN\_BOKMAL | |
194 | \item wxLANGUAGE\_NORWEGIAN\_NYNORSK | |
195 | \item wxLANGUAGE\_OCCITAN | |
196 | \item wxLANGUAGE\_ORIYA | |
197 | \item wxLANGUAGE\_OROMO | |
198 | \item wxLANGUAGE\_PASHTO | |
199 | \item wxLANGUAGE\_POLISH | |
200 | \item wxLANGUAGE\_PORTUGUESE | |
201 | \item wxLANGUAGE\_PORTUGUESE\_BRAZILIAN | |
202 | \item wxLANGUAGE\_PUNJABI | |
203 | \item wxLANGUAGE\_QUECHUA | |
204 | \item wxLANGUAGE\_RHAETO\_ROMANCE | |
205 | \item wxLANGUAGE\_ROMANIAN | |
206 | \item wxLANGUAGE\_RUSSIAN | |
207 | \item wxLANGUAGE\_RUSSIAN\_UKRAINE | |
208 | \item wxLANGUAGE\_SAMOAN | |
209 | \item wxLANGUAGE\_SANGHO | |
210 | \item wxLANGUAGE\_SANSKRIT | |
211 | \item wxLANGUAGE\_SCOTS\_GAELIC | |
212 | \item wxLANGUAGE\_SERBIAN | |
213 | \item wxLANGUAGE\_SERBIAN\_CYRILLIC | |
214 | \item wxLANGUAGE\_SERBIAN\_LATIN | |
215 | \item wxLANGUAGE\_SERBO\_CROATIAN | |
216 | \item wxLANGUAGE\_SESOTHO | |
217 | \item wxLANGUAGE\_SETSWANA | |
218 | \item wxLANGUAGE\_SHONA | |
219 | \item wxLANGUAGE\_SINDHI | |
220 | \item wxLANGUAGE\_SINHALESE | |
221 | \item wxLANGUAGE\_SISWATI | |
222 | \item wxLANGUAGE\_SLOVAK | |
223 | \item wxLANGUAGE\_SLOVENIAN | |
224 | \item wxLANGUAGE\_SOMALI | |
225 | \item wxLANGUAGE\_SPANISH | |
226 | \item wxLANGUAGE\_SPANISH\_ARGENTINA | |
227 | \item wxLANGUAGE\_SPANISH\_BOLIVIA | |
228 | \item wxLANGUAGE\_SPANISH\_CHILE | |
229 | \item wxLANGUAGE\_SPANISH\_COLOMBIA | |
230 | \item wxLANGUAGE\_SPANISH\_COSTA\_RICA | |
231 | \item wxLANGUAGE\_SPANISH\_DOMINICAN\_REPUBLIC | |
232 | \item wxLANGUAGE\_SPANISH\_ECUADOR | |
233 | \item wxLANGUAGE\_SPANISH\_EL\_SALVADOR | |
234 | \item wxLANGUAGE\_SPANISH\_GUATEMALA | |
235 | \item wxLANGUAGE\_SPANISH\_HONDURAS | |
236 | \item wxLANGUAGE\_SPANISH\_MEXICAN | |
237 | \item wxLANGUAGE\_SPANISH\_MODERN | |
238 | \item wxLANGUAGE\_SPANISH\_NICARAGUA | |
239 | \item wxLANGUAGE\_SPANISH\_PANAMA | |
240 | \item wxLANGUAGE\_SPANISH\_PARAGUAY | |
241 | \item wxLANGUAGE\_SPANISH\_PERU | |
242 | \item wxLANGUAGE\_SPANISH\_PUERTO\_RICO | |
243 | \item wxLANGUAGE\_SPANISH\_URUGUAY | |
244 | \item wxLANGUAGE\_SPANISH\_US | |
245 | \item wxLANGUAGE\_SPANISH\_VENEZUELA | |
246 | \item wxLANGUAGE\_SUNDANESE | |
247 | \item wxLANGUAGE\_SWAHILI | |
248 | \item wxLANGUAGE\_SWEDISH | |
249 | \item wxLANGUAGE\_SWEDISH\_FINLAND | |
250 | \item wxLANGUAGE\_TAGALOG | |
251 | \item wxLANGUAGE\_TAJIK | |
252 | \item wxLANGUAGE\_TAMIL | |
253 | \item wxLANGUAGE\_TATAR | |
254 | \item wxLANGUAGE\_TELUGU | |
255 | \item wxLANGUAGE\_THAI | |
256 | \item wxLANGUAGE\_TIBETAN | |
257 | \item wxLANGUAGE\_TIGRINYA | |
258 | \item wxLANGUAGE\_TONGA | |
259 | \item wxLANGUAGE\_TSONGA | |
260 | \item wxLANGUAGE\_TURKISH | |
261 | \item wxLANGUAGE\_TURKMEN | |
262 | \item wxLANGUAGE\_TWI | |
263 | \item wxLANGUAGE\_UIGHUR | |
264 | \item wxLANGUAGE\_UKRAINIAN | |
265 | \item wxLANGUAGE\_URDU | |
266 | \item wxLANGUAGE\_URDU\_INDIA | |
267 | \item wxLANGUAGE\_URDU\_PAKISTAN | |
268 | \item wxLANGUAGE\_UZBEK | |
269 | \item wxLANGUAGE\_UZBEK\_CYRILLIC | |
270 | \item wxLANGUAGE\_UZBEK\_LATIN | |
271 | \item wxLANGUAGE\_VIETNAMESE | |
272 | \item wxLANGUAGE\_VOLAPUK | |
273 | \item wxLANGUAGE\_WELSH | |
274 | \item wxLANGUAGE\_WOLOF | |
275 | \item wxLANGUAGE\_XHOSA | |
276 | \item wxLANGUAGE\_YIDDISH | |
277 | \item wxLANGUAGE\_YORUBA | |
278 | \item wxLANGUAGE\_ZHUANG | |
279 | \item wxLANGUAGE\_ZULU | |
280 | \end{itemize} | |
281 | ||
282 | ||
283 | ||
c1b7dab0 VZ |
284 | \membersection{wxLocale::wxLocale}\label{wxlocaledefctor} |
285 | ||
286 | \func{}{wxLocale}{\void} | |
287 | ||
288 | This is the default constructor and it does nothing to initialize the object: | |
dbdb39b2 | 289 | \helpref{Init()}{wxlocaleinit} must be used to do that. |
c1b7dab0 | 290 | |
8ec77cd7 VS |
291 | \func{}{wxLocale}{\param{int }{language}, \param{int }{flags = |
292 | wxLOCALE\_LOAD\_DEFAULT | wxLOCALE\_CONV\_ENCODING}} | |
293 | ||
294 | See \helpref{Init()}{wxlocaleinit} for parameters description. | |
295 | ||
7ddef9ed | 296 | \func{}{wxLocale}{\param{const char }{*szName}, \param{const char }{*szShort = NULL}, \param{const char }{*szLocale = NULL}, \param{bool }{bLoadDefault = TRUE}, \param{bool }{bConvertEncoding = FALSE}} |
c1b7dab0 | 297 | |
8ec77cd7 | 298 | See \helpref{Init()}{wxlocaleinit} for parameters description. |
c1b7dab0 VZ |
299 | |
300 | The call of this function has several global side effects which you should | |
301 | understand: first of all, the application locale is changed - note that this | |
302 | will affect many of standard C library functions such as printf() or strftime(). | |
303 | Second, this wxLocale object becomes the new current global locale for the | |
304 | application and so all subsequent calls to wxGetTranslation() will try to | |
305 | translate the messages using the message catalogs for this locale. | |
306 | ||
8ec77cd7 | 307 | |
c1b7dab0 VZ |
308 | \membersection{wxLocale::\destruct{wxLocale}}\label{wxlocaledtor} |
309 | ||
310 | \func{}{\destruct{wxLocale}}{\void} | |
311 | ||
dbdb39b2 | 312 | The destructor, like the constructor, also has global side effects: the previously |
c1b7dab0 VZ |
313 | set locale is restored and so the changes described in |
314 | \helpref{Init}{wxlocaleinit} documentation are rolled back. | |
315 | ||
c1b7dab0 VZ |
316 | \membersection{wxLocale::AddCatalog}\label{wxlocaleaddcatalog} |
317 | ||
318 | \func{bool}{AddCatalog}{\param{const char }{*szDomain}} | |
319 | ||
f6bcfd97 | 320 | Add a catalog for use with the current locale: it is searched for in standard |
dbdb39b2 | 321 | places (current directory first, then the system one), but you may also prepend |
c1b7dab0 | 322 | additional directories to the search path with |
dbdb39b2 | 323 | \helpref{AddCatalogLookupPathPrefix()}{wxlocaleaddcataloglookuppathprefix}. |
c1b7dab0 VZ |
324 | |
325 | All loaded catalogs will be used for message lookup by GetString() for the | |
326 | current locale. | |
327 | ||
328 | Returns TRUE if catalog was successfully loaded, FALSE otherwise (which might | |
329 | mean that the catalog is not found or that it isn't in the correct format). | |
330 | ||
331 | \membersection{wxLocale::AddCatalogLookupPathPrefix}\label{wxlocaleaddcataloglookuppathprefix} | |
332 | ||
333 | \func{void}{AddCatalogLookupPathPrefix}{\param{const wxString\& }{prefix}} | |
334 | ||
335 | Add a prefix to the catalog lookup path: the message catalog files will be | |
336 | looked up under prefix/<lang>/LC\_MESSAGES, prefix/LC\_MESSAGES and prefix | |
337 | (in this order). | |
338 | ||
339 | This only applies to subsequent invocations of AddCatalog()! | |
340 | ||
8ec77cd7 VS |
341 | \membersection{wxLocale::AddLanguage}\label{wxlocaleaddlanguage} |
342 | ||
343 | \func{void}{AddLanguage}{\param{const wxLanguageInfo\& }{info}} | |
344 | ||
345 | Adds custom, user-defined language to the database of known languages. This | |
346 | database is used in conjuction with the first form of | |
347 | \helpref{Init}{wxlocaleinit}. | |
348 | ||
349 | wxLanguageInfo is defined as follows: | |
350 | ||
351 | \begin{verbatim} | |
352 | struct WXDLLEXPORT wxLanguageInfo | |
353 | { | |
354 | int Language; // wxLanguage id | |
355 | wxString CanonicalName; // Canonical name, e.g. fr_FR | |
356 | #ifdef __WIN32__ | |
357 | wxUint32 WinLang, WinSublang; // Win32 language identifiers | |
358 | // (LANG_xxxx, SUBLANG_xxxx) | |
359 | #endif | |
360 | wxString Description; // human-readable name of the language | |
361 | }; | |
362 | \end{verbatim} | |
363 | ||
364 | ||
365 | {\it Language} should be greater than wxLANGUAGE\_USER\_DEFINED. | |
366 | ||
367 | ||
368 | ||
369 | \membersection{wxLocale::GetCanonicalName}\label{wxlocalegetcanonicalname} | |
370 | ||
371 | \constfunc{wxString}{GetSysName}{\void} | |
372 | ||
373 | Returns the canonical form of current locale name. Canonical form is the | |
374 | one that is used on UNIX systems: it is a two- or five-letter string in xx or | |
375 | xx\_YY format, where xx is ISO 639 code of language and YY is ISO 3166 code of | |
376 | the country. Examples are "en", "en\_GB", "en\_US" or "fr\_FR". | |
377 | ||
378 | This form is internally used when looking up message catalogs. | |
379 | ||
380 | Compare \helpref{GetSysName}{wxlocalegetsysname}. | |
381 | ||
382 | ||
383 | ||
384 | \membersection{wxLocale::GetLanguage}\label{wxlocalegetlanguage} | |
385 | ||
386 | \constfunc{int}{GetLanguage}{\void} | |
387 | ||
388 | Returns \helpref{wxLanguage}{wxlanguage} constant of current language. | |
389 | Note that you can call this function only if you used the form of | |
390 | \helpref{Init}{wxlocaleinit} that takes wxLanguage argument. | |
391 | ||
392 | ||
3ca6a5f0 BP |
393 | \membersection{wxLocale::GetLocale}\label{wxlocalegetlocale} |
394 | ||
395 | \constfunc{const char*}{GetLocale}{\void} | |
396 | ||
397 | Returns the locale name as passed to the constructor or | |
8ec77cd7 VS |
398 | \helpref{Init()}{wxlocaleinit}. This is full, human-readable name, |
399 | e.g. "English" or "French". | |
400 | ||
3ca6a5f0 BP |
401 | |
402 | \membersection{wxLocale::GetName}\label{wxlocalegetname} | |
403 | ||
404 | \constfunc{const wxString\&}{GetName}{\void} | |
405 | ||
406 | Returns the current short name for the locale (as given to the constructor or | |
407 | the Init() function). | |
408 | ||
409 | \membersection{wxLocale::GetString}\label{wxlocalegetstring} | |
410 | ||
411 | \constfunc{const char*}{GetString}{\param{const char }{*szOrigString}, \param{const char }{*szDomain = NULL}} | |
412 | ||
413 | Retrieves the translation for a string in all loaded domains unless the szDomain | |
414 | parameter is specified (and then only this catalog/domain is searched). | |
415 | ||
416 | Returns original string if translation is not available | |
417 | (in this case an error message is generated the first time | |
418 | a string is not found; use \helpref{wxLogNull}{wxlogoverview} to suppress it). | |
419 | ||
420 | \wxheading{Remarks} | |
421 | ||
422 | Domains are searched in the last to first order, i.e. catalogs | |
423 | added later override those added before. | |
424 | ||
8ec77cd7 VS |
425 | \membersection{wxLocale::GetSysName}\label{wxlocalegetsysname} |
426 | ||
427 | \constfunc{wxString}{GetSysName}{\void} | |
428 | ||
429 | Returns current platform-specific locale name as passed to setlocale(). | |
430 | ||
431 | Compare \helpref{GetCanonicalName}{wxlocalegetcanonicalname}. | |
432 | ||
433 | ||
434 | \membersection{wxLocale::GetSystemLanguage}\label{wxlocalegetsystemlanguage} | |
435 | ||
436 | \constfunc{int}{GetSystemLanguage}{\void} | |
437 | ||
438 | Tries to detect the user's default language setting. | |
439 | Returns \helpref{wxLanguage}{wxlanguage} value or | |
440 | {\bf wxLANGUAGE\_UNKNOWN} if the language-guessing algorithm failed. | |
441 | ||
442 | ||
c1b7dab0 VZ |
443 | \membersection{wxLocale::Init}\label{wxlocaleinit} |
444 | ||
8ec77cd7 VS |
445 | |
446 | \func{bool}{Init}{\param{int }{language = wxLANGUAGE\_DEFAULT}, \param{int }{flags = | |
447 | wxLOCALE\_LOAD\_DEFAULT | wxLOCALE\_CONV\_ENCODING}} | |
448 | ||
a4313e3b | 449 | \func{bool}{Init}{\param{const char }{*szName}, \param{const char }{*szShort = NULL}, \param{const char }{*szLocale = NULL}, \param{bool }{bLoadDefault = TRUE}, \param{bool }{bConvertEncoding = FALSE}} |
c1b7dab0 | 450 | |
8ec77cd7 VS |
451 | The second form is deprecated, use the first one unless you know what you are |
452 | doing. | |
dbdb39b2 | 453 | |
8ec77cd7 VS |
454 | |
455 | \wxheading{Parameters} | |
456 | ||
457 | \docparam{language}{\helpref{wxLanguage}{wxlanguage} identifier of the locale. | |
458 | wxLANGUAGE\_DEFAULT has special meaning -- wxLocale will use system's default | |
459 | language (see \helpref{GetSystemLanguage}{wxlocalegetsystemlanguage}).} | |
460 | ||
461 | \docparam{flags}{Combination of the following: | |
462 | \begin{twocollist}\itemsep=0pt | |
463 | \twocolitem{\windowstyle{wxLOCALE\_LOAD\_DEFAULT}}{Load the message catalog | |
464 | for the given locale containing the translations of standard wxWindows messages | |
465 | automatically.} | |
466 | \twocolitem{\windowstyle{wxLOCALE\_CONV\_ENCODING}}{Automatically convert message | |
467 | catalogs to platform's native encoding. Note that it will do only basic | |
468 | conversion between well-known pair like iso8859-1 and windows-1252 or | |
469 | iso8859-2 and windows-1250. See \helpref{Writing non-English applications}{nonenglishoverview} for detailed | |
470 | description of this behaviour.} | |
471 | \end{twocollist} | |
472 | } | |
473 | ||
474 | \docparam{szName}{The name of the locale. Only used in diagnostic messages.} | |
475 | ||
476 | \docparam{szShort}{The standard 2 letter locale abbreviation and is used as the | |
477 | directory prefix when looking for the message catalog files.} | |
478 | ||
479 | \docparam{szLocale}{The parameter for the call to setlocale(). Note that it is | |
480 | platform-specific.} | |
481 | ||
482 | \docparam{bLoadDefault}{May be set to FALSE to prevent loading of the message catalog | |
c1b7dab0 | 483 | for the given locale containing the translations of standard wxWindows messages. |
8ec77cd7 VS |
484 | This parameter would be rarely used in normal circumstances.} |
485 | ||
486 | \docparam{bConvertEncoding}{May be set to TRUE to do automatic conversion of message | |
a4313e3b VS |
487 | catalogs to platform's native encoding. Note that it will do only basic |
488 | conversion between well-known pair like iso8859-1 and windows-1252 or | |
489 | iso8859-2 and windows-1250. | |
490 | See \helpref{Writing non-English applications}{nonenglishoverview} for detailed | |
8ec77cd7 VS |
491 | description of this behaviour.} |
492 | ||
c1b7dab0 VZ |
493 | |
494 | The call of this function has several global side effects which you should | |
495 | understand: first of all, the application locale is changed - note that this | |
496 | will affect many of standard C library functions such as printf() or strftime(). | |
497 | Second, this wxLocale object becomes the new current global locale for the | |
498 | application and so all subsequent calls to wxGetTranslation() will try to | |
499 | translate the messages using the message catalogs for this locale. | |
500 | ||
501 | Returns TRUE on success or FALSE if the given locale couldn't be set. | |
502 | ||
503 | \membersection{wxLocale::IsLoaded}\label{wxlocaleisloaded} | |
504 | ||
dbdb39b2 JS |
505 | \constfunc{bool}{IsLoaded}{\param{const char* }{domain}} |
506 | ||
507 | Check if the given catalog is loaded, and returns TRUE if it is. | |
c1b7dab0 | 508 | |
dbdb39b2 JS |
509 | According to GNU gettext tradition, each catalog |
510 | normally corresponds to 'domain' which is more or less the application name. | |
c1b7dab0 VZ |
511 | |
512 | See also: \helpref{AddCatalog}{wxlocaleaddcatalog} | |
513 | ||
3ca6a5f0 | 514 | \membersection{wxLocale::IsOk}\label{wxlocaleisok} |
c1b7dab0 | 515 | |
3ca6a5f0 | 516 | \constfunc{bool}{IsOk}{\void} |
dbdb39b2 | 517 | |
3ca6a5f0 | 518 | Returns TRUE if the locale could be set successfully. |
dbdb39b2 | 519 |