1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/common/intl.cpp
3 // Purpose: Internationalization and localisation for wxWidgets
4 // Author: Vadim Zeitlin
5 // Modified by: Michael N. Filippov <michael@idisys.iae.nsk.su>
6 // (2003/09/30 - PluralForms support)
9 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
13 // ============================================================================
15 // ============================================================================
17 // ----------------------------------------------------------------------------
19 // ----------------------------------------------------------------------------
21 // For compilers that support precompilation, includes "wx.h".
22 #include "wx/wxprec.h"
29 // The following define is needed by Innotek's libc to
30 // make the definition of struct localeconv available.
31 #define __INTERNAL_DEFS
37 #include "wx/dynarray.h"
38 #include "wx/string.h"
43 #include "wx/hashmap.h"
44 #include "wx/module.h"
54 #ifdef HAVE_LANGINFO_H
59 #include "wx/msw/private.h"
60 #elif defined(__UNIX_LIKE__)
61 #include "wx/fontmap.h" // for CharsetToEncoding()
65 #include "wx/filename.h"
66 #include "wx/tokenzr.h"
67 #include "wx/fontmap.h"
68 #include "wx/encconv.h"
69 #include "wx/scopedptr.h"
70 #include "wx/apptrait.h"
71 #include "wx/stdpaths.h"
72 #include "wx/hashset.h"
74 #if defined(__WXOSX__)
75 #include "wx/osx/core/cfref.h"
76 #include <CoreFoundation/CFLocale.h>
77 #include <CoreFoundation/CFDateFormatter.h>
78 #include "wx/osx/core/cfstring.h"
81 // ----------------------------------------------------------------------------
83 // ----------------------------------------------------------------------------
85 // this should *not* be wxChar, this type must have exactly 8 bits!
86 typedef wxUint8 size_t8
;
87 typedef wxUint32 size_t32
;
89 // ----------------------------------------------------------------------------
91 // ----------------------------------------------------------------------------
93 // magic number identifying the .mo format file
94 const size_t32 MSGCATALOG_MAGIC
= 0x950412de;
95 const size_t32 MSGCATALOG_MAGIC_SW
= 0xde120495;
97 // the constants describing the format of ll_CC locale string
98 static const size_t LEN_LANG
= 2;
99 static const size_t LEN_SUBLANG
= 2;
100 static const size_t LEN_FULL
= LEN_LANG
+ 1 + LEN_SUBLANG
; // 1 for '_'
102 #define TRACE_I18N wxS("i18n")
104 // ----------------------------------------------------------------------------
106 // ----------------------------------------------------------------------------
108 static wxLocale
*wxSetLocale(wxLocale
*pLocale
);
113 // get just the language part
114 inline wxString
ExtractLang(const wxString
& langFull
)
116 return langFull
.Left(LEN_LANG
);
119 // helper functions of GetSystemLanguage()
122 // get everything else (including the leading '_')
123 inline wxString
ExtractNotLang(const wxString
& langFull
)
125 return langFull
.Mid(LEN_LANG
);
130 } // anonymous namespace
132 // ----------------------------------------------------------------------------
133 // Plural forms parser
134 // ----------------------------------------------------------------------------
140 LogicalOrExpression '?' Expression ':' Expression
144 LogicalAndExpression "||" LogicalOrExpression // to (a || b) || c
147 LogicalAndExpression:
148 EqualityExpression "&&" LogicalAndExpression // to (a && b) && c
152 RelationalExpression "==" RelationalExperession
153 RelationalExpression "!=" RelationalExperession
156 RelationalExpression:
157 MultiplicativeExpression '>' MultiplicativeExpression
158 MultiplicativeExpression '<' MultiplicativeExpression
159 MultiplicativeExpression ">=" MultiplicativeExpression
160 MultiplicativeExpression "<=" MultiplicativeExpression
161 MultiplicativeExpression
163 MultiplicativeExpression:
164 PmExpression '%' PmExpression
173 class wxPluralFormsToken
178 T_ERROR
, T_EOF
, T_NUMBER
, T_N
, T_PLURAL
, T_NPLURALS
, T_EQUAL
, T_ASSIGN
,
179 T_GREATER
, T_GREATER_OR_EQUAL
, T_LESS
, T_LESS_OR_EQUAL
,
180 T_REMINDER
, T_NOT_EQUAL
,
181 T_LOGICAL_AND
, T_LOGICAL_OR
, T_QUESTION
, T_COLON
, T_SEMICOLON
,
182 T_LEFT_BRACKET
, T_RIGHT_BRACKET
184 Type
type() const { return m_type
; }
185 void setType(Type type
) { m_type
= type
; }
188 Number
number() const { return m_number
; }
189 void setNumber(Number num
) { m_number
= num
; }
196 class wxPluralFormsScanner
199 wxPluralFormsScanner(const char* s
);
200 const wxPluralFormsToken
& token() const { return m_token
; }
201 bool nextToken(); // returns false if error
204 wxPluralFormsToken m_token
;
207 wxPluralFormsScanner::wxPluralFormsScanner(const char* s
) : m_s(s
)
212 bool wxPluralFormsScanner::nextToken()
214 wxPluralFormsToken::Type type
= wxPluralFormsToken::T_ERROR
;
215 while (isspace((unsigned char) *m_s
))
221 type
= wxPluralFormsToken::T_EOF
;
223 else if (isdigit((unsigned char) *m_s
))
225 wxPluralFormsToken::Number number
= *m_s
++ - '0';
226 while (isdigit((unsigned char) *m_s
))
228 number
= number
* 10 + (*m_s
++ - '0');
230 m_token
.setNumber(number
);
231 type
= wxPluralFormsToken::T_NUMBER
;
233 else if (isalpha((unsigned char) *m_s
))
235 const char* begin
= m_s
++;
236 while (isalnum((unsigned char) *m_s
))
240 size_t size
= m_s
- begin
;
241 if (size
== 1 && memcmp(begin
, "n", size
) == 0)
243 type
= wxPluralFormsToken::T_N
;
245 else if (size
== 6 && memcmp(begin
, "plural", size
) == 0)
247 type
= wxPluralFormsToken::T_PLURAL
;
249 else if (size
== 8 && memcmp(begin
, "nplurals", size
) == 0)
251 type
= wxPluralFormsToken::T_NPLURALS
;
254 else if (*m_s
== '=')
260 type
= wxPluralFormsToken::T_EQUAL
;
264 type
= wxPluralFormsToken::T_ASSIGN
;
267 else if (*m_s
== '>')
273 type
= wxPluralFormsToken::T_GREATER_OR_EQUAL
;
277 type
= wxPluralFormsToken::T_GREATER
;
280 else if (*m_s
== '<')
286 type
= wxPluralFormsToken::T_LESS_OR_EQUAL
;
290 type
= wxPluralFormsToken::T_LESS
;
293 else if (*m_s
== '%')
296 type
= wxPluralFormsToken::T_REMINDER
;
298 else if (*m_s
== '!' && m_s
[1] == '=')
301 type
= wxPluralFormsToken::T_NOT_EQUAL
;
303 else if (*m_s
== '&' && m_s
[1] == '&')
306 type
= wxPluralFormsToken::T_LOGICAL_AND
;
308 else if (*m_s
== '|' && m_s
[1] == '|')
311 type
= wxPluralFormsToken::T_LOGICAL_OR
;
313 else if (*m_s
== '?')
316 type
= wxPluralFormsToken::T_QUESTION
;
318 else if (*m_s
== ':')
321 type
= wxPluralFormsToken::T_COLON
;
322 } else if (*m_s
== ';') {
324 type
= wxPluralFormsToken::T_SEMICOLON
;
326 else if (*m_s
== '(')
329 type
= wxPluralFormsToken::T_LEFT_BRACKET
;
331 else if (*m_s
== ')')
334 type
= wxPluralFormsToken::T_RIGHT_BRACKET
;
336 m_token
.setType(type
);
337 return type
!= wxPluralFormsToken::T_ERROR
;
340 class wxPluralFormsNode
;
342 // NB: Can't use wxDEFINE_SCOPED_PTR_TYPE because wxPluralFormsNode is not
343 // fully defined yet:
344 class wxPluralFormsNodePtr
347 wxPluralFormsNodePtr(wxPluralFormsNode
*p
= NULL
) : m_p(p
) {}
348 ~wxPluralFormsNodePtr();
349 wxPluralFormsNode
& operator*() const { return *m_p
; }
350 wxPluralFormsNode
* operator->() const { return m_p
; }
351 wxPluralFormsNode
* get() const { return m_p
; }
352 wxPluralFormsNode
* release();
353 void reset(wxPluralFormsNode
*p
);
356 wxPluralFormsNode
*m_p
;
359 class wxPluralFormsNode
362 wxPluralFormsNode(const wxPluralFormsToken
& token
) : m_token(token
) {}
363 const wxPluralFormsToken
& token() const { return m_token
; }
364 const wxPluralFormsNode
* node(size_t i
) const
365 { return m_nodes
[i
].get(); }
366 void setNode(size_t i
, wxPluralFormsNode
* n
);
367 wxPluralFormsNode
* releaseNode(size_t i
);
368 wxPluralFormsToken::Number
evaluate(wxPluralFormsToken::Number n
) const;
371 wxPluralFormsToken m_token
;
372 wxPluralFormsNodePtr m_nodes
[3];
375 wxPluralFormsNodePtr::~wxPluralFormsNodePtr()
379 wxPluralFormsNode
* wxPluralFormsNodePtr::release()
381 wxPluralFormsNode
*p
= m_p
;
385 void wxPluralFormsNodePtr::reset(wxPluralFormsNode
*p
)
395 void wxPluralFormsNode::setNode(size_t i
, wxPluralFormsNode
* n
)
400 wxPluralFormsNode
* wxPluralFormsNode::releaseNode(size_t i
)
402 return m_nodes
[i
].release();
405 wxPluralFormsToken::Number
406 wxPluralFormsNode::evaluate(wxPluralFormsToken::Number n
) const
408 switch (token().type())
411 case wxPluralFormsToken::T_NUMBER
:
412 return token().number();
413 case wxPluralFormsToken::T_N
:
416 case wxPluralFormsToken::T_EQUAL
:
417 return node(0)->evaluate(n
) == node(1)->evaluate(n
);
418 case wxPluralFormsToken::T_NOT_EQUAL
:
419 return node(0)->evaluate(n
) != node(1)->evaluate(n
);
420 case wxPluralFormsToken::T_GREATER
:
421 return node(0)->evaluate(n
) > node(1)->evaluate(n
);
422 case wxPluralFormsToken::T_GREATER_OR_EQUAL
:
423 return node(0)->evaluate(n
) >= node(1)->evaluate(n
);
424 case wxPluralFormsToken::T_LESS
:
425 return node(0)->evaluate(n
) < node(1)->evaluate(n
);
426 case wxPluralFormsToken::T_LESS_OR_EQUAL
:
427 return node(0)->evaluate(n
) <= node(1)->evaluate(n
);
428 case wxPluralFormsToken::T_REMINDER
:
430 wxPluralFormsToken::Number number
= node(1)->evaluate(n
);
433 return node(0)->evaluate(n
) % number
;
440 case wxPluralFormsToken::T_LOGICAL_AND
:
441 return node(0)->evaluate(n
) && node(1)->evaluate(n
);
442 case wxPluralFormsToken::T_LOGICAL_OR
:
443 return node(0)->evaluate(n
) || node(1)->evaluate(n
);
445 case wxPluralFormsToken::T_QUESTION
:
446 return node(0)->evaluate(n
)
447 ? node(1)->evaluate(n
)
448 : node(2)->evaluate(n
);
455 class wxPluralFormsCalculator
458 wxPluralFormsCalculator() : m_nplurals(0), m_plural(0) {}
460 // input: number, returns msgstr index
461 int evaluate(int n
) const;
463 // input: text after "Plural-Forms:" (e.g. "nplurals=2; plural=(n != 1);"),
464 // if s == 0, creates default handler
465 // returns 0 if error
466 static wxPluralFormsCalculator
* make(const char* s
= 0);
468 ~wxPluralFormsCalculator() {}
470 void init(wxPluralFormsToken::Number nplurals
, wxPluralFormsNode
* plural
);
473 wxPluralFormsToken::Number m_nplurals
;
474 wxPluralFormsNodePtr m_plural
;
477 wxDEFINE_SCOPED_PTR_TYPE(wxPluralFormsCalculator
)
479 void wxPluralFormsCalculator::init(wxPluralFormsToken::Number nplurals
,
480 wxPluralFormsNode
* plural
)
482 m_nplurals
= nplurals
;
483 m_plural
.reset(plural
);
486 int wxPluralFormsCalculator::evaluate(int n
) const
488 if (m_plural
.get() == 0)
492 wxPluralFormsToken::Number number
= m_plural
->evaluate(n
);
493 if (number
< 0 || number
> m_nplurals
)
501 class wxPluralFormsParser
504 wxPluralFormsParser(wxPluralFormsScanner
& scanner
) : m_scanner(scanner
) {}
505 bool parse(wxPluralFormsCalculator
& rCalculator
);
508 wxPluralFormsNode
* parsePlural();
509 // stops at T_SEMICOLON, returns 0 if error
510 wxPluralFormsScanner
& m_scanner
;
511 const wxPluralFormsToken
& token() const;
514 wxPluralFormsNode
* expression();
515 wxPluralFormsNode
* logicalOrExpression();
516 wxPluralFormsNode
* logicalAndExpression();
517 wxPluralFormsNode
* equalityExpression();
518 wxPluralFormsNode
* multiplicativeExpression();
519 wxPluralFormsNode
* relationalExpression();
520 wxPluralFormsNode
* pmExpression();
523 bool wxPluralFormsParser::parse(wxPluralFormsCalculator
& rCalculator
)
525 if (token().type() != wxPluralFormsToken::T_NPLURALS
)
529 if (token().type() != wxPluralFormsToken::T_ASSIGN
)
533 if (token().type() != wxPluralFormsToken::T_NUMBER
)
535 wxPluralFormsToken::Number nplurals
= token().number();
538 if (token().type() != wxPluralFormsToken::T_SEMICOLON
)
542 if (token().type() != wxPluralFormsToken::T_PLURAL
)
546 if (token().type() != wxPluralFormsToken::T_ASSIGN
)
550 wxPluralFormsNode
* plural
= parsePlural();
553 if (token().type() != wxPluralFormsToken::T_SEMICOLON
)
557 if (token().type() != wxPluralFormsToken::T_EOF
)
559 rCalculator
.init(nplurals
, plural
);
563 wxPluralFormsNode
* wxPluralFormsParser::parsePlural()
565 wxPluralFormsNode
* p
= expression();
570 wxPluralFormsNodePtr
n(p
);
571 if (token().type() != wxPluralFormsToken::T_SEMICOLON
)
578 const wxPluralFormsToken
& wxPluralFormsParser::token() const
580 return m_scanner
.token();
583 bool wxPluralFormsParser::nextToken()
585 if (!m_scanner
.nextToken())
590 wxPluralFormsNode
* wxPluralFormsParser::expression()
592 wxPluralFormsNode
* p
= logicalOrExpression();
595 wxPluralFormsNodePtr
n(p
);
596 if (token().type() == wxPluralFormsToken::T_QUESTION
)
598 wxPluralFormsNodePtr
qn(new wxPluralFormsNode(token()));
609 if (token().type() != wxPluralFormsToken::T_COLON
)
623 qn
->setNode(0, n
.release());
629 wxPluralFormsNode
*wxPluralFormsParser::logicalOrExpression()
631 wxPluralFormsNode
* p
= logicalAndExpression();
634 wxPluralFormsNodePtr
ln(p
);
635 if (token().type() == wxPluralFormsToken::T_LOGICAL_OR
)
637 wxPluralFormsNodePtr
un(new wxPluralFormsNode(token()));
642 p
= logicalOrExpression();
647 wxPluralFormsNodePtr
rn(p
); // right
648 if (rn
->token().type() == wxPluralFormsToken::T_LOGICAL_OR
)
650 // see logicalAndExpression comment
651 un
->setNode(0, ln
.release());
652 un
->setNode(1, rn
->releaseNode(0));
653 rn
->setNode(0, un
.release());
658 un
->setNode(0, ln
.release());
659 un
->setNode(1, rn
.release());
665 wxPluralFormsNode
* wxPluralFormsParser::logicalAndExpression()
667 wxPluralFormsNode
* p
= equalityExpression();
670 wxPluralFormsNodePtr
ln(p
); // left
671 if (token().type() == wxPluralFormsToken::T_LOGICAL_AND
)
673 wxPluralFormsNodePtr
un(new wxPluralFormsNode(token())); // up
678 p
= logicalAndExpression();
683 wxPluralFormsNodePtr
rn(p
); // right
684 if (rn
->token().type() == wxPluralFormsToken::T_LOGICAL_AND
)
686 // transform 1 && (2 && 3) -> (1 && 2) && 3
690 un
->setNode(0, ln
.release());
691 un
->setNode(1, rn
->releaseNode(0));
692 rn
->setNode(0, un
.release());
696 un
->setNode(0, ln
.release());
697 un
->setNode(1, rn
.release());
703 wxPluralFormsNode
* wxPluralFormsParser::equalityExpression()
705 wxPluralFormsNode
* p
= relationalExpression();
708 wxPluralFormsNodePtr
n(p
);
709 if (token().type() == wxPluralFormsToken::T_EQUAL
710 || token().type() == wxPluralFormsToken::T_NOT_EQUAL
)
712 wxPluralFormsNodePtr
qn(new wxPluralFormsNode(token()));
717 p
= relationalExpression();
723 qn
->setNode(0, n
.release());
729 wxPluralFormsNode
* wxPluralFormsParser::relationalExpression()
731 wxPluralFormsNode
* p
= multiplicativeExpression();
734 wxPluralFormsNodePtr
n(p
);
735 if (token().type() == wxPluralFormsToken::T_GREATER
736 || token().type() == wxPluralFormsToken::T_LESS
737 || token().type() == wxPluralFormsToken::T_GREATER_OR_EQUAL
738 || token().type() == wxPluralFormsToken::T_LESS_OR_EQUAL
)
740 wxPluralFormsNodePtr
qn(new wxPluralFormsNode(token()));
745 p
= multiplicativeExpression();
751 qn
->setNode(0, n
.release());
757 wxPluralFormsNode
* wxPluralFormsParser::multiplicativeExpression()
759 wxPluralFormsNode
* p
= pmExpression();
762 wxPluralFormsNodePtr
n(p
);
763 if (token().type() == wxPluralFormsToken::T_REMINDER
)
765 wxPluralFormsNodePtr
qn(new wxPluralFormsNode(token()));
776 qn
->setNode(0, n
.release());
782 wxPluralFormsNode
* wxPluralFormsParser::pmExpression()
784 wxPluralFormsNodePtr n
;
785 if (token().type() == wxPluralFormsToken::T_N
786 || token().type() == wxPluralFormsToken::T_NUMBER
)
788 n
.reset(new wxPluralFormsNode(token()));
794 else if (token().type() == wxPluralFormsToken::T_LEFT_BRACKET
) {
799 wxPluralFormsNode
* p
= expression();
805 if (token().type() != wxPluralFormsToken::T_RIGHT_BRACKET
)
821 wxPluralFormsCalculator
* wxPluralFormsCalculator::make(const char* s
)
823 wxPluralFormsCalculatorPtr
calculator(new wxPluralFormsCalculator
);
826 wxPluralFormsScanner
scanner(s
);
827 wxPluralFormsParser
p(scanner
);
828 if (!p
.parse(*calculator
))
833 return calculator
.release();
839 // ----------------------------------------------------------------------------
840 // wxMsgCatalogFile corresponds to one disk-file message catalog.
842 // This is a "low-level" class and is used only by wxMsgCatalog
843 // NOTE: for the documentation of the binary catalog (.MO) files refer to
844 // the GNU gettext manual:
845 // http://www.gnu.org/software/autoconf/manual/gettext/MO-Files.html
846 // ----------------------------------------------------------------------------
848 WX_DECLARE_EXPORTED_STRING_HASH_MAP(wxString
, wxMessagesHash
);
850 class wxMsgCatalogFile
857 // load the catalog from disk (szDirPrefix corresponds to language)
858 bool Load(const wxString
& szDirPrefix
, const wxString
& szName
,
859 wxPluralFormsCalculatorPtr
& rPluralFormsCalculator
);
861 // fills the hash with string-translation pairs
862 bool FillHash(wxMessagesHash
& hash
,
863 const wxString
& msgIdCharset
,
864 bool convertEncoding
) const;
866 // return the charset of the strings in this catalog or empty string if
868 wxString
GetCharset() const { return m_charset
; }
871 // this implementation is binary compatible with GNU gettext() version 0.10
873 // an entry in the string table
874 struct wxMsgTableEntry
876 size_t32 nLen
; // length of the string
877 size_t32 ofsString
; // pointer to the string
880 // header of a .mo file
881 struct wxMsgCatalogHeader
883 size_t32 magic
, // offset +00: magic id
884 revision
, // +04: revision
885 numStrings
; // +08: number of strings in the file
886 size_t32 ofsOrigTable
, // +0C: start of original string table
887 ofsTransTable
; // +10: start of translated string table
888 size_t32 nHashSize
, // +14: hash table size
889 ofsHashTable
; // +18: offset of hash table start
892 // all data is stored here
893 wxMemoryBuffer m_data
;
896 size_t32 m_numStrings
; // number of strings in this domain
897 wxMsgTableEntry
*m_pOrigTable
, // pointer to original strings
898 *m_pTransTable
; // translated
900 wxString m_charset
; // from the message catalog header
903 // swap the 2 halves of 32 bit integer if needed
904 size_t32
Swap(size_t32 ui
) const
906 return m_bSwapped
? (ui
<< 24) | ((ui
& 0xff00) << 8) |
907 ((ui
>> 8) & 0xff00) | (ui
>> 24)
911 // just return the pointer to the start of the data as "char *" to
912 // facilitate doing pointer arithmetic with it
913 char *StringData() const
915 return static_cast<char *>(m_data
.GetData());
918 const char *StringAtOfs(wxMsgTableEntry
*pTable
, size_t32 n
) const
920 const wxMsgTableEntry
* const ent
= pTable
+ n
;
922 // this check could fail for a corrupt message catalog
923 size_t32 ofsString
= Swap(ent
->ofsString
);
924 if ( ofsString
+ Swap(ent
->nLen
) > m_data
.GetDataLen())
929 return StringData() + ofsString
;
932 bool m_bSwapped
; // wrong endianness?
934 wxDECLARE_NO_COPY_CLASS(wxMsgCatalogFile
);
938 // ----------------------------------------------------------------------------
939 // wxMsgCatalog corresponds to one loaded message catalog.
941 // This is a "low-level" class and is used only by wxLocale (that's why
942 // it's designed to be stored in a linked list)
943 // ----------------------------------------------------------------------------
949 wxMsgCatalog() { m_conv
= NULL
; }
953 // load the catalog from disk (szDirPrefix corresponds to language)
954 bool Load(const wxString
& dirPrefix
, const wxString
& name
,
955 const wxString
& msgIdCharset
, bool bConvertEncoding
= false);
957 // get name of the catalog
958 wxString
GetName() const { return m_name
; }
960 // get the translated string: returns NULL if not found
961 const wxString
*GetString(const wxString
& sz
, size_t n
= size_t(-1)) const;
963 // public variable pointing to the next element in a linked list (or NULL)
964 wxMsgCatalog
*m_pNext
;
967 wxMessagesHash m_messages
; // all messages in the catalog
968 wxString m_name
; // name of the domain
971 // the conversion corresponding to this catalog charset if we installed it
976 wxPluralFormsCalculatorPtr m_pluralFormsCalculator
;
979 // ----------------------------------------------------------------------------
981 // ----------------------------------------------------------------------------
983 // the list of the directories to search for message catalog files
984 static wxArrayString gs_searchPrefixes
;
986 // ============================================================================
988 // ============================================================================
990 // ----------------------------------------------------------------------------
992 // ----------------------------------------------------------------------------
996 // helper used by wxLanguageInfo::GetLocaleName() and elsewhere to determine
997 // whether the locale is Unicode-only (it is if this function returns empty
999 static wxString
wxGetANSICodePageForLocale(LCID lcid
)
1004 if ( ::GetLocaleInfo(lcid
, LOCALE_IDEFAULTANSICODEPAGE
,
1005 buffer
, WXSIZEOF(buffer
)) > 0 )
1007 if ( buffer
[0] != wxT('0') || buffer
[1] != wxT('\0') )
1009 //else: this locale doesn't use ANSI code page
1015 wxUint32
wxLanguageInfo::GetLCID() const
1017 return MAKELCID(MAKELANGID(WinLang
, WinSublang
), SORT_DEFAULT
);
1020 wxString
wxLanguageInfo::GetLocaleName() const
1024 const LCID lcid
= GetLCID();
1027 buffer
[0] = wxT('\0');
1028 if ( !::GetLocaleInfo(lcid
, LOCALE_SENGLANGUAGE
, buffer
, WXSIZEOF(buffer
)) )
1030 wxLogLastError(wxT("GetLocaleInfo(LOCALE_SENGLANGUAGE)"));
1035 if ( ::GetLocaleInfo(lcid
, LOCALE_SENGCOUNTRY
,
1036 buffer
, WXSIZEOF(buffer
)) > 0 )
1038 locale
<< wxT('_') << buffer
;
1041 const wxString cp
= wxGetANSICodePageForLocale(lcid
);
1044 locale
<< wxT('.') << cp
;
1052 // ----------------------------------------------------------------------------
1053 // wxMsgCatalogFile class
1054 // ----------------------------------------------------------------------------
1056 wxMsgCatalogFile::wxMsgCatalogFile()
1060 wxMsgCatalogFile::~wxMsgCatalogFile()
1064 // return the directories to search for message catalogs under the given
1065 // prefix, separated by wxPATH_SEP
1067 wxString
GetMsgCatalogSubdirs(const wxString
& prefix
, const wxString
& lang
)
1069 // Search first in Unix-standard prefix/lang/LC_MESSAGES, then in
1070 // prefix/lang and finally in just prefix.
1072 // Note that we use LC_MESSAGES on all platforms and not just Unix, because
1073 // it doesn't cost much to look into one more directory and doing it this
1074 // way has two important benefits:
1075 // a) we don't break compatibility with wx-2.6 and older by stopping to
1076 // look in a directory where the catalogs used to be and thus silently
1077 // breaking apps after they are recompiled against the latest wx
1078 // b) it makes it possible to package app's support files in the same
1079 // way on all target platforms
1080 const wxString pathPrefix
= wxFileName(prefix
, lang
).GetFullPath();
1082 wxString searchPath
;
1083 searchPath
.reserve(4*pathPrefix
.length());
1084 searchPath
<< pathPrefix
<< wxFILE_SEP_PATH
<< "LC_MESSAGES" << wxPATH_SEP
1085 << prefix
<< wxFILE_SEP_PATH
<< wxPATH_SEP
1091 // construct the search path for the given language
1092 static wxString
GetFullSearchPath(const wxString
& lang
)
1094 // first take the entries explicitly added by the program
1095 wxArrayString paths
;
1096 paths
.reserve(gs_searchPrefixes
.size() + 1);
1098 count
= gs_searchPrefixes
.size();
1099 for ( n
= 0; n
< count
; n
++ )
1101 paths
.Add(GetMsgCatalogSubdirs(gs_searchPrefixes
[n
], lang
));
1106 // then look in the standard location
1107 const wxString stdp
= wxStandardPaths::Get().
1108 GetLocalizedResourcesDir(lang
, wxStandardPaths::ResourceCat_Messages
);
1110 if ( paths
.Index(stdp
) == wxNOT_FOUND
)
1112 #endif // wxUSE_STDPATHS
1114 // last look in default locations
1116 // LC_PATH is a standard env var containing the search path for the .mo
1118 const char *pszLcPath
= wxGetenv("LC_PATH");
1121 const wxString lcp
= GetMsgCatalogSubdirs(pszLcPath
, lang
);
1122 if ( paths
.Index(lcp
) == wxNOT_FOUND
)
1126 // also add the one from where wxWin was installed:
1127 wxString wxp
= wxGetInstallPrefix();
1130 wxp
= GetMsgCatalogSubdirs(wxp
+ wxS("/share/locale"), lang
);
1131 if ( paths
.Index(wxp
) == wxNOT_FOUND
)
1137 // finally construct the full search path
1138 wxString searchPath
;
1139 searchPath
.reserve(500);
1140 count
= paths
.size();
1141 for ( n
= 0; n
< count
; n
++ )
1143 searchPath
+= paths
[n
];
1144 if ( n
!= count
- 1 )
1145 searchPath
+= wxPATH_SEP
;
1151 // open disk file and read in it's contents
1152 bool wxMsgCatalogFile::Load(const wxString
& szDirPrefix
, const wxString
& szName
,
1153 wxPluralFormsCalculatorPtr
& rPluralFormsCalculator
)
1155 wxCHECK_MSG( szDirPrefix
.length() >= LEN_LANG
, false,
1156 "invalid language specification" );
1158 wxString searchPath
;
1161 // first look for the catalog for this language and the current locale:
1162 // notice that we don't use the system name for the locale as this would
1163 // force us to install catalogs in different locations depending on the
1164 // system but always use the canonical name
1165 wxFontEncoding encSys
= wxLocale::GetSystemEncoding();
1166 if ( encSys
!= wxFONTENCODING_SYSTEM
)
1168 wxString
fullname(szDirPrefix
);
1169 fullname
<< wxS('.') << wxFontMapperBase::GetEncodingName(encSys
);
1170 searchPath
<< GetFullSearchPath(fullname
) << wxPATH_SEP
;
1172 #endif // wxUSE_FONTMAP
1175 searchPath
+= GetFullSearchPath(szDirPrefix
);
1176 if ( szDirPrefix
.length() > LEN_LANG
&& szDirPrefix
[LEN_LANG
] == wxS('_') )
1178 // also add just base locale name: for things like "fr_BE" (Belgium
1179 // French) we should use fall back on plain "fr" if no Belgium-specific
1180 // message catalogs exist
1181 searchPath
<< wxPATH_SEP
1182 << GetFullSearchPath(ExtractLang(szDirPrefix
));
1185 wxLogTrace(TRACE_I18N
, wxS("Looking for \"%s.mo\" in search path \"%s\""),
1186 szName
, searchPath
);
1188 wxFileName
fn(szName
);
1189 fn
.SetExt(wxS("mo"));
1191 wxString strFullName
;
1192 if ( !wxFindFileInPath(&strFullName
, searchPath
, fn
.GetFullPath()) )
1194 wxLogVerbose(_("catalog file for domain '%s' not found."), szName
);
1195 wxLogTrace(TRACE_I18N
, wxS("Catalog \"%s.mo\" not found"), szName
);
1199 // open file and read its data
1200 wxLogVerbose(_("using catalog '%s' from '%s'."), szName
, strFullName
.c_str());
1201 wxLogTrace(TRACE_I18N
, wxS("Using catalog \"%s\"."), strFullName
.c_str());
1203 wxFile
fileMsg(strFullName
);
1204 if ( !fileMsg
.IsOpened() )
1207 // get the file size (assume it is less than 4Gb...)
1208 wxFileOffset lenFile
= fileMsg
.Length();
1209 if ( lenFile
== wxInvalidOffset
)
1212 size_t nSize
= wx_truncate_cast(size_t, lenFile
);
1213 wxASSERT_MSG( nSize
== lenFile
+ size_t(0), wxS("message catalog bigger than 4GB?") );
1215 // read the whole file in memory
1216 if ( fileMsg
.Read(m_data
.GetWriteBuf(nSize
), nSize
) != lenFile
)
1219 m_data
.UngetWriteBuf(nSize
);
1223 bool bValid
= m_data
.GetDataLen() > sizeof(wxMsgCatalogHeader
);
1225 const wxMsgCatalogHeader
*pHeader
= (wxMsgCatalogHeader
*)m_data
.GetData();
1227 // we'll have to swap all the integers if it's true
1228 m_bSwapped
= pHeader
->magic
== MSGCATALOG_MAGIC_SW
;
1230 // check the magic number
1231 bValid
= m_bSwapped
|| pHeader
->magic
== MSGCATALOG_MAGIC
;
1235 // it's either too short or has incorrect magic number
1236 wxLogWarning(_("'%s' is not a valid message catalog."), strFullName
.c_str());
1242 m_numStrings
= Swap(pHeader
->numStrings
);
1243 m_pOrigTable
= (wxMsgTableEntry
*)(StringData() +
1244 Swap(pHeader
->ofsOrigTable
));
1245 m_pTransTable
= (wxMsgTableEntry
*)(StringData() +
1246 Swap(pHeader
->ofsTransTable
));
1248 // now parse catalog's header and try to extract catalog charset and
1249 // plural forms formula from it:
1251 const char* headerData
= StringAtOfs(m_pOrigTable
, 0);
1252 if ( headerData
&& headerData
[0] == '\0' )
1254 // Extract the charset:
1255 const char * const header
= StringAtOfs(m_pTransTable
, 0);
1257 cset
= strstr(header
, "Content-Type: text/plain; charset=");
1260 cset
+= 34; // strlen("Content-Type: text/plain; charset=")
1262 const char * const csetEnd
= strchr(cset
, '\n');
1265 m_charset
= wxString(cset
, csetEnd
- cset
);
1266 if ( m_charset
== wxS("CHARSET") )
1268 // "CHARSET" is not valid charset, but lazy translator
1273 // else: incorrectly filled Content-Type header
1275 // Extract plural forms:
1276 const char * plurals
= strstr(header
, "Plural-Forms:");
1279 plurals
+= 13; // strlen("Plural-Forms:")
1280 const char * const pluralsEnd
= strchr(plurals
, '\n');
1283 const size_t pluralsLen
= pluralsEnd
- plurals
;
1284 wxCharBuffer
buf(pluralsLen
);
1285 strncpy(buf
.data(), plurals
, pluralsLen
);
1286 wxPluralFormsCalculator
* const
1287 pCalculator
= wxPluralFormsCalculator::make(buf
);
1290 rPluralFormsCalculator
.reset(pCalculator
);
1294 wxLogVerbose(_("Failed to parse Plural-Forms: '%s'"),
1300 if ( !rPluralFormsCalculator
.get() )
1301 rPluralFormsCalculator
.reset(wxPluralFormsCalculator::make());
1304 // everything is fine
1308 bool wxMsgCatalogFile::FillHash(wxMessagesHash
& hash
,
1309 const wxString
& msgIdCharset
,
1310 bool convertEncoding
) const
1313 // this parameter doesn't make sense, we always must convert encoding in
1315 convertEncoding
= true;
1317 if ( convertEncoding
)
1319 // determine if we need any conversion at all
1320 wxFontEncoding encCat
= wxFontMapperBase::GetEncodingFromName(m_charset
);
1321 if ( encCat
== wxLocale::GetSystemEncoding() )
1323 // no need to convert
1324 convertEncoding
= false;
1327 #endif // wxUSE_UNICODE/wxUSE_FONTMAP
1330 // conversion to use to convert catalog strings to the GUI encoding
1331 wxMBConv
*inputConv
,
1332 *inputConvPtr
= NULL
; // same as inputConv but safely deleteable
1333 if ( convertEncoding
&& !m_charset
.empty() )
1336 inputConv
= new wxCSConv(m_charset
);
1338 else // no need or not possible to convert the encoding
1341 // we must somehow convert the narrow strings in the message catalog to
1342 // wide strings, so use the default conversion if we have no charset
1343 inputConv
= wxConvCurrent
;
1344 #else // !wxUSE_UNICODE
1346 #endif // wxUSE_UNICODE/!wxUSE_UNICODE
1349 // conversion to apply to msgid strings before looking them up: we only
1350 // need it if the msgids are neither in 7 bit ASCII nor in the same
1351 // encoding as the catalog
1352 wxCSConv
*sourceConv
= msgIdCharset
.empty() || (msgIdCharset
== m_charset
)
1354 : new wxCSConv(msgIdCharset
);
1357 wxASSERT_MSG( msgIdCharset
.empty(),
1358 wxS("non-ASCII msgid languages only supported if wxUSE_WCHAR_T=1") );
1360 wxEncodingConverter converter
;
1361 if ( convertEncoding
)
1363 wxFontEncoding targetEnc
= wxFONTENCODING_SYSTEM
;
1364 wxFontEncoding enc
= wxFontMapperBase::Get()->CharsetToEncoding(m_charset
, false);
1365 if ( enc
== wxFONTENCODING_SYSTEM
)
1367 convertEncoding
= false; // unknown encoding
1371 targetEnc
= wxLocale::GetSystemEncoding();
1372 if (targetEnc
== wxFONTENCODING_SYSTEM
)
1374 wxFontEncodingArray a
= wxEncodingConverter::GetPlatformEquivalents(enc
);
1376 // no conversion needed, locale uses native encoding
1377 convertEncoding
= false;
1378 if (a
.GetCount() == 0)
1379 // we don't know common equiv. under this platform
1380 convertEncoding
= false;
1385 if ( convertEncoding
)
1387 converter
.Init(enc
, targetEnc
);
1390 #endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T
1391 (void)convertEncoding
; // get rid of warnings about unused parameter
1393 for (size_t32 i
= 0; i
< m_numStrings
; i
++)
1395 const char *data
= StringAtOfs(m_pOrigTable
, i
);
1397 return false; // may happen for invalid MO files
1401 msgid
= wxString(data
, *inputConv
);
1404 if ( inputConv
&& sourceConv
)
1405 msgid
= wxString(inputConv
->cMB2WC(data
), *sourceConv
);
1409 #endif // wxUSE_UNICODE
1411 data
= StringAtOfs(m_pTransTable
, i
);
1413 return false; // may happen for invalid MO files
1415 size_t length
= Swap(m_pTransTable
[i
].nLen
);
1418 while (offset
< length
)
1420 const char * const str
= data
+ offset
;
1424 msgstr
= wxString(str
, *inputConv
);
1427 msgstr
= wxString(inputConv
->cMB2WC(str
), *wxConvUI
);
1430 #else // !wxUSE_WCHAR_T
1432 if ( bConvertEncoding
)
1433 msgstr
= wxString(converter
.Convert(str
));
1437 #endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T
1439 if ( !msgstr
.empty() )
1441 hash
[index
== 0 ? msgid
: msgid
+ wxChar(index
)] = msgstr
;
1445 // IMPORTANT: accesses to the 'data' pointer are valid only for
1446 // the first 'length+1' bytes (GNU specs says that the
1447 // final NUL is not counted in length); using wxStrnlen()
1448 // we make sure we don't access memory beyond the valid range
1449 // (which otherwise may happen for invalid MO files):
1450 offset
+= wxStrnlen(str
, length
- offset
) + 1;
1457 delete inputConvPtr
;
1458 #endif // wxUSE_WCHAR_T
1464 // ----------------------------------------------------------------------------
1465 // wxMsgCatalog class
1466 // ----------------------------------------------------------------------------
1469 wxMsgCatalog::~wxMsgCatalog()
1473 if ( wxConvUI
== m_conv
)
1475 // we only change wxConvUI if it points to wxConvLocal so we reset
1476 // it back to it too
1477 wxConvUI
= &wxConvLocal
;
1483 #endif // !wxUSE_UNICODE
1485 bool wxMsgCatalog::Load(const wxString
& dirPrefix
, const wxString
& name
,
1486 const wxString
& msgIdCharset
, bool bConvertEncoding
)
1488 wxMsgCatalogFile file
;
1492 if ( !file
.Load(dirPrefix
, name
, m_pluralFormsCalculator
) )
1495 if ( !file
.FillHash(m_messages
, msgIdCharset
, bConvertEncoding
) )
1499 // we should use a conversion compatible with the message catalog encoding
1500 // in the GUI if we don't convert the strings to the current conversion but
1501 // as the encoding is global, only change it once, otherwise we could get
1502 // into trouble if we use several message catalogs with different encodings
1504 // this is, of course, a hack but it at least allows the program to use
1505 // message catalogs in any encodings without asking the user to change his
1507 if ( !bConvertEncoding
&&
1508 !file
.GetCharset().empty() &&
1509 wxConvUI
== &wxConvLocal
)
1512 m_conv
= new wxCSConv(file
.GetCharset());
1514 #endif // !wxUSE_UNICODE
1519 const wxString
*wxMsgCatalog::GetString(const wxString
& str
, size_t n
) const
1522 if (n
!= size_t(-1))
1524 index
= m_pluralFormsCalculator
->evaluate(n
);
1526 wxMessagesHash::const_iterator i
;
1529 i
= m_messages
.find(wxString(str
) + wxChar(index
)); // plural
1533 i
= m_messages
.find(str
);
1536 if ( i
!= m_messages
.end() )
1544 // ----------------------------------------------------------------------------
1546 // ----------------------------------------------------------------------------
1548 #include "wx/arrimpl.cpp"
1549 WX_DECLARE_EXPORTED_OBJARRAY(wxLanguageInfo
, wxLanguageInfoArray
);
1550 WX_DEFINE_OBJARRAY(wxLanguageInfoArray
)
1552 wxLanguageInfoArray
*wxLocale::ms_languagesDB
= NULL
;
1554 /*static*/ void wxLocale::CreateLanguagesDB()
1556 if (ms_languagesDB
== NULL
)
1558 ms_languagesDB
= new wxLanguageInfoArray
;
1563 /*static*/ void wxLocale::DestroyLanguagesDB()
1565 delete ms_languagesDB
;
1566 ms_languagesDB
= NULL
;
1570 void wxLocale::DoCommonInit()
1572 m_pszOldLocale
= NULL
;
1574 m_pOldLocale
= wxSetLocale(this);
1577 m_language
= wxLANGUAGE_UNKNOWN
;
1578 m_initialized
= false;
1581 // NB: this function has (desired) side effect of changing current locale
1582 bool wxLocale::Init(const wxString
& name
,
1583 const wxString
& shortName
,
1584 const wxString
& locale
,
1586 bool bConvertEncoding
)
1588 wxASSERT_MSG( !m_initialized
,
1589 wxS("you can't call wxLocale::Init more than once") );
1591 m_initialized
= true;
1593 m_strShort
= shortName
;
1594 m_bConvertEncoding
= bConvertEncoding
;
1595 m_language
= wxLANGUAGE_UNKNOWN
;
1597 // change current locale (default: same as long name)
1598 wxString
szLocale(locale
);
1599 if ( szLocale
.empty() )
1601 // the argument to setlocale()
1602 szLocale
= shortName
;
1604 wxCHECK_MSG( !szLocale
.empty(), false,
1605 wxS("no locale to set in wxLocale::Init()") );
1608 const char *oldLocale
= wxSetlocale(LC_ALL
, szLocale
);
1610 m_pszOldLocale
= wxStrdup(oldLocale
);
1612 m_pszOldLocale
= NULL
;
1614 if ( m_pszOldLocale
== NULL
)
1616 wxLogError(_("locale '%s' can not be set."), szLocale
);
1619 // the short name will be used to look for catalog files as well,
1620 // so we need something here
1621 if ( m_strShort
.empty() ) {
1622 // FIXME I don't know how these 2 letter abbreviations are formed,
1623 // this wild guess is surely wrong
1624 if ( !szLocale
.empty() )
1626 m_strShort
+= (wxChar
)wxTolower(szLocale
[0]);
1627 if ( szLocale
.length() > 1 )
1628 m_strShort
+= (wxChar
)wxTolower(szLocale
[1]);
1632 // load the default catalog with wxWidgets standard messages
1637 bOk
= AddCatalog(wxS("wxstd"));
1639 // there may be a catalog with toolkit specific overrides, it is not
1640 // an error if this does not exist
1643 wxString
port(wxPlatformInfo::Get().GetPortIdName());
1644 if ( !port
.empty() )
1646 AddCatalog(port
.BeforeFirst(wxS('/')).MakeLower());
1655 #if defined(__UNIX__) && wxUSE_UNICODE && !defined(__WXMAC__)
1656 static const char *wxSetlocaleTryUTF8(int c
, const wxString
& lc
)
1658 const char *l
= NULL
;
1660 // NB: We prefer to set UTF-8 locale if it's possible and only fall back to
1661 // non-UTF-8 locale if it fails
1667 buf2
= buf
+ wxS(".UTF-8");
1668 l
= wxSetlocale(c
, buf2
);
1671 buf2
= buf
+ wxS(".utf-8");
1672 l
= wxSetlocale(c
, buf2
);
1676 buf2
= buf
+ wxS(".UTF8");
1677 l
= wxSetlocale(c
, buf2
);
1681 buf2
= buf
+ wxS(".utf8");
1682 l
= wxSetlocale(c
, buf2
);
1686 // if we can't set UTF-8 locale, try non-UTF-8 one:
1688 l
= wxSetlocale(c
, lc
);
1693 #define wxSetlocaleTryUTF8(c, lc) wxSetlocale(c, lc)
1696 bool wxLocale::Init(int language
, int flags
)
1700 int lang
= language
;
1701 if (lang
== wxLANGUAGE_DEFAULT
)
1703 // auto detect the language
1704 lang
= GetSystemLanguage();
1707 // We failed to detect system language, so we will use English:
1708 if (lang
== wxLANGUAGE_UNKNOWN
)
1713 const wxLanguageInfo
*info
= GetLanguageInfo(lang
);
1715 // Unknown language:
1718 wxLogError(wxS("Unknown language %i."), lang
);
1722 wxString name
= info
->Description
;
1723 wxString canonical
= info
->CanonicalName
;
1727 #if defined(__OS2__)
1728 const char *retloc
= wxSetlocale(LC_ALL
, wxEmptyString
);
1729 #elif defined(__UNIX__) && !defined(__WXMAC__)
1730 if (language
!= wxLANGUAGE_DEFAULT
)
1731 locale
= info
->CanonicalName
;
1733 const char *retloc
= wxSetlocaleTryUTF8(LC_ALL
, locale
);
1735 const wxString langOnly
= ExtractLang(locale
);
1738 // Some C libraries don't like xx_YY form and require xx only
1739 retloc
= wxSetlocaleTryUTF8(LC_ALL
, langOnly
);
1743 // some systems (e.g. FreeBSD and HP-UX) don't have xx_YY aliases but
1744 // require the full xx_YY.encoding form, so try using UTF-8 because this is
1745 // the only thing we can do generically
1747 // TODO: add encodings applicable to each language to the lang DB and try
1748 // them all in turn here
1751 const wxChar
**names
=
1752 wxFontMapperBase::GetAllEncodingNames(wxFONTENCODING_UTF8
);
1755 retloc
= wxSetlocale(LC_ALL
, locale
+ wxS('.') + *names
++);
1760 #endif // wxUSE_FONTMAP
1764 // Some C libraries (namely glibc) still use old ISO 639,
1765 // so will translate the abbrev for them
1767 if ( langOnly
== wxS("he") )
1768 localeAlt
= wxS("iw") + ExtractNotLang(locale
);
1769 else if ( langOnly
== wxS("id") )
1770 localeAlt
= wxS("in") + ExtractNotLang(locale
);
1771 else if ( langOnly
== wxS("yi") )
1772 localeAlt
= wxS("ji") + ExtractNotLang(locale
);
1773 else if ( langOnly
== wxS("nb") )
1774 localeAlt
= wxS("no_NO");
1775 else if ( langOnly
== wxS("nn") )
1776 localeAlt
= wxS("no_NY");
1778 if ( !localeAlt
.empty() )
1780 retloc
= wxSetlocaleTryUTF8(LC_ALL
, localeAlt
);
1782 retloc
= wxSetlocaleTryUTF8(LC_ALL
, ExtractLang(localeAlt
));
1790 // at least in AIX 5.2 libc is buggy and the string returned from
1791 // setlocale(LC_ALL) can't be passed back to it because it returns 6
1792 // strings (one for each locale category), i.e. for C locale we get back
1795 // this contradicts IBM own docs but this is not of much help, so just work
1796 // around it in the crudest possible manner
1797 char* p
= const_cast<char*>(wxStrchr(retloc
, ' '));
1802 #elif defined(__WIN32__)
1803 const char *retloc
= "C";
1804 if ( language
!= wxLANGUAGE_DEFAULT
)
1806 if ( info
->WinLang
== 0 )
1808 wxLogWarning(wxS("Locale '%s' not supported by OS."), name
.c_str());
1809 // retloc already set to "C"
1811 else // language supported by Windows
1813 // Windows CE doesn't have SetThreadLocale() and there doesn't seem
1814 // to be any equivalent
1816 const wxUint32 lcid
= info
->GetLCID();
1818 // change locale used by Windows functions
1819 ::SetThreadLocale(lcid
);
1822 // and also call setlocale() to change locale used by the CRT
1823 locale
= info
->GetLocaleName();
1824 if ( locale
.empty() )
1828 else // have a valid locale
1830 retloc
= wxSetlocale(LC_ALL
, locale
);
1834 else // language == wxLANGUAGE_DEFAULT
1836 retloc
= wxSetlocale(LC_ALL
, wxEmptyString
);
1839 #if wxUSE_UNICODE && (defined(__VISUALC__) || defined(__MINGW32__))
1840 // VC++ setlocale() (also used by Mingw) can't set locale to languages that
1841 // can only be written using Unicode, therefore wxSetlocale() call fails
1842 // for such languages but we don't want to report it as an error -- so that
1843 // at least message catalogs can be used.
1846 if ( wxGetANSICodePageForLocale(LOCALE_USER_DEFAULT
).empty() )
1848 // we set the locale to a Unicode-only language, don't treat the
1849 // inability of CRT to use it as an error
1853 #endif // CRT not handling Unicode-only languages
1857 #elif defined(__WXMAC__)
1858 if (lang
== wxLANGUAGE_DEFAULT
)
1859 locale
= wxEmptyString
;
1861 locale
= info
->CanonicalName
;
1863 const char *retloc
= wxSetlocale(LC_ALL
, locale
);
1867 // Some C libraries don't like xx_YY form and require xx only
1868 retloc
= wxSetlocale(LC_ALL
, ExtractLang(locale
));
1873 #define WX_NO_LOCALE_SUPPORT
1876 #ifndef WX_NO_LOCALE_SUPPORT
1879 wxLogWarning(_("Cannot set locale to language \"%s\"."), name
.c_str());
1881 // continue nevertheless and try to load at least the translations for
1885 if ( !Init(name
, canonical
, retloc
,
1886 (flags
& wxLOCALE_LOAD_DEFAULT
) != 0,
1887 (flags
& wxLOCALE_CONV_ENCODING
) != 0) )
1892 if (IsOk()) // setlocale() succeeded
1896 #endif // !WX_NO_LOCALE_SUPPORT
1901 void wxLocale::AddCatalogLookupPathPrefix(const wxString
& prefix
)
1903 if ( gs_searchPrefixes
.Index(prefix
) == wxNOT_FOUND
)
1905 gs_searchPrefixes
.Add(prefix
);
1907 //else: already have it
1910 /*static*/ int wxLocale::GetSystemLanguage()
1912 CreateLanguagesDB();
1914 // init i to avoid compiler warning
1916 count
= ms_languagesDB
->GetCount();
1918 #if defined(__UNIX__)
1919 // first get the string identifying the language from the environment
1922 wxCFRef
<CFLocaleRef
> userLocaleRef(CFLocaleCopyCurrent());
1924 // because the locale identifier (kCFLocaleIdentifier) is formatted a little bit differently, eg
1925 // az_Cyrl_AZ@calendar=buddhist;currency=JPY we just recreate the base info as expected by wx here
1927 wxCFStringRef
str(wxCFRetain((CFStringRef
)CFLocaleGetValue(userLocaleRef
, kCFLocaleLanguageCode
)));
1928 langFull
= str
.AsString()+"_";
1929 str
.reset(wxCFRetain((CFStringRef
)CFLocaleGetValue(userLocaleRef
, kCFLocaleCountryCode
)));
1930 langFull
+= str
.AsString();
1932 if (!wxGetEnv(wxS("LC_ALL"), &langFull
) &&
1933 !wxGetEnv(wxS("LC_MESSAGES"), &langFull
) &&
1934 !wxGetEnv(wxS("LANG"), &langFull
))
1936 // no language specified, treat it as English
1937 return wxLANGUAGE_ENGLISH_US
;
1940 if ( langFull
== wxS("C") || langFull
== wxS("POSIX") )
1942 // default C locale is English too
1943 return wxLANGUAGE_ENGLISH_US
;
1947 // the language string has the following form
1949 // lang[_LANG][.encoding][@modifier]
1951 // (see environ(5) in the Open Unix specification)
1953 // where lang is the primary language, LANG is a sublang/territory,
1954 // encoding is the charset to use and modifier "allows the user to select
1955 // a specific instance of localization data within a single category"
1957 // for example, the following strings are valid:
1962 // de_DE.iso88591@euro
1964 // for now we don't use the encoding, although we probably should (doing
1965 // translations of the msg catalogs on the fly as required) (TODO)
1967 // we need the modified for languages like Valencian: ca_ES@valencia
1968 // though, remember it
1970 size_t posModifier
= langFull
.find_first_of(wxS("@"));
1971 if ( posModifier
!= wxString::npos
)
1972 modifier
= langFull
.Mid(posModifier
);
1974 size_t posEndLang
= langFull
.find_first_of(wxS("@."));
1975 if ( posEndLang
!= wxString::npos
)
1977 langFull
.Truncate(posEndLang
);
1980 // in addition to the format above, we also can have full language names
1981 // in LANG env var - for example, SuSE is known to use LANG="german" - so
1984 // do we have just the language (or sublang too)?
1985 bool justLang
= langFull
.length() == LEN_LANG
;
1987 (langFull
.length() == LEN_FULL
&& langFull
[LEN_LANG
] == wxS('_')) )
1989 // 0. Make sure the lang is according to latest ISO 639
1990 // (this is necessary because glibc uses iw and in instead
1991 // of he and id respectively).
1993 // the language itself (second part is the dialect/sublang)
1994 wxString langOrig
= ExtractLang(langFull
);
1997 if ( langOrig
== wxS("iw"))
1999 else if (langOrig
== wxS("in"))
2001 else if (langOrig
== wxS("ji"))
2003 else if (langOrig
== wxS("no_NO"))
2004 lang
= wxS("nb_NO");
2005 else if (langOrig
== wxS("no_NY"))
2006 lang
= wxS("nn_NO");
2007 else if (langOrig
== wxS("no"))
2008 lang
= wxS("nb_NO");
2012 // did we change it?
2013 if ( lang
!= langOrig
)
2015 langFull
= lang
+ ExtractNotLang(langFull
);
2018 // 1. Try to find the language either as is:
2019 // a) With modifier if set
2020 if ( !modifier
.empty() )
2022 wxString langFullWithModifier
= langFull
+ modifier
;
2023 for ( i
= 0; i
< count
; i
++ )
2025 if ( ms_languagesDB
->Item(i
).CanonicalName
== langFullWithModifier
)
2030 // b) Without modifier
2031 if ( modifier
.empty() || i
== count
)
2033 for ( i
= 0; i
< count
; i
++ )
2035 if ( ms_languagesDB
->Item(i
).CanonicalName
== langFull
)
2040 // 2. If langFull is of the form xx_YY, try to find xx:
2041 if ( i
== count
&& !justLang
)
2043 for ( i
= 0; i
< count
; i
++ )
2045 if ( ms_languagesDB
->Item(i
).CanonicalName
== lang
)
2052 // 3. If langFull is of the form xx, try to find any xx_YY record:
2053 if ( i
== count
&& justLang
)
2055 for ( i
= 0; i
< count
; i
++ )
2057 if ( ExtractLang(ms_languagesDB
->Item(i
).CanonicalName
)
2065 else // not standard format
2067 // try to find the name in verbose description
2068 for ( i
= 0; i
< count
; i
++ )
2070 if (ms_languagesDB
->Item(i
).Description
.CmpNoCase(langFull
) == 0)
2076 #elif defined(__WIN32__)
2077 LCID lcid
= GetUserDefaultLCID();
2080 wxUint32 lang
= PRIMARYLANGID(LANGIDFROMLCID(lcid
));
2081 wxUint32 sublang
= SUBLANGID(LANGIDFROMLCID(lcid
));
2083 for ( i
= 0; i
< count
; i
++ )
2085 if (ms_languagesDB
->Item(i
).WinLang
== lang
&&
2086 ms_languagesDB
->Item(i
).WinSublang
== sublang
)
2092 //else: leave wxlang == wxLANGUAGE_UNKNOWN
2093 #endif // Unix/Win32
2097 // we did find a matching entry, use it
2098 return ms_languagesDB
->Item(i
).Language
;
2101 // no info about this language in the database
2102 return wxLANGUAGE_UNKNOWN
;
2105 // ----------------------------------------------------------------------------
2107 // ----------------------------------------------------------------------------
2109 // this is a bit strange as under Windows we get the encoding name using its
2110 // numeric value and under Unix we do it the other way round, but this just
2111 // reflects the way different systems provide the encoding info
2114 wxString
wxLocale::GetSystemEncodingName()
2118 #if defined(__WIN32__) && !defined(__WXMICROWIN__)
2119 // FIXME: what is the error return value for GetACP()?
2120 UINT codepage
= ::GetACP();
2121 encname
.Printf(wxS("windows-%u"), codepage
);
2122 #elif defined(__WXMAC__)
2123 // default is just empty string, this resolves to the default system
2125 #elif defined(__UNIX_LIKE__)
2127 #if defined(HAVE_LANGINFO_H) && defined(CODESET)
2128 // GNU libc provides current character set this way (this conforms
2130 char *oldLocale
= strdup(setlocale(LC_CTYPE
, NULL
));
2131 setlocale(LC_CTYPE
, "");
2132 const char *alang
= nl_langinfo(CODESET
);
2133 setlocale(LC_CTYPE
, oldLocale
);
2138 encname
= wxString::FromAscii( alang
);
2140 else // nl_langinfo() failed
2141 #endif // HAVE_LANGINFO_H
2143 // if we can't get at the character set directly, try to see if it's in
2144 // the environment variables (in most cases this won't work, but I was
2146 char *lang
= getenv( "LC_ALL");
2147 char *dot
= lang
? strchr(lang
, '.') : NULL
;
2150 lang
= getenv( "LC_CTYPE" );
2152 dot
= strchr(lang
, '.' );
2156 lang
= getenv( "LANG");
2158 dot
= strchr(lang
, '.');
2163 encname
= wxString::FromAscii( dot
+1 );
2166 #endif // Win32/Unix
2172 wxFontEncoding
wxLocale::GetSystemEncoding()
2174 #if defined(__WIN32__) && !defined(__WXMICROWIN__)
2175 UINT codepage
= ::GetACP();
2177 // wxWidgets only knows about CP1250-1257, 874, 932, 936, 949, 950
2178 if ( codepage
>= 1250 && codepage
<= 1257 )
2180 return (wxFontEncoding
)(wxFONTENCODING_CP1250
+ codepage
- 1250);
2183 if ( codepage
== 874 )
2185 return wxFONTENCODING_CP874
;
2188 if ( codepage
== 932 )
2190 return wxFONTENCODING_CP932
;
2193 if ( codepage
== 936 )
2195 return wxFONTENCODING_CP936
;
2198 if ( codepage
== 949 )
2200 return wxFONTENCODING_CP949
;
2203 if ( codepage
== 950 )
2205 return wxFONTENCODING_CP950
;
2207 #elif defined(__WXMAC__)
2208 CFStringEncoding encoding
= 0 ;
2209 encoding
= CFStringGetSystemEncoding() ;
2210 return wxMacGetFontEncFromSystemEnc( encoding
) ;
2211 #elif defined(__UNIX_LIKE__) && wxUSE_FONTMAP
2212 const wxString encname
= GetSystemEncodingName();
2213 if ( !encname
.empty() )
2215 wxFontEncoding enc
= wxFontMapperBase::GetEncodingFromName(encname
);
2217 // on some modern Linux systems (RedHat 8) the default system locale
2218 // is UTF8 -- but it isn't supported by wxGTK1 in ANSI build at all so
2219 // don't even try to use it in this case
2220 #if !wxUSE_UNICODE && \
2221 ((defined(__WXGTK__) && !defined(__WXGTK20__)) || defined(__WXMOTIF__))
2222 if ( enc
== wxFONTENCODING_UTF8
)
2224 // the most similar supported encoding...
2225 enc
= wxFONTENCODING_ISO8859_1
;
2227 #endif // !wxUSE_UNICODE
2229 // GetEncodingFromName() returns wxFONTENCODING_DEFAULT for C locale
2230 // (a.k.a. US-ASCII) which is arguably a bug but keep it like this for
2231 // backwards compatibility and just take care to not return
2232 // wxFONTENCODING_DEFAULT from here as this surely doesn't make sense
2233 if ( enc
== wxFONTENCODING_DEFAULT
)
2235 // we don't have wxFONTENCODING_ASCII, so use the closest one
2236 return wxFONTENCODING_ISO8859_1
;
2239 if ( enc
!= wxFONTENCODING_MAX
)
2243 //else: return wxFONTENCODING_SYSTEM below
2245 #endif // Win32/Unix
2247 return wxFONTENCODING_SYSTEM
;
2251 void wxLocale::AddLanguage(const wxLanguageInfo
& info
)
2253 CreateLanguagesDB();
2254 ms_languagesDB
->Add(info
);
2258 const wxLanguageInfo
*wxLocale::GetLanguageInfo(int lang
)
2260 CreateLanguagesDB();
2262 // calling GetLanguageInfo(wxLANGUAGE_DEFAULT) is a natural thing to do, so
2264 if ( lang
== wxLANGUAGE_DEFAULT
)
2265 lang
= GetSystemLanguage();
2267 const size_t count
= ms_languagesDB
->GetCount();
2268 for ( size_t i
= 0; i
< count
; i
++ )
2270 if ( ms_languagesDB
->Item(i
).Language
== lang
)
2272 // We need to create a temporary here in order to make this work with BCC in final build mode
2273 wxLanguageInfo
*ptr
= &ms_languagesDB
->Item(i
);
2282 wxString
wxLocale::GetLanguageName(int lang
)
2284 const wxLanguageInfo
*info
= GetLanguageInfo(lang
);
2286 return wxEmptyString
;
2288 return info
->Description
;
2292 const wxLanguageInfo
*wxLocale::FindLanguageInfo(const wxString
& locale
)
2294 CreateLanguagesDB();
2296 const wxLanguageInfo
*infoRet
= NULL
;
2298 const size_t count
= ms_languagesDB
->GetCount();
2299 for ( size_t i
= 0; i
< count
; i
++ )
2301 const wxLanguageInfo
*info
= &ms_languagesDB
->Item(i
);
2303 if ( wxStricmp(locale
, info
->CanonicalName
) == 0 ||
2304 wxStricmp(locale
, info
->Description
) == 0 )
2306 // exact match, stop searching
2311 if ( wxStricmp(locale
, info
->CanonicalName
.BeforeFirst(wxS('_'))) == 0 )
2313 // a match -- but maybe we'll find an exact one later, so continue
2316 // OTOH, maybe we had already found a language match and in this
2317 // case don't overwrite it because the entry for the default
2318 // country always appears first in ms_languagesDB
2327 wxString
wxLocale::GetSysName() const
2329 return wxSetlocale(LC_ALL
, NULL
);
2333 wxLocale::~wxLocale()
2336 wxMsgCatalog
*pTmpCat
;
2337 while ( m_pMsgCat
!= NULL
) {
2338 pTmpCat
= m_pMsgCat
;
2339 m_pMsgCat
= m_pMsgCat
->m_pNext
;
2343 // restore old locale pointer
2344 wxSetLocale(m_pOldLocale
);
2346 wxSetlocale(LC_ALL
, m_pszOldLocale
);
2347 free((wxChar
*)m_pszOldLocale
); // const_cast
2350 // get the translation of given string in current locale
2351 const wxString
& wxLocale::GetString(const wxString
& origString
,
2352 const wxString
& domain
) const
2354 return GetString(origString
, origString
, size_t(-1), domain
);
2357 const wxString
& wxLocale::GetString(const wxString
& origString
,
2358 const wxString
& origString2
,
2360 const wxString
& domain
) const
2362 if ( origString
.empty() )
2363 return GetUntranslatedString(origString
);
2365 const wxString
*trans
= NULL
;
2366 wxMsgCatalog
*pMsgCat
;
2368 if ( !domain
.empty() )
2370 pMsgCat
= FindCatalog(domain
);
2372 // does the catalog exist?
2373 if ( pMsgCat
!= NULL
)
2374 trans
= pMsgCat
->GetString(origString
, n
);
2378 // search in all domains
2379 for ( pMsgCat
= m_pMsgCat
; pMsgCat
!= NULL
; pMsgCat
= pMsgCat
->m_pNext
)
2381 trans
= pMsgCat
->GetString(origString
, n
);
2382 if ( trans
!= NULL
) // take the first found
2387 if ( trans
== NULL
)
2389 wxLogTrace(TRACE_I18N
,
2390 wxS("string \"%s\"[%ld] not found in %slocale '%s'."),
2391 origString
, (long)n
,
2392 wxString::Format(wxS("domain '%s' "), domain
).c_str(),
2393 m_strLocale
.c_str());
2395 if (n
== size_t(-1))
2396 return GetUntranslatedString(origString
);
2398 return GetUntranslatedString(n
== 1 ? origString
: origString2
);
2404 WX_DECLARE_HASH_SET(wxString
, wxStringHash
, wxStringEqual
,
2405 wxLocaleUntranslatedStrings
);
2408 const wxString
& wxLocale::GetUntranslatedString(const wxString
& str
)
2410 static wxLocaleUntranslatedStrings s_strings
;
2412 wxLocaleUntranslatedStrings::iterator i
= s_strings
.find(str
);
2413 if ( i
== s_strings
.end() )
2414 return *s_strings
.insert(str
).first
;
2419 wxString
wxLocale::GetHeaderValue(const wxString
& header
,
2420 const wxString
& domain
) const
2422 if ( header
.empty() )
2423 return wxEmptyString
;
2425 const wxString
*trans
= NULL
;
2426 wxMsgCatalog
*pMsgCat
;
2428 if ( !domain
.empty() )
2430 pMsgCat
= FindCatalog(domain
);
2432 // does the catalog exist?
2433 if ( pMsgCat
== NULL
)
2434 return wxEmptyString
;
2436 trans
= pMsgCat
->GetString(wxEmptyString
, (size_t)-1);
2440 // search in all domains
2441 for ( pMsgCat
= m_pMsgCat
; pMsgCat
!= NULL
; pMsgCat
= pMsgCat
->m_pNext
)
2443 trans
= pMsgCat
->GetString(wxEmptyString
, (size_t)-1);
2444 if ( trans
!= NULL
) // take the first found
2449 if ( !trans
|| trans
->empty() )
2450 return wxEmptyString
;
2452 size_t found
= trans
->find(header
);
2453 if ( found
== wxString::npos
)
2454 return wxEmptyString
;
2456 found
+= header
.length() + 2 /* ': ' */;
2458 // Every header is separated by \n
2460 size_t endLine
= trans
->find(wxS('\n'), found
);
2461 size_t len
= (endLine
== wxString::npos
) ?
2462 wxString::npos
: (endLine
- found
);
2464 return trans
->substr(found
, len
);
2468 // find catalog by name in a linked list, return NULL if !found
2469 wxMsgCatalog
*wxLocale::FindCatalog(const wxString
& domain
) const
2471 // linear search in the linked list
2472 wxMsgCatalog
*pMsgCat
;
2473 for ( pMsgCat
= m_pMsgCat
; pMsgCat
!= NULL
; pMsgCat
= pMsgCat
->m_pNext
)
2475 if ( pMsgCat
->GetName() == domain
)
2482 // check if the given locale is provided by OS and C run time
2484 bool wxLocale::IsAvailable(int lang
)
2486 const wxLanguageInfo
*info
= wxLocale::GetLanguageInfo(lang
);
2487 wxCHECK_MSG( info
, false, wxS("invalid language") );
2489 #if defined(__WIN32__)
2490 if ( !info
->WinLang
)
2493 if ( !::IsValidLocale(info
->GetLCID(), LCID_INSTALLED
) )
2496 #elif defined(__UNIX__)
2498 // Test if setting the locale works, then set it back.
2499 const char *oldLocale
= wxSetlocaleTryUTF8(LC_ALL
, info
->CanonicalName
);
2502 // Some C libraries don't like xx_YY form and require xx only
2503 oldLocale
= wxSetlocaleTryUTF8(LC_ALL
, ExtractLang(info
->CanonicalName
));
2507 // restore the original locale
2508 wxSetlocale(LC_ALL
, oldLocale
);
2514 // check if the given catalog is loaded
2515 bool wxLocale::IsLoaded(const wxString
& szDomain
) const
2517 return FindCatalog(szDomain
) != NULL
;
2520 // add a catalog to our linked list
2521 bool wxLocale::AddCatalog(const wxString
& szDomain
)
2523 return AddCatalog(szDomain
, wxLANGUAGE_ENGLISH_US
, wxEmptyString
);
2526 // add a catalog to our linked list
2527 bool wxLocale::AddCatalog(const wxString
& szDomain
,
2528 wxLanguage msgIdLanguage
,
2529 const wxString
& msgIdCharset
)
2532 wxCHECK_MSG( !m_strShort
.empty(), false, "must initialize catalog first" );
2535 // It is OK to not load catalog if the msgid language and m_language match,
2536 // in which case we can directly display the texts embedded in program's
2538 if ( msgIdLanguage
== m_language
)
2542 wxMsgCatalog
*pMsgCat
= new wxMsgCatalog
;
2544 if ( pMsgCat
->Load(m_strShort
, szDomain
, msgIdCharset
, m_bConvertEncoding
) )
2546 // add it to the head of the list so that in GetString it will
2547 // be searched before the catalogs added earlier
2548 pMsgCat
->m_pNext
= m_pMsgCat
;
2549 m_pMsgCat
= pMsgCat
;
2554 // don't add it because it couldn't be loaded anyway
2558 // If there's no exact match, we may still get partial match where the
2559 // (basic) language is same, but the country differs. For example, it's
2560 // permitted to use en_US strings from sources even if m_language is en_GB:
2561 const wxLanguageInfo
*msgIdLangInfo
= GetLanguageInfo(msgIdLanguage
);
2562 if ( msgIdLangInfo
&&
2563 ExtractLang(msgIdLangInfo
->CanonicalName
) == ExtractLang(m_strShort
) )
2571 // ----------------------------------------------------------------------------
2572 // accessors for locale-dependent data
2573 // ----------------------------------------------------------------------------
2575 #if defined(__WXMSW__) || defined(__WXOSX__)
2580 // This function translates from Unicode date formats described at
2582 // http://unicode.org/reports/tr35/tr35-6.html#Date_Format_Patterns
2584 // to strftime()-like syntax. This translation is not lossless but we try to do
2587 static wxString
TranslateFromUnicodeFormat(const wxString
& fmt
)
2590 fmtWX
.reserve(fmt
.length());
2593 size_t lastCount
= 0;
2595 const char* formatchars
=
2603 for ( wxString::const_iterator p
= fmt
.begin(); /* end handled inside */; ++p
)
2605 if ( p
!= fmt
.end() )
2613 const wxUniChar ch
= (*p
).GetValue();
2614 if ( ch
.IsAscii() && strchr(formatchars
, ch
) )
2616 // these characters come in groups, start counting them
2623 // interpret any special characters we collected so far
2629 switch ( lastCount
)
2633 // these two are the same as we don't distinguish
2634 // between 1 and 2 digits for days
2647 wxFAIL_MSG( "too many 'd's" );
2652 switch ( lastCount
)
2661 wxFAIL_MSG( "wrong number of 'D's" );
2665 switch ( lastCount
)
2673 wxFAIL_MSG( "wrong number of 'w's" );
2677 switch ( lastCount
)
2692 wxFAIL_MSG( "wrong number of 'E's" );
2697 switch ( lastCount
)
2701 // as for 'd' and 'dd' above
2714 wxFAIL_MSG( "too many 'M's" );
2719 switch ( lastCount
)
2731 wxFAIL_MSG( "wrong number of 'y's" );
2736 switch ( lastCount
)
2744 wxFAIL_MSG( "wrong number of 'H's" );
2749 switch ( lastCount
)
2757 wxFAIL_MSG( "wrong number of 'h's" );
2762 switch ( lastCount
)
2770 wxFAIL_MSG( "wrong number of 'm's" );
2775 switch ( lastCount
)
2783 wxFAIL_MSG( "wrong number of 's's" );
2788 // strftime() doesn't have era string,
2789 // ignore this format
2790 wxASSERT_MSG( lastCount
<= 2, "too many 'g's" );
2800 switch ( lastCount
)
2808 wxFAIL_MSG( "too many 't's" );
2813 wxFAIL_MSG( "unreachable" );
2820 if ( p
== fmt
.end() )
2823 // not a special character so must be just a separator, treat as is
2824 if ( *p
== wxT('%') )
2826 // this one needs to be escaped
2836 } // anonymous namespace
2838 #endif // __WXMSW__ || __WXOSX__
2840 #if defined(__WXMSW__)
2845 LCTYPE
GetLCTYPEFormatFromLocalInfo(wxLocaleInfo index
)
2849 case wxLOCALE_SHORT_DATE_FMT
:
2850 return LOCALE_SSHORTDATE
;
2852 case wxLOCALE_LONG_DATE_FMT
:
2853 return LOCALE_SLONGDATE
;
2855 case wxLOCALE_TIME_FMT
:
2856 return LOCALE_STIMEFORMAT
;
2859 wxFAIL_MSG( "no matching LCTYPE" );
2865 } // anonymous namespace
2868 wxString
wxLocale::GetInfo(wxLocaleInfo index
, wxLocaleCategory
WXUNUSED(cat
))
2870 wxUint32 lcid
= LOCALE_USER_DEFAULT
;
2871 if ( wxGetLocale() )
2873 const wxLanguageInfo
* const
2874 info
= GetLanguageInfo(wxGetLocale()->GetLanguage());
2876 lcid
= info
->GetLCID();
2886 case wxLOCALE_DECIMAL_POINT
:
2887 if ( ::GetLocaleInfo(lcid
, LOCALE_SDECIMAL
, buf
, WXSIZEOF(buf
)) )
2891 case wxLOCALE_SHORT_DATE_FMT
:
2892 case wxLOCALE_LONG_DATE_FMT
:
2893 case wxLOCALE_TIME_FMT
:
2894 if ( ::GetLocaleInfo(lcid
, GetLCTYPEFormatFromLocalInfo(index
),
2895 buf
, WXSIZEOF(buf
)) )
2897 return TranslateFromUnicodeFormat(buf
);
2901 case wxLOCALE_DATE_TIME_FMT
:
2902 // there doesn't seem to be any specific setting for this, so just
2903 // combine date and time ones
2905 // we use the short date because this is what "%c" uses by default
2906 // ("%#c" uses long date but we have no way to specify the
2907 // alternate representation here)
2909 const wxString datefmt
= GetInfo(wxLOCALE_SHORT_DATE_FMT
);
2910 if ( datefmt
.empty() )
2913 const wxString timefmt
= GetInfo(wxLOCALE_TIME_FMT
);
2914 if ( timefmt
.empty() )
2917 str
<< datefmt
<< ' ' << timefmt
;
2922 wxFAIL_MSG( "unknown wxLocaleInfo" );
2928 #elif defined(__WXOSX__)
2931 wxString
wxLocale::GetInfo(wxLocaleInfo index
, wxLocaleCategory
WXUNUSED(cat
))
2933 CFLocaleRef userLocaleRefRaw
;
2934 if ( wxGetLocale() )
2936 userLocaleRefRaw
= CFLocaleCreate
2938 kCFAllocatorDefault
,
2939 wxCFStringRef(wxGetLocale()->GetCanonicalName())
2942 else // no current locale, use the default one
2944 userLocaleRefRaw
= CFLocaleCopyCurrent();
2947 wxCFRef
<CFLocaleRef
> userLocaleRef(userLocaleRefRaw
);
2949 CFStringRef cfstr
= 0;
2952 case wxLOCALE_THOUSANDS_SEP
:
2953 cfstr
= (CFStringRef
) CFLocaleGetValue(userLocaleRef
, kCFLocaleGroupingSeparator
);
2956 case wxLOCALE_DECIMAL_POINT
:
2957 cfstr
= (CFStringRef
) CFLocaleGetValue(userLocaleRef
, kCFLocaleDecimalSeparator
);
2960 case wxLOCALE_SHORT_DATE_FMT
:
2961 case wxLOCALE_LONG_DATE_FMT
:
2962 case wxLOCALE_DATE_TIME_FMT
:
2963 case wxLOCALE_TIME_FMT
:
2965 CFDateFormatterStyle dateStyle
= kCFDateFormatterNoStyle
;
2966 CFDateFormatterStyle timeStyle
= kCFDateFormatterNoStyle
;
2969 case wxLOCALE_SHORT_DATE_FMT
:
2970 dateStyle
= kCFDateFormatterShortStyle
;
2972 case wxLOCALE_LONG_DATE_FMT
:
2973 dateStyle
= kCFDateFormatterFullStyle
;
2975 case wxLOCALE_DATE_TIME_FMT
:
2976 dateStyle
= kCFDateFormatterFullStyle
;
2977 timeStyle
= kCFDateFormatterMediumStyle
;
2979 case wxLOCALE_TIME_FMT
:
2980 timeStyle
= kCFDateFormatterMediumStyle
;
2983 wxFAIL_MSG( "unexpected time locale" );
2986 wxCFRef
<CFDateFormatterRef
> dateFormatter( CFDateFormatterCreate
2987 (NULL
, userLocaleRef
, dateStyle
, timeStyle
));
2988 wxCFStringRef cfs
= wxCFRetain( CFDateFormatterGetFormat(dateFormatter
));
2989 wxString format
= TranslateFromUnicodeFormat(cfs
.AsString());
2990 // we always want full years
2991 format
.Replace("%y","%Y");
2997 wxFAIL_MSG( "Unknown locale info" );
3001 wxCFStringRef
str(wxCFRetain(cfstr
));
3002 return str
.AsString();
3005 #else // !__WXMSW__ && !__WXOSX__, assume generic POSIX
3010 wxString
GetDateFormatFromLangInfo(wxLocaleInfo index
)
3012 #ifdef HAVE_LANGINFO_H
3013 // array containing parameters for nl_langinfo() indexes by offset of index
3014 // from wxLOCALE_SHORT_DATE_FMT
3015 static const nl_item items
[] =
3017 D_FMT
, D_T_FMT
, D_T_FMT
, T_FMT
,
3020 const int nlidx
= index
- wxLOCALE_SHORT_DATE_FMT
;
3021 if ( nlidx
< 0 || nlidx
>= (int)WXSIZEOF(items
) )
3023 wxFAIL_MSG( "logic error in GetInfo() code" );
3027 const wxString
fmt(nl_langinfo(items
[nlidx
]));
3029 // just return the format returned by nl_langinfo() except for long date
3030 // format which we need to recover from date/time format ourselves (but not
3031 // if we failed completely)
3032 if ( fmt
.empty() || index
!= wxLOCALE_LONG_DATE_FMT
)
3035 // this is not 100% precise but the idea is that a typical date/time format
3036 // under POSIX systems is a combination of a long date format with time one
3037 // so we should be able to get just the long date format by removing all
3038 // time-specific format specifiers
3039 static const char *timeFmtSpecs
= "HIklMpPrRsSTXzZ";
3040 static const char *timeSep
= " :./-";
3042 wxString fmtDateOnly
;
3043 const wxString::const_iterator end
= fmt
.end();
3044 wxString::const_iterator lastSep
= end
;
3045 for ( wxString::const_iterator p
= fmt
.begin(); p
!= end
; ++p
)
3047 if ( strchr(timeSep
, *p
) )
3049 if ( lastSep
== end
)
3052 // skip it for now, we'll discard it if it's followed by a time
3053 // specifier later or add it to fmtDateOnly if it is not
3058 (p
+ 1 != end
) && strchr(timeFmtSpecs
, p
[1]) )
3060 // time specified found: skip it and any preceding separators
3066 if ( lastSep
!= end
)
3068 fmtDateOnly
+= wxString(lastSep
, p
);
3076 #else // !HAVE_LANGINFO_H
3079 // no fallback, let the application deal with unavailability of
3080 // nl_langinfo() itself as there is no good way for us to do it (well, we
3081 // could try to reverse engineer the format from strftime() output but this
3082 // looks like too much trouble considering the relatively small number of
3083 // systems without nl_langinfo() still in use)
3085 #endif // HAVE_LANGINFO_H/!HAVE_LANGINFO_H
3088 } // anonymous namespace
3091 wxString
wxLocale::GetInfo(wxLocaleInfo index
, wxLocaleCategory cat
)
3093 lconv
* const lc
= localeconv();
3099 case wxLOCALE_THOUSANDS_SEP
:
3100 if ( cat
== wxLOCALE_CAT_NUMBER
)
3101 return lc
->thousands_sep
;
3102 else if ( cat
== wxLOCALE_CAT_MONEY
)
3103 return lc
->mon_thousands_sep
;
3105 wxFAIL_MSG( "invalid wxLocaleCategory" );
3109 case wxLOCALE_DECIMAL_POINT
:
3110 if ( cat
== wxLOCALE_CAT_NUMBER
)
3111 return lc
->decimal_point
;
3112 else if ( cat
== wxLOCALE_CAT_MONEY
)
3113 return lc
->mon_decimal_point
;
3115 wxFAIL_MSG( "invalid wxLocaleCategory" );
3118 case wxLOCALE_SHORT_DATE_FMT
:
3119 case wxLOCALE_LONG_DATE_FMT
:
3120 case wxLOCALE_DATE_TIME_FMT
:
3121 case wxLOCALE_TIME_FMT
:
3122 if ( cat
!= wxLOCALE_CAT_DATE
&& cat
!= wxLOCALE_CAT_DEFAULT
)
3124 wxFAIL_MSG( "invalid wxLocaleCategory" );
3128 return GetDateFormatFromLangInfo(index
);
3132 wxFAIL_MSG( "unknown wxLocaleInfo value" );
3140 // ----------------------------------------------------------------------------
3141 // global functions and variables
3142 // ----------------------------------------------------------------------------
3144 // retrieve/change current locale
3145 // ------------------------------
3147 // the current locale object
3148 static wxLocale
*g_pLocale
= NULL
;
3150 wxLocale
*wxGetLocale()
3155 wxLocale
*wxSetLocale(wxLocale
*pLocale
)
3157 wxLocale
*pOld
= g_pLocale
;
3158 g_pLocale
= pLocale
;
3164 // ----------------------------------------------------------------------------
3165 // wxLocale module (for lazy destruction of languagesDB)
3166 // ----------------------------------------------------------------------------
3168 class wxLocaleModule
: public wxModule
3170 DECLARE_DYNAMIC_CLASS(wxLocaleModule
)
3173 bool OnInit() { return true; }
3174 void OnExit() { wxLocale::DestroyLanguagesDB(); }
3177 IMPLEMENT_DYNAMIC_CLASS(wxLocaleModule
, wxModule
)
3181 // ----------------------------------------------------------------------------
3182 // default languages table & initialization
3183 // ----------------------------------------------------------------------------
3186 // --- --- --- generated code begins here --- --- ---
3188 // This table is generated by misc/languages/genlang.py
3189 // When making changes, please put them into misc/languages/langtabl.txt
3191 #if !defined(__WIN32__) || defined(__WXMICROWIN__)
3193 #define SETWINLANG(info,lang,sublang)
3197 #define SETWINLANG(info,lang,sublang) \
3198 info.WinLang = lang, info.WinSublang = sublang;
3200 #ifndef LANG_AFRIKAANS
3201 #define LANG_AFRIKAANS (0)
3203 #ifndef LANG_ALBANIAN
3204 #define LANG_ALBANIAN (0)
3207 #define LANG_ARABIC (0)
3209 #ifndef LANG_ARMENIAN
3210 #define LANG_ARMENIAN (0)
3212 #ifndef LANG_ASSAMESE
3213 #define LANG_ASSAMESE (0)
3216 #define LANG_AZERI (0)
3219 #define LANG_BASQUE (0)
3221 #ifndef LANG_BELARUSIAN
3222 #define LANG_BELARUSIAN (0)
3224 #ifndef LANG_BENGALI
3225 #define LANG_BENGALI (0)
3227 #ifndef LANG_BULGARIAN
3228 #define LANG_BULGARIAN (0)
3230 #ifndef LANG_CATALAN
3231 #define LANG_CATALAN (0)
3233 #ifndef LANG_CHINESE
3234 #define LANG_CHINESE (0)
3236 #ifndef LANG_CROATIAN
3237 #define LANG_CROATIAN (0)
3240 #define LANG_CZECH (0)
3243 #define LANG_DANISH (0)
3246 #define LANG_DUTCH (0)
3248 #ifndef LANG_ENGLISH
3249 #define LANG_ENGLISH (0)
3251 #ifndef LANG_ESTONIAN
3252 #define LANG_ESTONIAN (0)
3254 #ifndef LANG_FAEROESE
3255 #define LANG_FAEROESE (0)
3258 #define LANG_FARSI (0)
3260 #ifndef LANG_FINNISH
3261 #define LANG_FINNISH (0)
3264 #define LANG_FRENCH (0)
3266 #ifndef LANG_GEORGIAN
3267 #define LANG_GEORGIAN (0)
3270 #define LANG_GERMAN (0)
3273 #define LANG_GREEK (0)
3275 #ifndef LANG_GUJARATI
3276 #define LANG_GUJARATI (0)
3279 #define LANG_HEBREW (0)
3282 #define LANG_HINDI (0)
3284 #ifndef LANG_HUNGARIAN
3285 #define LANG_HUNGARIAN (0)
3287 #ifndef LANG_ICELANDIC
3288 #define LANG_ICELANDIC (0)
3290 #ifndef LANG_INDONESIAN
3291 #define LANG_INDONESIAN (0)
3293 #ifndef LANG_ITALIAN
3294 #define LANG_ITALIAN (0)
3296 #ifndef LANG_JAPANESE
3297 #define LANG_JAPANESE (0)
3299 #ifndef LANG_KANNADA
3300 #define LANG_KANNADA (0)
3302 #ifndef LANG_KASHMIRI
3303 #define LANG_KASHMIRI (0)
3306 #define LANG_KAZAK (0)
3308 #ifndef LANG_KONKANI
3309 #define LANG_KONKANI (0)
3312 #define LANG_KOREAN (0)
3314 #ifndef LANG_LATVIAN
3315 #define LANG_LATVIAN (0)
3317 #ifndef LANG_LITHUANIAN
3318 #define LANG_LITHUANIAN (0)
3320 #ifndef LANG_MACEDONIAN
3321 #define LANG_MACEDONIAN (0)
3324 #define LANG_MALAY (0)
3326 #ifndef LANG_MALAYALAM
3327 #define LANG_MALAYALAM (0)
3329 #ifndef LANG_MANIPURI
3330 #define LANG_MANIPURI (0)
3332 #ifndef LANG_MARATHI
3333 #define LANG_MARATHI (0)
3336 #define LANG_NEPALI (0)
3338 #ifndef LANG_NORWEGIAN
3339 #define LANG_NORWEGIAN (0)
3342 #define LANG_ORIYA (0)
3345 #define LANG_POLISH (0)
3347 #ifndef LANG_PORTUGUESE
3348 #define LANG_PORTUGUESE (0)
3350 #ifndef LANG_PUNJABI
3351 #define LANG_PUNJABI (0)
3353 #ifndef LANG_ROMANIAN
3354 #define LANG_ROMANIAN (0)
3356 #ifndef LANG_RUSSIAN
3357 #define LANG_RUSSIAN (0)
3360 #define LANG_SAMI (0)
3362 #ifndef LANG_SANSKRIT
3363 #define LANG_SANSKRIT (0)
3365 #ifndef LANG_SERBIAN
3366 #define LANG_SERBIAN (0)
3369 #define LANG_SINDHI (0)
3372 #define LANG_SLOVAK (0)
3374 #ifndef LANG_SLOVENIAN
3375 #define LANG_SLOVENIAN (0)
3377 #ifndef LANG_SPANISH
3378 #define LANG_SPANISH (0)
3380 #ifndef LANG_SWAHILI
3381 #define LANG_SWAHILI (0)
3383 #ifndef LANG_SWEDISH
3384 #define LANG_SWEDISH (0)
3387 #define LANG_TAMIL (0)
3390 #define LANG_TATAR (0)
3393 #define LANG_TELUGU (0)
3396 #define LANG_THAI (0)
3398 #ifndef LANG_TURKISH
3399 #define LANG_TURKISH (0)
3401 #ifndef LANG_UKRAINIAN
3402 #define LANG_UKRAINIAN (0)
3405 #define LANG_URDU (0)
3408 #define LANG_UZBEK (0)
3410 #ifndef LANG_VIETNAMESE
3411 #define LANG_VIETNAMESE (0)
3413 #ifndef SUBLANG_ARABIC_ALGERIA
3414 #define SUBLANG_ARABIC_ALGERIA SUBLANG_DEFAULT
3416 #ifndef SUBLANG_ARABIC_BAHRAIN
3417 #define SUBLANG_ARABIC_BAHRAIN SUBLANG_DEFAULT
3419 #ifndef SUBLANG_ARABIC_EGYPT
3420 #define SUBLANG_ARABIC_EGYPT SUBLANG_DEFAULT
3422 #ifndef SUBLANG_ARABIC_IRAQ
3423 #define SUBLANG_ARABIC_IRAQ SUBLANG_DEFAULT
3425 #ifndef SUBLANG_ARABIC_JORDAN
3426 #define SUBLANG_ARABIC_JORDAN SUBLANG_DEFAULT
3428 #ifndef SUBLANG_ARABIC_KUWAIT
3429 #define SUBLANG_ARABIC_KUWAIT SUBLANG_DEFAULT
3431 #ifndef SUBLANG_ARABIC_LEBANON
3432 #define SUBLANG_ARABIC_LEBANON SUBLANG_DEFAULT
3434 #ifndef SUBLANG_ARABIC_LIBYA
3435 #define SUBLANG_ARABIC_LIBYA SUBLANG_DEFAULT
3437 #ifndef SUBLANG_ARABIC_MOROCCO
3438 #define SUBLANG_ARABIC_MOROCCO SUBLANG_DEFAULT
3440 #ifndef SUBLANG_ARABIC_OMAN
3441 #define SUBLANG_ARABIC_OMAN SUBLANG_DEFAULT
3443 #ifndef SUBLANG_ARABIC_QATAR
3444 #define SUBLANG_ARABIC_QATAR SUBLANG_DEFAULT
3446 #ifndef SUBLANG_ARABIC_SAUDI_ARABIA
3447 #define SUBLANG_ARABIC_SAUDI_ARABIA SUBLANG_DEFAULT
3449 #ifndef SUBLANG_ARABIC_SYRIA
3450 #define SUBLANG_ARABIC_SYRIA SUBLANG_DEFAULT
3452 #ifndef SUBLANG_ARABIC_TUNISIA
3453 #define SUBLANG_ARABIC_TUNISIA SUBLANG_DEFAULT
3455 #ifndef SUBLANG_ARABIC_UAE
3456 #define SUBLANG_ARABIC_UAE SUBLANG_DEFAULT
3458 #ifndef SUBLANG_ARABIC_YEMEN
3459 #define SUBLANG_ARABIC_YEMEN SUBLANG_DEFAULT
3461 #ifndef SUBLANG_AZERI_CYRILLIC
3462 #define SUBLANG_AZERI_CYRILLIC SUBLANG_DEFAULT
3464 #ifndef SUBLANG_AZERI_LATIN
3465 #define SUBLANG_AZERI_LATIN SUBLANG_DEFAULT
3467 #ifndef SUBLANG_CHINESE_SIMPLIFIED
3468 #define SUBLANG_CHINESE_SIMPLIFIED SUBLANG_DEFAULT
3470 #ifndef SUBLANG_CHINESE_TRADITIONAL
3471 #define SUBLANG_CHINESE_TRADITIONAL SUBLANG_DEFAULT
3473 #ifndef SUBLANG_CHINESE_HONGKONG
3474 #define SUBLANG_CHINESE_HONGKONG SUBLANG_DEFAULT
3476 #ifndef SUBLANG_CHINESE_MACAU
3477 #define SUBLANG_CHINESE_MACAU SUBLANG_DEFAULT
3479 #ifndef SUBLANG_CHINESE_SINGAPORE
3480 #define SUBLANG_CHINESE_SINGAPORE SUBLANG_DEFAULT
3482 #ifndef SUBLANG_DUTCH
3483 #define SUBLANG_DUTCH SUBLANG_DEFAULT
3485 #ifndef SUBLANG_DUTCH_BELGIAN
3486 #define SUBLANG_DUTCH_BELGIAN SUBLANG_DEFAULT
3488 #ifndef SUBLANG_ENGLISH_UK
3489 #define SUBLANG_ENGLISH_UK SUBLANG_DEFAULT
3491 #ifndef SUBLANG_ENGLISH_US
3492 #define SUBLANG_ENGLISH_US SUBLANG_DEFAULT
3494 #ifndef SUBLANG_ENGLISH_AUS
3495 #define SUBLANG_ENGLISH_AUS SUBLANG_DEFAULT
3497 #ifndef SUBLANG_ENGLISH_BELIZE
3498 #define SUBLANG_ENGLISH_BELIZE SUBLANG_DEFAULT
3500 #ifndef SUBLANG_ENGLISH_CAN
3501 #define SUBLANG_ENGLISH_CAN SUBLANG_DEFAULT
3503 #ifndef SUBLANG_ENGLISH_CARIBBEAN
3504 #define SUBLANG_ENGLISH_CARIBBEAN SUBLANG_DEFAULT
3506 #ifndef SUBLANG_ENGLISH_EIRE
3507 #define SUBLANG_ENGLISH_EIRE SUBLANG_DEFAULT
3509 #ifndef SUBLANG_ENGLISH_JAMAICA
3510 #define SUBLANG_ENGLISH_JAMAICA SUBLANG_DEFAULT
3512 #ifndef SUBLANG_ENGLISH_NZ
3513 #define SUBLANG_ENGLISH_NZ SUBLANG_DEFAULT
3515 #ifndef SUBLANG_ENGLISH_PHILIPPINES
3516 #define SUBLANG_ENGLISH_PHILIPPINES SUBLANG_DEFAULT
3518 #ifndef SUBLANG_ENGLISH_SOUTH_AFRICA
3519 #define SUBLANG_ENGLISH_SOUTH_AFRICA SUBLANG_DEFAULT
3521 #ifndef SUBLANG_ENGLISH_TRINIDAD
3522 #define SUBLANG_ENGLISH_TRINIDAD SUBLANG_DEFAULT
3524 #ifndef SUBLANG_ENGLISH_ZIMBABWE
3525 #define SUBLANG_ENGLISH_ZIMBABWE SUBLANG_DEFAULT
3527 #ifndef SUBLANG_FRENCH
3528 #define SUBLANG_FRENCH SUBLANG_DEFAULT
3530 #ifndef SUBLANG_FRENCH_BELGIAN
3531 #define SUBLANG_FRENCH_BELGIAN SUBLANG_DEFAULT
3533 #ifndef SUBLANG_FRENCH_CANADIAN
3534 #define SUBLANG_FRENCH_CANADIAN SUBLANG_DEFAULT
3536 #ifndef SUBLANG_FRENCH_LUXEMBOURG
3537 #define SUBLANG_FRENCH_LUXEMBOURG SUBLANG_DEFAULT
3539 #ifndef SUBLANG_FRENCH_MONACO
3540 #define SUBLANG_FRENCH_MONACO SUBLANG_DEFAULT
3542 #ifndef SUBLANG_FRENCH_SWISS
3543 #define SUBLANG_FRENCH_SWISS SUBLANG_DEFAULT
3545 #ifndef SUBLANG_GERMAN
3546 #define SUBLANG_GERMAN SUBLANG_DEFAULT
3548 #ifndef SUBLANG_GERMAN_AUSTRIAN
3549 #define SUBLANG_GERMAN_AUSTRIAN SUBLANG_DEFAULT
3551 #ifndef SUBLANG_GERMAN_LIECHTENSTEIN
3552 #define SUBLANG_GERMAN_LIECHTENSTEIN SUBLANG_DEFAULT
3554 #ifndef SUBLANG_GERMAN_LUXEMBOURG
3555 #define SUBLANG_GERMAN_LUXEMBOURG SUBLANG_DEFAULT
3557 #ifndef SUBLANG_GERMAN_SWISS
3558 #define SUBLANG_GERMAN_SWISS SUBLANG_DEFAULT
3560 #ifndef SUBLANG_ITALIAN
3561 #define SUBLANG_ITALIAN SUBLANG_DEFAULT
3563 #ifndef SUBLANG_ITALIAN_SWISS
3564 #define SUBLANG_ITALIAN_SWISS SUBLANG_DEFAULT
3566 #ifndef SUBLANG_KASHMIRI_INDIA
3567 #define SUBLANG_KASHMIRI_INDIA SUBLANG_DEFAULT
3569 #ifndef SUBLANG_KOREAN
3570 #define SUBLANG_KOREAN SUBLANG_DEFAULT
3572 #ifndef SUBLANG_LITHUANIAN
3573 #define SUBLANG_LITHUANIAN SUBLANG_DEFAULT
3575 #ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM
3576 #define SUBLANG_MALAY_BRUNEI_DARUSSALAM SUBLANG_DEFAULT
3578 #ifndef SUBLANG_MALAY_MALAYSIA
3579 #define SUBLANG_MALAY_MALAYSIA SUBLANG_DEFAULT
3581 #ifndef SUBLANG_NEPALI_INDIA
3582 #define SUBLANG_NEPALI_INDIA SUBLANG_DEFAULT
3584 #ifndef SUBLANG_NORWEGIAN_BOKMAL
3585 #define SUBLANG_NORWEGIAN_BOKMAL SUBLANG_DEFAULT
3587 #ifndef SUBLANG_NORWEGIAN_NYNORSK
3588 #define SUBLANG_NORWEGIAN_NYNORSK SUBLANG_DEFAULT
3590 #ifndef SUBLANG_PORTUGUESE
3591 #define SUBLANG_PORTUGUESE SUBLANG_DEFAULT
3593 #ifndef SUBLANG_PORTUGUESE_BRAZILIAN
3594 #define SUBLANG_PORTUGUESE_BRAZILIAN SUBLANG_DEFAULT
3596 #ifndef SUBLANG_SERBIAN_CYRILLIC
3597 #define SUBLANG_SERBIAN_CYRILLIC SUBLANG_DEFAULT
3599 #ifndef SUBLANG_SERBIAN_LATIN
3600 #define SUBLANG_SERBIAN_LATIN SUBLANG_DEFAULT
3602 #ifndef SUBLANG_SPANISH
3603 #define SUBLANG_SPANISH SUBLANG_DEFAULT
3605 #ifndef SUBLANG_SPANISH_ARGENTINA
3606 #define SUBLANG_SPANISH_ARGENTINA SUBLANG_DEFAULT
3608 #ifndef SUBLANG_SPANISH_BOLIVIA
3609 #define SUBLANG_SPANISH_BOLIVIA SUBLANG_DEFAULT
3611 #ifndef SUBLANG_SPANISH_CHILE
3612 #define SUBLANG_SPANISH_CHILE SUBLANG_DEFAULT
3614 #ifndef SUBLANG_SPANISH_COLOMBIA
3615 #define SUBLANG_SPANISH_COLOMBIA SUBLANG_DEFAULT
3617 #ifndef SUBLANG_SPANISH_COSTA_RICA
3618 #define SUBLANG_SPANISH_COSTA_RICA SUBLANG_DEFAULT
3620 #ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC
3621 #define SUBLANG_SPANISH_DOMINICAN_REPUBLIC SUBLANG_DEFAULT
3623 #ifndef SUBLANG_SPANISH_ECUADOR
3624 #define SUBLANG_SPANISH_ECUADOR SUBLANG_DEFAULT
3626 #ifndef SUBLANG_SPANISH_EL_SALVADOR
3627 #define SUBLANG_SPANISH_EL_SALVADOR SUBLANG_DEFAULT
3629 #ifndef SUBLANG_SPANISH_GUATEMALA
3630 #define SUBLANG_SPANISH_GUATEMALA SUBLANG_DEFAULT
3632 #ifndef SUBLANG_SPANISH_HONDURAS
3633 #define SUBLANG_SPANISH_HONDURAS SUBLANG_DEFAULT
3635 #ifndef SUBLANG_SPANISH_MEXICAN
3636 #define SUBLANG_SPANISH_MEXICAN SUBLANG_DEFAULT
3638 #ifndef SUBLANG_SPANISH_MODERN
3639 #define SUBLANG_SPANISH_MODERN SUBLANG_DEFAULT
3641 #ifndef SUBLANG_SPANISH_NICARAGUA
3642 #define SUBLANG_SPANISH_NICARAGUA SUBLANG_DEFAULT
3644 #ifndef SUBLANG_SPANISH_PANAMA
3645 #define SUBLANG_SPANISH_PANAMA SUBLANG_DEFAULT
3647 #ifndef SUBLANG_SPANISH_PARAGUAY
3648 #define SUBLANG_SPANISH_PARAGUAY SUBLANG_DEFAULT
3650 #ifndef SUBLANG_SPANISH_PERU
3651 #define SUBLANG_SPANISH_PERU SUBLANG_DEFAULT
3653 #ifndef SUBLANG_SPANISH_PUERTO_RICO
3654 #define SUBLANG_SPANISH_PUERTO_RICO SUBLANG_DEFAULT
3656 #ifndef SUBLANG_SPANISH_URUGUAY
3657 #define SUBLANG_SPANISH_URUGUAY SUBLANG_DEFAULT
3659 #ifndef SUBLANG_SPANISH_VENEZUELA
3660 #define SUBLANG_SPANISH_VENEZUELA SUBLANG_DEFAULT
3662 #ifndef SUBLANG_SWEDISH
3663 #define SUBLANG_SWEDISH SUBLANG_DEFAULT
3665 #ifndef SUBLANG_SWEDISH_FINLAND
3666 #define SUBLANG_SWEDISH_FINLAND SUBLANG_DEFAULT
3668 #ifndef SUBLANG_URDU_INDIA
3669 #define SUBLANG_URDU_INDIA SUBLANG_DEFAULT
3671 #ifndef SUBLANG_URDU_PAKISTAN
3672 #define SUBLANG_URDU_PAKISTAN SUBLANG_DEFAULT
3674 #ifndef SUBLANG_UZBEK_CYRILLIC
3675 #define SUBLANG_UZBEK_CYRILLIC SUBLANG_DEFAULT
3677 #ifndef SUBLANG_UZBEK_LATIN
3678 #define SUBLANG_UZBEK_LATIN SUBLANG_DEFAULT
3684 #define LNG(wxlang, canonical, winlang, winsublang, layout, desc) \
3685 info.Language = wxlang; \
3686 info.CanonicalName = wxT(canonical); \
3687 info.LayoutDirection = layout; \
3688 info.Description = wxT(desc); \
3689 SETWINLANG(info, winlang, winsublang) \
3692 void wxLocale::InitLanguagesDB()
3694 wxLanguageInfo info
;
3695 wxStringTokenizer tkn
;
3697 LNG(wxLANGUAGE_ABKHAZIAN
, "ab" , 0 , 0 , wxLayout_LeftToRight
, "Abkhazian")
3698 LNG(wxLANGUAGE_AFAR
, "aa" , 0 , 0 , wxLayout_LeftToRight
, "Afar")
3699 LNG(wxLANGUAGE_AFRIKAANS
, "af_ZA", LANG_AFRIKAANS
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Afrikaans")
3700 LNG(wxLANGUAGE_ALBANIAN
, "sq_AL", LANG_ALBANIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Albanian")
3701 LNG(wxLANGUAGE_AMHARIC
, "am" , 0 , 0 , wxLayout_LeftToRight
, "Amharic")
3702 LNG(wxLANGUAGE_ARABIC
, "ar" , LANG_ARABIC
, SUBLANG_DEFAULT
, wxLayout_RightToLeft
, "Arabic")
3703 LNG(wxLANGUAGE_ARABIC_ALGERIA
, "ar_DZ", LANG_ARABIC
, SUBLANG_ARABIC_ALGERIA
, wxLayout_RightToLeft
, "Arabic (Algeria)")
3704 LNG(wxLANGUAGE_ARABIC_BAHRAIN
, "ar_BH", LANG_ARABIC
, SUBLANG_ARABIC_BAHRAIN
, wxLayout_RightToLeft
, "Arabic (Bahrain)")
3705 LNG(wxLANGUAGE_ARABIC_EGYPT
, "ar_EG", LANG_ARABIC
, SUBLANG_ARABIC_EGYPT
, wxLayout_RightToLeft
, "Arabic (Egypt)")
3706 LNG(wxLANGUAGE_ARABIC_IRAQ
, "ar_IQ", LANG_ARABIC
, SUBLANG_ARABIC_IRAQ
, wxLayout_RightToLeft
, "Arabic (Iraq)")
3707 LNG(wxLANGUAGE_ARABIC_JORDAN
, "ar_JO", LANG_ARABIC
, SUBLANG_ARABIC_JORDAN
, wxLayout_RightToLeft
, "Arabic (Jordan)")
3708 LNG(wxLANGUAGE_ARABIC_KUWAIT
, "ar_KW", LANG_ARABIC
, SUBLANG_ARABIC_KUWAIT
, wxLayout_RightToLeft
, "Arabic (Kuwait)")
3709 LNG(wxLANGUAGE_ARABIC_LEBANON
, "ar_LB", LANG_ARABIC
, SUBLANG_ARABIC_LEBANON
, wxLayout_RightToLeft
, "Arabic (Lebanon)")
3710 LNG(wxLANGUAGE_ARABIC_LIBYA
, "ar_LY", LANG_ARABIC
, SUBLANG_ARABIC_LIBYA
, wxLayout_RightToLeft
, "Arabic (Libya)")
3711 LNG(wxLANGUAGE_ARABIC_MOROCCO
, "ar_MA", LANG_ARABIC
, SUBLANG_ARABIC_MOROCCO
, wxLayout_RightToLeft
, "Arabic (Morocco)")
3712 LNG(wxLANGUAGE_ARABIC_OMAN
, "ar_OM", LANG_ARABIC
, SUBLANG_ARABIC_OMAN
, wxLayout_RightToLeft
, "Arabic (Oman)")
3713 LNG(wxLANGUAGE_ARABIC_QATAR
, "ar_QA", LANG_ARABIC
, SUBLANG_ARABIC_QATAR
, wxLayout_RightToLeft
, "Arabic (Qatar)")
3714 LNG(wxLANGUAGE_ARABIC_SAUDI_ARABIA
, "ar_SA", LANG_ARABIC
, SUBLANG_ARABIC_SAUDI_ARABIA
, wxLayout_RightToLeft
, "Arabic (Saudi Arabia)")
3715 LNG(wxLANGUAGE_ARABIC_SUDAN
, "ar_SD", 0 , 0 , wxLayout_RightToLeft
, "Arabic (Sudan)")
3716 LNG(wxLANGUAGE_ARABIC_SYRIA
, "ar_SY", LANG_ARABIC
, SUBLANG_ARABIC_SYRIA
, wxLayout_RightToLeft
, "Arabic (Syria)")
3717 LNG(wxLANGUAGE_ARABIC_TUNISIA
, "ar_TN", LANG_ARABIC
, SUBLANG_ARABIC_TUNISIA
, wxLayout_RightToLeft
, "Arabic (Tunisia)")
3718 LNG(wxLANGUAGE_ARABIC_UAE
, "ar_AE", LANG_ARABIC
, SUBLANG_ARABIC_UAE
, wxLayout_RightToLeft
, "Arabic (Uae)")
3719 LNG(wxLANGUAGE_ARABIC_YEMEN
, "ar_YE", LANG_ARABIC
, SUBLANG_ARABIC_YEMEN
, wxLayout_RightToLeft
, "Arabic (Yemen)")
3720 LNG(wxLANGUAGE_ARMENIAN
, "hy" , LANG_ARMENIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Armenian")
3721 LNG(wxLANGUAGE_ASSAMESE
, "as" , LANG_ASSAMESE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Assamese")
3722 LNG(wxLANGUAGE_ASTURIAN
, "ast" , 0 , 0 , wxLayout_LeftToRight
, "Asturian")
3723 LNG(wxLANGUAGE_AYMARA
, "ay" , 0 , 0 , wxLayout_LeftToRight
, "Aymara")
3724 LNG(wxLANGUAGE_AZERI
, "az" , LANG_AZERI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Azeri")
3725 LNG(wxLANGUAGE_AZERI_CYRILLIC
, "az" , LANG_AZERI
, SUBLANG_AZERI_CYRILLIC
, wxLayout_LeftToRight
, "Azeri (Cyrillic)")
3726 LNG(wxLANGUAGE_AZERI_LATIN
, "az" , LANG_AZERI
, SUBLANG_AZERI_LATIN
, wxLayout_LeftToRight
, "Azeri (Latin)")
3727 LNG(wxLANGUAGE_BASHKIR
, "ba" , 0 , 0 , wxLayout_LeftToRight
, "Bashkir")
3728 LNG(wxLANGUAGE_BASQUE
, "eu_ES", LANG_BASQUE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Basque")
3729 LNG(wxLANGUAGE_BELARUSIAN
, "be_BY", LANG_BELARUSIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Belarusian")
3730 LNG(wxLANGUAGE_BENGALI
, "bn" , LANG_BENGALI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Bengali")
3731 LNG(wxLANGUAGE_BHUTANI
, "dz" , 0 , 0 , wxLayout_LeftToRight
, "Bhutani")
3732 LNG(wxLANGUAGE_BIHARI
, "bh" , 0 , 0 , wxLayout_LeftToRight
, "Bihari")
3733 LNG(wxLANGUAGE_BISLAMA
, "bi" , 0 , 0 , wxLayout_LeftToRight
, "Bislama")
3734 LNG(wxLANGUAGE_BRETON
, "br" , 0 , 0 , wxLayout_LeftToRight
, "Breton")
3735 LNG(wxLANGUAGE_BULGARIAN
, "bg_BG", LANG_BULGARIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Bulgarian")
3736 LNG(wxLANGUAGE_BURMESE
, "my" , 0 , 0 , wxLayout_LeftToRight
, "Burmese")
3737 LNG(wxLANGUAGE_CAMBODIAN
, "km" , 0 , 0 , wxLayout_LeftToRight
, "Cambodian")
3738 LNG(wxLANGUAGE_CATALAN
, "ca_ES", LANG_CATALAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Catalan")
3739 LNG(wxLANGUAGE_CHINESE
, "zh_TW", LANG_CHINESE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Chinese")
3740 LNG(wxLANGUAGE_CHINESE_SIMPLIFIED
, "zh_CN", LANG_CHINESE
, SUBLANG_CHINESE_SIMPLIFIED
, wxLayout_LeftToRight
, "Chinese (Simplified)")
3741 LNG(wxLANGUAGE_CHINESE_TRADITIONAL
, "zh_TW", LANG_CHINESE
, SUBLANG_CHINESE_TRADITIONAL
, wxLayout_LeftToRight
, "Chinese (Traditional)")
3742 LNG(wxLANGUAGE_CHINESE_HONGKONG
, "zh_HK", LANG_CHINESE
, SUBLANG_CHINESE_HONGKONG
, wxLayout_LeftToRight
, "Chinese (Hongkong)")
3743 LNG(wxLANGUAGE_CHINESE_MACAU
, "zh_MO", LANG_CHINESE
, SUBLANG_CHINESE_MACAU
, wxLayout_LeftToRight
, "Chinese (Macau)")
3744 LNG(wxLANGUAGE_CHINESE_SINGAPORE
, "zh_SG", LANG_CHINESE
, SUBLANG_CHINESE_SINGAPORE
, wxLayout_LeftToRight
, "Chinese (Singapore)")
3745 LNG(wxLANGUAGE_CHINESE_TAIWAN
, "zh_TW", LANG_CHINESE
, SUBLANG_CHINESE_TRADITIONAL
, wxLayout_LeftToRight
, "Chinese (Taiwan)")
3746 LNG(wxLANGUAGE_CORSICAN
, "co" , 0 , 0 , wxLayout_LeftToRight
, "Corsican")
3747 LNG(wxLANGUAGE_CROATIAN
, "hr_HR", LANG_CROATIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Croatian")
3748 LNG(wxLANGUAGE_CZECH
, "cs_CZ", LANG_CZECH
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Czech")
3749 LNG(wxLANGUAGE_DANISH
, "da_DK", LANG_DANISH
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Danish")
3750 LNG(wxLANGUAGE_DUTCH
, "nl_NL", LANG_DUTCH
, SUBLANG_DUTCH
, wxLayout_LeftToRight
, "Dutch")
3751 LNG(wxLANGUAGE_DUTCH_BELGIAN
, "nl_BE", LANG_DUTCH
, SUBLANG_DUTCH_BELGIAN
, wxLayout_LeftToRight
, "Dutch (Belgian)")
3752 LNG(wxLANGUAGE_ENGLISH
, "en_GB", LANG_ENGLISH
, SUBLANG_ENGLISH_UK
, wxLayout_LeftToRight
, "English")
3753 LNG(wxLANGUAGE_ENGLISH_UK
, "en_GB", LANG_ENGLISH
, SUBLANG_ENGLISH_UK
, wxLayout_LeftToRight
, "English (U.K.)")
3754 LNG(wxLANGUAGE_ENGLISH_US
, "en_US", LANG_ENGLISH
, SUBLANG_ENGLISH_US
, wxLayout_LeftToRight
, "English (U.S.)")
3755 LNG(wxLANGUAGE_ENGLISH_AUSTRALIA
, "en_AU", LANG_ENGLISH
, SUBLANG_ENGLISH_AUS
, wxLayout_LeftToRight
, "English (Australia)")
3756 LNG(wxLANGUAGE_ENGLISH_BELIZE
, "en_BZ", LANG_ENGLISH
, SUBLANG_ENGLISH_BELIZE
, wxLayout_LeftToRight
, "English (Belize)")
3757 LNG(wxLANGUAGE_ENGLISH_BOTSWANA
, "en_BW", 0 , 0 , wxLayout_LeftToRight
, "English (Botswana)")
3758 LNG(wxLANGUAGE_ENGLISH_CANADA
, "en_CA", LANG_ENGLISH
, SUBLANG_ENGLISH_CAN
, wxLayout_LeftToRight
, "English (Canada)")
3759 LNG(wxLANGUAGE_ENGLISH_CARIBBEAN
, "en_CB", LANG_ENGLISH
, SUBLANG_ENGLISH_CARIBBEAN
, wxLayout_LeftToRight
, "English (Caribbean)")
3760 LNG(wxLANGUAGE_ENGLISH_DENMARK
, "en_DK", 0 , 0 , wxLayout_LeftToRight
, "English (Denmark)")
3761 LNG(wxLANGUAGE_ENGLISH_EIRE
, "en_IE", LANG_ENGLISH
, SUBLANG_ENGLISH_EIRE
, wxLayout_LeftToRight
, "English (Eire)")
3762 LNG(wxLANGUAGE_ENGLISH_JAMAICA
, "en_JM", LANG_ENGLISH
, SUBLANG_ENGLISH_JAMAICA
, wxLayout_LeftToRight
, "English (Jamaica)")
3763 LNG(wxLANGUAGE_ENGLISH_NEW_ZEALAND
, "en_NZ", LANG_ENGLISH
, SUBLANG_ENGLISH_NZ
, wxLayout_LeftToRight
, "English (New Zealand)")
3764 LNG(wxLANGUAGE_ENGLISH_PHILIPPINES
, "en_PH", LANG_ENGLISH
, SUBLANG_ENGLISH_PHILIPPINES
, wxLayout_LeftToRight
, "English (Philippines)")
3765 LNG(wxLANGUAGE_ENGLISH_SOUTH_AFRICA
, "en_ZA", LANG_ENGLISH
, SUBLANG_ENGLISH_SOUTH_AFRICA
, wxLayout_LeftToRight
, "English (South Africa)")
3766 LNG(wxLANGUAGE_ENGLISH_TRINIDAD
, "en_TT", LANG_ENGLISH
, SUBLANG_ENGLISH_TRINIDAD
, wxLayout_LeftToRight
, "English (Trinidad)")
3767 LNG(wxLANGUAGE_ENGLISH_ZIMBABWE
, "en_ZW", LANG_ENGLISH
, SUBLANG_ENGLISH_ZIMBABWE
, wxLayout_LeftToRight
, "English (Zimbabwe)")
3768 LNG(wxLANGUAGE_ESPERANTO
, "eo" , 0 , 0 , wxLayout_LeftToRight
, "Esperanto")
3769 LNG(wxLANGUAGE_ESTONIAN
, "et_EE", LANG_ESTONIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Estonian")
3770 LNG(wxLANGUAGE_FAEROESE
, "fo_FO", LANG_FAEROESE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Faeroese")
3771 LNG(wxLANGUAGE_FARSI
, "fa_IR", LANG_FARSI
, SUBLANG_DEFAULT
, wxLayout_RightToLeft
, "Farsi")
3772 LNG(wxLANGUAGE_FIJI
, "fj" , 0 , 0 , wxLayout_LeftToRight
, "Fiji")
3773 LNG(wxLANGUAGE_FINNISH
, "fi_FI", LANG_FINNISH
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Finnish")
3774 LNG(wxLANGUAGE_FRENCH
, "fr_FR", LANG_FRENCH
, SUBLANG_FRENCH
, wxLayout_LeftToRight
, "French")
3775 LNG(wxLANGUAGE_FRENCH_BELGIAN
, "fr_BE", LANG_FRENCH
, SUBLANG_FRENCH_BELGIAN
, wxLayout_LeftToRight
, "French (Belgian)")
3776 LNG(wxLANGUAGE_FRENCH_CANADIAN
, "fr_CA", LANG_FRENCH
, SUBLANG_FRENCH_CANADIAN
, wxLayout_LeftToRight
, "French (Canadian)")
3777 LNG(wxLANGUAGE_FRENCH_LUXEMBOURG
, "fr_LU", LANG_FRENCH
, SUBLANG_FRENCH_LUXEMBOURG
, wxLayout_LeftToRight
, "French (Luxembourg)")
3778 LNG(wxLANGUAGE_FRENCH_MONACO
, "fr_MC", LANG_FRENCH
, SUBLANG_FRENCH_MONACO
, wxLayout_LeftToRight
, "French (Monaco)")
3779 LNG(wxLANGUAGE_FRENCH_SWISS
, "fr_CH", LANG_FRENCH
, SUBLANG_FRENCH_SWISS
, wxLayout_LeftToRight
, "French (Swiss)")
3780 LNG(wxLANGUAGE_FRISIAN
, "fy" , 0 , 0 , wxLayout_LeftToRight
, "Frisian")
3781 LNG(wxLANGUAGE_GALICIAN
, "gl_ES", 0 , 0 , wxLayout_LeftToRight
, "Galician")
3782 LNG(wxLANGUAGE_GEORGIAN
, "ka_GE", LANG_GEORGIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Georgian")
3783 LNG(wxLANGUAGE_GERMAN
, "de_DE", LANG_GERMAN
, SUBLANG_GERMAN
, wxLayout_LeftToRight
, "German")
3784 LNG(wxLANGUAGE_GERMAN_AUSTRIAN
, "de_AT", LANG_GERMAN
, SUBLANG_GERMAN_AUSTRIAN
, wxLayout_LeftToRight
, "German (Austrian)")
3785 LNG(wxLANGUAGE_GERMAN_BELGIUM
, "de_BE", 0 , 0 , wxLayout_LeftToRight
, "German (Belgium)")
3786 LNG(wxLANGUAGE_GERMAN_LIECHTENSTEIN
, "de_LI", LANG_GERMAN
, SUBLANG_GERMAN_LIECHTENSTEIN
, wxLayout_LeftToRight
, "German (Liechtenstein)")
3787 LNG(wxLANGUAGE_GERMAN_LUXEMBOURG
, "de_LU", LANG_GERMAN
, SUBLANG_GERMAN_LUXEMBOURG
, wxLayout_LeftToRight
, "German (Luxembourg)")
3788 LNG(wxLANGUAGE_GERMAN_SWISS
, "de_CH", LANG_GERMAN
, SUBLANG_GERMAN_SWISS
, wxLayout_LeftToRight
, "German (Swiss)")
3789 LNG(wxLANGUAGE_GREEK
, "el_GR", LANG_GREEK
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Greek")
3790 LNG(wxLANGUAGE_GREENLANDIC
, "kl_GL", 0 , 0 , wxLayout_LeftToRight
, "Greenlandic")
3791 LNG(wxLANGUAGE_GUARANI
, "gn" , 0 , 0 , wxLayout_LeftToRight
, "Guarani")
3792 LNG(wxLANGUAGE_GUJARATI
, "gu" , LANG_GUJARATI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Gujarati")
3793 LNG(wxLANGUAGE_HAUSA
, "ha" , 0 , 0 , wxLayout_LeftToRight
, "Hausa")
3794 LNG(wxLANGUAGE_HEBREW
, "he_IL", LANG_HEBREW
, SUBLANG_DEFAULT
, wxLayout_RightToLeft
, "Hebrew")
3795 LNG(wxLANGUAGE_HINDI
, "hi_IN", LANG_HINDI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Hindi")
3796 LNG(wxLANGUAGE_HUNGARIAN
, "hu_HU", LANG_HUNGARIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Hungarian")
3797 LNG(wxLANGUAGE_ICELANDIC
, "is_IS", LANG_ICELANDIC
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Icelandic")
3798 LNG(wxLANGUAGE_INDONESIAN
, "id_ID", LANG_INDONESIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Indonesian")
3799 LNG(wxLANGUAGE_INTERLINGUA
, "ia" , 0 , 0 , wxLayout_LeftToRight
, "Interlingua")
3800 LNG(wxLANGUAGE_INTERLINGUE
, "ie" , 0 , 0 , wxLayout_LeftToRight
, "Interlingue")
3801 LNG(wxLANGUAGE_INUKTITUT
, "iu" , 0 , 0 , wxLayout_LeftToRight
, "Inuktitut")
3802 LNG(wxLANGUAGE_INUPIAK
, "ik" , 0 , 0 , wxLayout_LeftToRight
, "Inupiak")
3803 LNG(wxLANGUAGE_IRISH
, "ga_IE", 0 , 0 , wxLayout_LeftToRight
, "Irish")
3804 LNG(wxLANGUAGE_ITALIAN
, "it_IT", LANG_ITALIAN
, SUBLANG_ITALIAN
, wxLayout_LeftToRight
, "Italian")
3805 LNG(wxLANGUAGE_ITALIAN_SWISS
, "it_CH", LANG_ITALIAN
, SUBLANG_ITALIAN_SWISS
, wxLayout_LeftToRight
, "Italian (Swiss)")
3806 LNG(wxLANGUAGE_JAPANESE
, "ja_JP", LANG_JAPANESE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Japanese")
3807 LNG(wxLANGUAGE_JAVANESE
, "jw" , 0 , 0 , wxLayout_LeftToRight
, "Javanese")
3808 LNG(wxLANGUAGE_KANNADA
, "kn" , LANG_KANNADA
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Kannada")
3809 LNG(wxLANGUAGE_KASHMIRI
, "ks" , LANG_KASHMIRI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Kashmiri")
3810 LNG(wxLANGUAGE_KASHMIRI_INDIA
, "ks_IN", LANG_KASHMIRI
, SUBLANG_KASHMIRI_INDIA
, wxLayout_LeftToRight
, "Kashmiri (India)")
3811 LNG(wxLANGUAGE_KAZAKH
, "kk" , LANG_KAZAK
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Kazakh")
3812 LNG(wxLANGUAGE_KERNEWEK
, "kw_GB", 0 , 0 , wxLayout_LeftToRight
, "Kernewek")
3813 LNG(wxLANGUAGE_KINYARWANDA
, "rw" , 0 , 0 , wxLayout_LeftToRight
, "Kinyarwanda")
3814 LNG(wxLANGUAGE_KIRGHIZ
, "ky" , 0 , 0 , wxLayout_LeftToRight
, "Kirghiz")
3815 LNG(wxLANGUAGE_KIRUNDI
, "rn" , 0 , 0 , wxLayout_LeftToRight
, "Kirundi")
3816 LNG(wxLANGUAGE_KONKANI
, "" , LANG_KONKANI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Konkani")
3817 LNG(wxLANGUAGE_KOREAN
, "ko_KR", LANG_KOREAN
, SUBLANG_KOREAN
, wxLayout_LeftToRight
, "Korean")
3818 LNG(wxLANGUAGE_KURDISH
, "ku_TR", 0 , 0 , wxLayout_LeftToRight
, "Kurdish")
3819 LNG(wxLANGUAGE_LAOTHIAN
, "lo" , 0 , 0 , wxLayout_LeftToRight
, "Laothian")
3820 LNG(wxLANGUAGE_LATIN
, "la" , 0 , 0 , wxLayout_LeftToRight
, "Latin")
3821 LNG(wxLANGUAGE_LATVIAN
, "lv_LV", LANG_LATVIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Latvian")
3822 LNG(wxLANGUAGE_LINGALA
, "ln" , 0 , 0 , wxLayout_LeftToRight
, "Lingala")
3823 LNG(wxLANGUAGE_LITHUANIAN
, "lt_LT", LANG_LITHUANIAN
, SUBLANG_LITHUANIAN
, wxLayout_LeftToRight
, "Lithuanian")
3824 LNG(wxLANGUAGE_MACEDONIAN
, "mk_MK", LANG_MACEDONIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Macedonian")
3825 LNG(wxLANGUAGE_MALAGASY
, "mg" , 0 , 0 , wxLayout_LeftToRight
, "Malagasy")
3826 LNG(wxLANGUAGE_MALAY
, "ms_MY", LANG_MALAY
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Malay")
3827 LNG(wxLANGUAGE_MALAYALAM
, "ml" , LANG_MALAYALAM
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Malayalam")
3828 LNG(wxLANGUAGE_MALAY_BRUNEI_DARUSSALAM
, "ms_BN", LANG_MALAY
, SUBLANG_MALAY_BRUNEI_DARUSSALAM
, wxLayout_LeftToRight
, "Malay (Brunei Darussalam)")
3829 LNG(wxLANGUAGE_MALAY_MALAYSIA
, "ms_MY", LANG_MALAY
, SUBLANG_MALAY_MALAYSIA
, wxLayout_LeftToRight
, "Malay (Malaysia)")
3830 LNG(wxLANGUAGE_MALTESE
, "mt_MT", 0 , 0 , wxLayout_LeftToRight
, "Maltese")
3831 LNG(wxLANGUAGE_MANIPURI
, "" , LANG_MANIPURI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Manipuri")
3832 LNG(wxLANGUAGE_MAORI
, "mi" , 0 , 0 , wxLayout_LeftToRight
, "Maori")
3833 LNG(wxLANGUAGE_MARATHI
, "mr_IN", LANG_MARATHI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Marathi")
3834 LNG(wxLANGUAGE_MOLDAVIAN
, "mo" , 0 , 0 , wxLayout_LeftToRight
, "Moldavian")
3835 LNG(wxLANGUAGE_MONGOLIAN
, "mn" , 0 , 0 , wxLayout_LeftToRight
, "Mongolian")
3836 LNG(wxLANGUAGE_NAURU
, "na" , 0 , 0 , wxLayout_LeftToRight
, "Nauru")
3837 LNG(wxLANGUAGE_NEPALI
, "ne_NP", LANG_NEPALI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Nepali")
3838 LNG(wxLANGUAGE_NEPALI_INDIA
, "ne_IN", LANG_NEPALI
, SUBLANG_NEPALI_INDIA
, wxLayout_LeftToRight
, "Nepali (India)")
3839 LNG(wxLANGUAGE_NORWEGIAN_BOKMAL
, "nb_NO", LANG_NORWEGIAN
, SUBLANG_NORWEGIAN_BOKMAL
, wxLayout_LeftToRight
, "Norwegian (Bokmal)")
3840 LNG(wxLANGUAGE_NORWEGIAN_NYNORSK
, "nn_NO", LANG_NORWEGIAN
, SUBLANG_NORWEGIAN_NYNORSK
, wxLayout_LeftToRight
, "Norwegian (Nynorsk)")
3841 LNG(wxLANGUAGE_OCCITAN
, "oc" , 0 , 0 , wxLayout_LeftToRight
, "Occitan")
3842 LNG(wxLANGUAGE_ORIYA
, "or" , LANG_ORIYA
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Oriya")
3843 LNG(wxLANGUAGE_OROMO
, "om" , 0 , 0 , wxLayout_LeftToRight
, "(Afan) Oromo")
3844 LNG(wxLANGUAGE_PASHTO
, "ps" , 0 , 0 , wxLayout_LeftToRight
, "Pashto, Pushto")
3845 LNG(wxLANGUAGE_POLISH
, "pl_PL", LANG_POLISH
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Polish")
3846 LNG(wxLANGUAGE_PORTUGUESE
, "pt_PT", LANG_PORTUGUESE
, SUBLANG_PORTUGUESE
, wxLayout_LeftToRight
, "Portuguese")
3847 LNG(wxLANGUAGE_PORTUGUESE_BRAZILIAN
, "pt_BR", LANG_PORTUGUESE
, SUBLANG_PORTUGUESE_BRAZILIAN
, wxLayout_LeftToRight
, "Portuguese (Brazilian)")
3848 LNG(wxLANGUAGE_PUNJABI
, "pa" , LANG_PUNJABI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Punjabi")
3849 LNG(wxLANGUAGE_QUECHUA
, "qu" , 0 , 0 , wxLayout_LeftToRight
, "Quechua")
3850 LNG(wxLANGUAGE_RHAETO_ROMANCE
, "rm" , 0 , 0 , wxLayout_LeftToRight
, "Rhaeto-Romance")
3851 LNG(wxLANGUAGE_ROMANIAN
, "ro_RO", LANG_ROMANIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Romanian")
3852 LNG(wxLANGUAGE_RUSSIAN
, "ru_RU", LANG_RUSSIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Russian")
3853 LNG(wxLANGUAGE_RUSSIAN_UKRAINE
, "ru_UA", 0 , 0 , wxLayout_LeftToRight
, "Russian (Ukraine)")
3854 LNG(wxLANGUAGE_SAMI
, "se_NO", LANG_SAMI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Northern Sami")
3855 LNG(wxLANGUAGE_SAMOAN
, "sm" , 0 , 0 , wxLayout_LeftToRight
, "Samoan")
3856 LNG(wxLANGUAGE_SANGHO
, "sg" , 0 , 0 , wxLayout_LeftToRight
, "Sangho")
3857 LNG(wxLANGUAGE_SANSKRIT
, "sa" , LANG_SANSKRIT
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Sanskrit")
3858 LNG(wxLANGUAGE_SCOTS_GAELIC
, "gd" , 0 , 0 , wxLayout_LeftToRight
, "Scots Gaelic")
3859 LNG(wxLANGUAGE_SERBIAN
, "sr_RS", LANG_SERBIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Serbian")
3860 LNG(wxLANGUAGE_SERBIAN_CYRILLIC
, "sr_RS", LANG_SERBIAN
, SUBLANG_SERBIAN_CYRILLIC
, wxLayout_LeftToRight
, "Serbian (Cyrillic)")
3861 LNG(wxLANGUAGE_SERBIAN_LATIN
, "sr_RS@latin", LANG_SERBIAN
, SUBLANG_SERBIAN_LATIN
, wxLayout_LeftToRight
, "Serbian (Latin)")
3862 LNG(wxLANGUAGE_SERBIAN_CYRILLIC
, "sr_YU", LANG_SERBIAN
, SUBLANG_SERBIAN_CYRILLIC
, wxLayout_LeftToRight
, "Serbian (Cyrillic)")
3863 LNG(wxLANGUAGE_SERBIAN_LATIN
, "sr_YU@latin", LANG_SERBIAN
, SUBLANG_SERBIAN_LATIN
, wxLayout_LeftToRight
, "Serbian (Latin)")
3864 LNG(wxLANGUAGE_SERBO_CROATIAN
, "sh" , 0 , 0 , wxLayout_LeftToRight
, "Serbo-Croatian")
3865 LNG(wxLANGUAGE_SESOTHO
, "st" , 0 , 0 , wxLayout_LeftToRight
, "Sesotho")
3866 LNG(wxLANGUAGE_SETSWANA
, "tn" , 0 , 0 , wxLayout_LeftToRight
, "Setswana")
3867 LNG(wxLANGUAGE_SHONA
, "sn" , 0 , 0 , wxLayout_LeftToRight
, "Shona")
3868 LNG(wxLANGUAGE_SINDHI
, "sd" , LANG_SINDHI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Sindhi")
3869 LNG(wxLANGUAGE_SINHALESE
, "si" , 0 , 0 , wxLayout_LeftToRight
, "Sinhalese")
3870 LNG(wxLANGUAGE_SISWATI
, "ss" , 0 , 0 , wxLayout_LeftToRight
, "Siswati")
3871 LNG(wxLANGUAGE_SLOVAK
, "sk_SK", LANG_SLOVAK
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Slovak")
3872 LNG(wxLANGUAGE_SLOVENIAN
, "sl_SI", LANG_SLOVENIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Slovenian")
3873 LNG(wxLANGUAGE_SOMALI
, "so" , 0 , 0 , wxLayout_LeftToRight
, "Somali")
3874 LNG(wxLANGUAGE_SPANISH
, "es_ES", LANG_SPANISH
, SUBLANG_SPANISH
, wxLayout_LeftToRight
, "Spanish")
3875 LNG(wxLANGUAGE_SPANISH_ARGENTINA
, "es_AR", LANG_SPANISH
, SUBLANG_SPANISH_ARGENTINA
, wxLayout_LeftToRight
, "Spanish (Argentina)")
3876 LNG(wxLANGUAGE_SPANISH_BOLIVIA
, "es_BO", LANG_SPANISH
, SUBLANG_SPANISH_BOLIVIA
, wxLayout_LeftToRight
, "Spanish (Bolivia)")
3877 LNG(wxLANGUAGE_SPANISH_CHILE
, "es_CL", LANG_SPANISH
, SUBLANG_SPANISH_CHILE
, wxLayout_LeftToRight
, "Spanish (Chile)")
3878 LNG(wxLANGUAGE_SPANISH_COLOMBIA
, "es_CO", LANG_SPANISH
, SUBLANG_SPANISH_COLOMBIA
, wxLayout_LeftToRight
, "Spanish (Colombia)")
3879 LNG(wxLANGUAGE_SPANISH_COSTA_RICA
, "es_CR", LANG_SPANISH
, SUBLANG_SPANISH_COSTA_RICA
, wxLayout_LeftToRight
, "Spanish (Costa Rica)")
3880 LNG(wxLANGUAGE_SPANISH_DOMINICAN_REPUBLIC
, "es_DO", LANG_SPANISH
, SUBLANG_SPANISH_DOMINICAN_REPUBLIC
, wxLayout_LeftToRight
, "Spanish (Dominican republic)")
3881 LNG(wxLANGUAGE_SPANISH_ECUADOR
, "es_EC", LANG_SPANISH
, SUBLANG_SPANISH_ECUADOR
, wxLayout_LeftToRight
, "Spanish (Ecuador)")
3882 LNG(wxLANGUAGE_SPANISH_EL_SALVADOR
, "es_SV", LANG_SPANISH
, SUBLANG_SPANISH_EL_SALVADOR
, wxLayout_LeftToRight
, "Spanish (El Salvador)")
3883 LNG(wxLANGUAGE_SPANISH_GUATEMALA
, "es_GT", LANG_SPANISH
, SUBLANG_SPANISH_GUATEMALA
, wxLayout_LeftToRight
, "Spanish (Guatemala)")
3884 LNG(wxLANGUAGE_SPANISH_HONDURAS
, "es_HN", LANG_SPANISH
, SUBLANG_SPANISH_HONDURAS
, wxLayout_LeftToRight
, "Spanish (Honduras)")
3885 LNG(wxLANGUAGE_SPANISH_MEXICAN
, "es_MX", LANG_SPANISH
, SUBLANG_SPANISH_MEXICAN
, wxLayout_LeftToRight
, "Spanish (Mexican)")
3886 LNG(wxLANGUAGE_SPANISH_MODERN
, "es_ES", LANG_SPANISH
, SUBLANG_SPANISH_MODERN
, wxLayout_LeftToRight
, "Spanish (Modern)")
3887 LNG(wxLANGUAGE_SPANISH_NICARAGUA
, "es_NI", LANG_SPANISH
, SUBLANG_SPANISH_NICARAGUA
, wxLayout_LeftToRight
, "Spanish (Nicaragua)")
3888 LNG(wxLANGUAGE_SPANISH_PANAMA
, "es_PA", LANG_SPANISH
, SUBLANG_SPANISH_PANAMA
, wxLayout_LeftToRight
, "Spanish (Panama)")
3889 LNG(wxLANGUAGE_SPANISH_PARAGUAY
, "es_PY", LANG_SPANISH
, SUBLANG_SPANISH_PARAGUAY
, wxLayout_LeftToRight
, "Spanish (Paraguay)")
3890 LNG(wxLANGUAGE_SPANISH_PERU
, "es_PE", LANG_SPANISH
, SUBLANG_SPANISH_PERU
, wxLayout_LeftToRight
, "Spanish (Peru)")
3891 LNG(wxLANGUAGE_SPANISH_PUERTO_RICO
, "es_PR", LANG_SPANISH
, SUBLANG_SPANISH_PUERTO_RICO
, wxLayout_LeftToRight
, "Spanish (Puerto Rico)")
3892 LNG(wxLANGUAGE_SPANISH_URUGUAY
, "es_UY", LANG_SPANISH
, SUBLANG_SPANISH_URUGUAY
, wxLayout_LeftToRight
, "Spanish (Uruguay)")
3893 LNG(wxLANGUAGE_SPANISH_US
, "es_US", 0 , 0 , wxLayout_LeftToRight
, "Spanish (U.S.)")
3894 LNG(wxLANGUAGE_SPANISH_VENEZUELA
, "es_VE", LANG_SPANISH
, SUBLANG_SPANISH_VENEZUELA
, wxLayout_LeftToRight
, "Spanish (Venezuela)")
3895 LNG(wxLANGUAGE_SUNDANESE
, "su" , 0 , 0 , wxLayout_LeftToRight
, "Sundanese")
3896 LNG(wxLANGUAGE_SWAHILI
, "sw_KE", LANG_SWAHILI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Swahili")
3897 LNG(wxLANGUAGE_SWEDISH
, "sv_SE", LANG_SWEDISH
, SUBLANG_SWEDISH
, wxLayout_LeftToRight
, "Swedish")
3898 LNG(wxLANGUAGE_SWEDISH_FINLAND
, "sv_FI", LANG_SWEDISH
, SUBLANG_SWEDISH_FINLAND
, wxLayout_LeftToRight
, "Swedish (Finland)")
3899 LNG(wxLANGUAGE_TAGALOG
, "tl_PH", 0 , 0 , wxLayout_LeftToRight
, "Tagalog")
3900 LNG(wxLANGUAGE_TAJIK
, "tg" , 0 , 0 , wxLayout_LeftToRight
, "Tajik")
3901 LNG(wxLANGUAGE_TAMIL
, "ta" , LANG_TAMIL
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Tamil")
3902 LNG(wxLANGUAGE_TATAR
, "tt" , LANG_TATAR
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Tatar")
3903 LNG(wxLANGUAGE_TELUGU
, "te" , LANG_TELUGU
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Telugu")
3904 LNG(wxLANGUAGE_THAI
, "th_TH", LANG_THAI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Thai")
3905 LNG(wxLANGUAGE_TIBETAN
, "bo" , 0 , 0 , wxLayout_LeftToRight
, "Tibetan")
3906 LNG(wxLANGUAGE_TIGRINYA
, "ti" , 0 , 0 , wxLayout_LeftToRight
, "Tigrinya")
3907 LNG(wxLANGUAGE_TONGA
, "to" , 0 , 0 , wxLayout_LeftToRight
, "Tonga")
3908 LNG(wxLANGUAGE_TSONGA
, "ts" , 0 , 0 , wxLayout_LeftToRight
, "Tsonga")
3909 LNG(wxLANGUAGE_TURKISH
, "tr_TR", LANG_TURKISH
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Turkish")
3910 LNG(wxLANGUAGE_TURKMEN
, "tk" , 0 , 0 , wxLayout_LeftToRight
, "Turkmen")
3911 LNG(wxLANGUAGE_TWI
, "tw" , 0 , 0 , wxLayout_LeftToRight
, "Twi")
3912 LNG(wxLANGUAGE_UIGHUR
, "ug" , 0 , 0 , wxLayout_LeftToRight
, "Uighur")
3913 LNG(wxLANGUAGE_UKRAINIAN
, "uk_UA", LANG_UKRAINIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Ukrainian")
3914 LNG(wxLANGUAGE_URDU
, "ur" , LANG_URDU
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Urdu")
3915 LNG(wxLANGUAGE_URDU_INDIA
, "ur_IN", LANG_URDU
, SUBLANG_URDU_INDIA
, wxLayout_LeftToRight
, "Urdu (India)")
3916 LNG(wxLANGUAGE_URDU_PAKISTAN
, "ur_PK", LANG_URDU
, SUBLANG_URDU_PAKISTAN
, wxLayout_LeftToRight
, "Urdu (Pakistan)")
3917 LNG(wxLANGUAGE_UZBEK
, "uz" , LANG_UZBEK
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Uzbek")
3918 LNG(wxLANGUAGE_UZBEK_CYRILLIC
, "uz" , LANG_UZBEK
, SUBLANG_UZBEK_CYRILLIC
, wxLayout_LeftToRight
, "Uzbek (Cyrillic)")
3919 LNG(wxLANGUAGE_UZBEK_LATIN
, "uz" , LANG_UZBEK
, SUBLANG_UZBEK_LATIN
, wxLayout_LeftToRight
, "Uzbek (Latin)")
3920 LNG(wxLANGUAGE_VALENCIAN
, "ca_ES@valencia", 0 , 0 , wxLayout_LeftToRight
, "Valencian (Southern Catalan)")
3921 LNG(wxLANGUAGE_VIETNAMESE
, "vi_VN", LANG_VIETNAMESE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Vietnamese")
3922 LNG(wxLANGUAGE_VOLAPUK
, "vo" , 0 , 0 , wxLayout_LeftToRight
, "Volapuk")
3923 LNG(wxLANGUAGE_WELSH
, "cy" , 0 , 0 , wxLayout_LeftToRight
, "Welsh")
3924 LNG(wxLANGUAGE_WOLOF
, "wo" , 0 , 0 , wxLayout_LeftToRight
, "Wolof")
3925 LNG(wxLANGUAGE_XHOSA
, "xh" , 0 , 0 , wxLayout_LeftToRight
, "Xhosa")
3926 LNG(wxLANGUAGE_YIDDISH
, "yi" , 0 , 0 , wxLayout_LeftToRight
, "Yiddish")
3927 LNG(wxLANGUAGE_YORUBA
, "yo" , 0 , 0 , wxLayout_LeftToRight
, "Yoruba")
3928 LNG(wxLANGUAGE_ZHUANG
, "za" , 0 , 0 , wxLayout_LeftToRight
, "Zhuang")
3929 LNG(wxLANGUAGE_ZULU
, "zu" , 0 , 0 , wxLayout_LeftToRight
, "Zulu")
3934 // --- --- --- generated code ends here --- --- ---
3936 #endif // wxUSE_INTL