1wxLocale(3)                Erlang Module Definition                wxLocale(3)
2
3
4

NAME

6       wxLocale - Functions for wxLocale class
7

DESCRIPTION

9       wxLocale  class  encapsulates  all language-dependent settings and is a
10       generalization of the C locale concept.
11
12       In wxWidgets this class manages current locale. It also initializes and
13       activates  wxTranslations  (not  implemented in wx) object that manages
14       message catalogs.
15
16       For a list of the supported languages, please see ?wxLanguage enum val‐
17       ues.  These constants may be used to specify the language in init/3 and
18       are returned by getSystemLanguage/0.
19
20       See: Overview i18n, Examples, wxXLocale (not implemented  in  wx),  wx‐
21       Translations (not implemented in wx)
22
23       wxWidgets docs: wxLocale
24

DATA TYPES

26       wxLocale() = wx:wx_object()
27

EXPORTS

29       new() -> wxLocale()
30
31              This  is the default constructor and it does nothing to initial‐
32              ize the object: init/3 must be used to do that.
33
34       new(Language) -> wxLocale()
35
36       new(Name) -> wxLocale()
37
38              Types:
39
40                 Name = unicode:chardata()
41
42       new(Language, Options :: [Option]) -> wxLocale()
43
44       new(Name, Options :: [Option]) -> wxLocale()
45
46              Types:
47
48                 Name = unicode:chardata()
49                 Option =
50                     {shortName, unicode:chardata()} |
51                     {locale, unicode:chardata()} |
52                     {bLoadDefault, boolean()}
53
54              See init/3 for parameters description.
55
56              The call of this function has several global side effects  which
57              you  should  understand: first of all, the application locale is
58              changed - note that this will affect many of standard C  library
59              functions  such as printf() or strftime(). Second, this wxLocale
60              object becomes the new current global locale for the application
61              and  so  all subsequent calls to ?wxGetTranslation() will try to
62              translate the messages using the message catalogs for  this  lo‐
63              cale.
64
65       destroy(This :: wxLocale()) -> ok
66
67              The  destructor,  like the constructor, also has global side ef‐
68              fects: the previously set locale is restored and so the  changes
69              described in init/3 documentation are rolled back.
70
71       init(This) -> boolean()
72
73              Types:
74
75                 This = wxLocale()
76
77       init(This, Options :: [Option]) -> boolean()
78
79              Types:
80
81                 This = wxLocale()
82                 Option = {language, integer()} | {flags, integer()}
83
84              Initializes the wxLocale instance.
85
86              The  call of this function has several global side effects which
87              you should understand: first of all, the application  locale  is
88              changed  - note that this will affect many of standard C library
89              functions such as printf() or strftime(). Second, this  wxLocale
90              object becomes the new current global locale for the application
91              and so all subsequent calls to ?wxGetTranslation() will  try  to
92              translate  the  messages using the message catalogs for this lo‐
93              cale.
94
95              Return: true on success or false if the given locale couldn't be
96              set.
97
98       init(This, Name, Options :: [Option]) -> boolean()
99
100              Types:
101
102                 This = wxLocale()
103                 Name = unicode:chardata()
104                 Option =
105                     {shortName, unicode:chardata()} |
106                     {locale, unicode:chardata()} |
107                     {bLoadDefault, boolean()}
108
109              Deprecated:  This  form  is deprecated, use the other one unless
110              you know what you are doing.
111
112       addCatalog(This, Domain) -> boolean()
113
114              Types:
115
116                 This = wxLocale()
117                 Domain = unicode:chardata()
118
119              Calls wxTranslations::AddCatalog(const wxString&).
120
121       addCatalog(This, Domain, MsgIdLanguage) -> boolean()
122
123              Types:
124
125                 This = wxLocale()
126                 Domain = unicode:chardata()
127                 MsgIdLanguage = wx:wx_enum()
128
129              Calls  wxTranslations::AddCatalog(const  wxString&,  wxLanguage)
130              (not implemented in wx).
131
132       addCatalog(This, Domain, MsgIdLanguage, MsgIdCharset) -> boolean()
133
134              Types:
135
136                 This = wxLocale()
137                 Domain = unicode:chardata()
138                 MsgIdLanguage = wx:wx_enum()
139                 MsgIdCharset = unicode:chardata()
140
141              Calls  wxTranslations::AddCatalog(const  wxString&,  wxLanguage,
142              const wxString&) (not implemented in wx).
143
144       addCatalogLookupPathPrefix(Prefix) -> ok
145
146              Types:
147
148                 Prefix = unicode:chardata()
149
150              Calls     wxFileTranslationsLoader::AddCatalogLookupPathPrefix()
151              (not implemented in wx).
152
153       getCanonicalName(This) -> unicode:charlist()
154
155              Types:
156
157                 This = wxLocale()
158
159              Returns the canonical form of current locale name.
160
161              Canonical  form is the one that is used on UNIX systems: it is a
162              two- or five-letter string in xx or xx_YY format,  where  xx  is
163              ISO 639 code of language and YY is ISO 3166 code of the country.
164              Examples are "en", "en_GB", "en_US" or "fr_FR". This form is in‐
165              ternally  used when looking up message catalogs. Compare getSys‐
166              Name/1.
167
168       getLanguage(This) -> integer()
169
170              Types:
171
172                 This = wxLocale()
173
174              Returns the ?wxLanguage constant of current language.
175
176              Note that you can call this function only if you used  the  form
177              of init/3 that takes ?wxLanguage argument.
178
179       getLanguageName(Lang) -> unicode:charlist()
180
181              Types:
182
183                 Lang = integer()
184
185              Returns  English  name  of the given language or empty string if
186              this language is unknown.
187
188              See GetLanguageInfo() (not implemented in wx) for a remark about
189              special meaning of wxLANGUAGE_DEFAULT.
190
191       getLocale(This) -> unicode:charlist()
192
193              Types:
194
195                 This = wxLocale()
196
197              Returns the locale name as passed to the constructor or init/3.
198
199              This is a full, human-readable name, e.g. "English" or "French".
200
201       getName(This) -> unicode:charlist()
202
203              Types:
204
205                 This = wxLocale()
206
207              Returns  the  current short name for the locale (as given to the
208              constructor or the init/3 function).
209
210       getString(This, OrigString) -> unicode:charlist()
211
212              Types:
213
214                 This = wxLocale()
215                 OrigString = unicode:chardata()
216
217       getString(This, OrigString, Options :: [Option]) ->
218                    unicode:charlist()
219
220              Types:
221
222                 This = wxLocale()
223                 OrigString = unicode:chardata()
224                 Option = {szDomain, unicode:chardata()}
225
226              Calls wxGetTranslation(const wxString&, const wxString&).
227
228       getString(This, OrigString, OrigString2, N) -> unicode:charlist()
229
230              Types:
231
232                 This = wxLocale()
233                 OrigString = OrigString2 = unicode:chardata()
234                 N = integer()
235
236       getString(This, OrigString, OrigString2, N, Options :: [Option]) ->
237                    unicode:charlist()
238
239              Types:
240
241                 This = wxLocale()
242                 OrigString = OrigString2 = unicode:chardata()
243                 N = integer()
244                 Option = {szDomain, unicode:chardata()}
245
246              Calls wxGetTranslation(const  wxString&,  const  wxString&,  un‐
247              signed, const wxString&).
248
249       getHeaderValue(This, Header) -> unicode:charlist()
250
251              Types:
252
253                 This = wxLocale()
254                 Header = unicode:chardata()
255
256       getHeaderValue(This, Header, Options :: [Option]) ->
257                         unicode:charlist()
258
259              Types:
260
261                 This = wxLocale()
262                 Header = unicode:chardata()
263                 Option = {szDomain, unicode:chardata()}
264
265              Calls wxTranslations::GetHeaderValue() (not implemented in wx).
266
267       getSysName(This) -> unicode:charlist()
268
269              Types:
270
271                 This = wxLocale()
272
273              Returns  current platform-specific locale name as passed to set‐
274              locale().
275
276              Compare getCanonicalName/1.
277
278       getSystemEncoding() -> wx:wx_enum()
279
280              Tries to detect the user's default font encoding.
281
282              Returns ?wxFontEncoding() value or wxFONTENCODING_SYSTEM  if  it
283              couldn't be determined.
284
285       getSystemEncodingName() -> unicode:charlist()
286
287              Tries to detect the name of the user's default font encoding.
288
289              This string isn't particularly useful for the application as its
290              form is platform-dependent and so you should probably  use  get‐
291              SystemEncoding/0 instead.
292
293              Returns  a  user-readable  string value or an empty string if it
294              couldn't be determined.
295
296       getSystemLanguage() -> integer()
297
298              Tries to detect the user's default locale setting.
299
300              Returns the ?wxLanguage value or wxLANGUAGE_UNKNOWN if the  lan‐
301              guage-guessing algorithm failed.
302
303              Note:  This  function  works with locales and returns the user's
304              default locale. This may be, and usually is, the same  as  their
305              preferred UI language, but it's not the same thing. Use wxTrans‐
306              lation to obtain language information.
307
308              See: wxTranslations::GetBestTranslation()  (not  implemented  in
309              wx)
310
311       isLoaded(This, Domain) -> boolean()
312
313              Types:
314
315                 This = wxLocale()
316                 Domain = unicode:chardata()
317
318              Calls wxTranslations::IsLoaded() (not implemented in wx).
319
320       isOk(This) -> boolean()
321
322              Types:
323
324                 This = wxLocale()
325
326              Returns true if the locale could be set successfully.
327
328
329
330wxWidgets team.                    wx 2.2.1                        wxLocale(3)
Impressum