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/ptr_scpd.h"
70 #include "wx/apptrait.h"
71 #include "wx/stdpaths.h"
72 #include "wx/hashset.h"
73 #include "wx/filesys.h"
75 #if defined(__WXMAC__)
76 #include "wx/mac/private.h" // includes mac headers
79 // ----------------------------------------------------------------------------
81 // ----------------------------------------------------------------------------
83 // this should *not* be wxChar, this type must have exactly 8 bits!
84 typedef wxUint8 size_t8
;
85 typedef wxUint32 size_t32
;
87 // ----------------------------------------------------------------------------
89 // ----------------------------------------------------------------------------
91 // magic number identifying the .mo format file
92 const size_t32 MSGCATALOG_MAGIC
= 0x950412de;
93 const size_t32 MSGCATALOG_MAGIC_SW
= 0xde120495;
95 // the constants describing the format of lang_LANG locale string
96 static const size_t LEN_LANG
= 2;
97 static const size_t LEN_SUBLANG
= 2;
98 static const size_t LEN_FULL
= LEN_LANG
+ 1 + LEN_SUBLANG
; // 1 for '_'
100 #define TRACE_I18N _T("i18n")
102 // ----------------------------------------------------------------------------
104 // ----------------------------------------------------------------------------
108 // small class to suppress the translation erros until exit from current scope
112 NoTransErr() { ms_suppressCount
++; }
113 ~NoTransErr() { ms_suppressCount
--; }
115 static bool Suppress() { return ms_suppressCount
> 0; }
118 static size_t ms_suppressCount
;
121 size_t NoTransErr::ms_suppressCount
= 0;
132 #endif // Debug/!Debug
134 static wxLocale
*wxSetLocale(wxLocale
*pLocale
);
136 // helper functions of GetSystemLanguage()
139 // get just the language part
140 static inline wxString
ExtractLang(const wxString
& langFull
)
142 return langFull
.Left(LEN_LANG
);
145 // get everything else (including the leading '_')
146 static inline wxString
ExtractNotLang(const wxString
& langFull
)
148 return langFull
.Mid(LEN_LANG
);
154 // ----------------------------------------------------------------------------
155 // Plural forms parser
156 // ----------------------------------------------------------------------------
162 LogicalOrExpression '?' Expression ':' Expression
166 LogicalAndExpression "||" LogicalOrExpression // to (a || b) || c
169 LogicalAndExpression:
170 EqualityExpression "&&" LogicalAndExpression // to (a && b) && c
174 RelationalExpression "==" RelationalExperession
175 RelationalExpression "!=" RelationalExperession
178 RelationalExpression:
179 MultiplicativeExpression '>' MultiplicativeExpression
180 MultiplicativeExpression '<' MultiplicativeExpression
181 MultiplicativeExpression ">=" MultiplicativeExpression
182 MultiplicativeExpression "<=" MultiplicativeExpression
183 MultiplicativeExpression
185 MultiplicativeExpression:
186 PmExpression '%' PmExpression
195 class wxPluralFormsToken
200 T_ERROR
, T_EOF
, T_NUMBER
, T_N
, T_PLURAL
, T_NPLURALS
, T_EQUAL
, T_ASSIGN
,
201 T_GREATER
, T_GREATER_OR_EQUAL
, T_LESS
, T_LESS_OR_EQUAL
,
202 T_REMINDER
, T_NOT_EQUAL
,
203 T_LOGICAL_AND
, T_LOGICAL_OR
, T_QUESTION
, T_COLON
, T_SEMICOLON
,
204 T_LEFT_BRACKET
, T_RIGHT_BRACKET
206 Type
type() const { return m_type
; }
207 void setType(Type type
) { m_type
= type
; }
210 Number
number() const { return m_number
; }
211 void setNumber(Number num
) { m_number
= num
; }
218 class wxPluralFormsScanner
221 wxPluralFormsScanner(const char* s
);
222 const wxPluralFormsToken
& token() const { return m_token
; }
223 bool nextToken(); // returns false if error
226 wxPluralFormsToken m_token
;
229 wxPluralFormsScanner::wxPluralFormsScanner(const char* s
) : m_s(s
)
234 bool wxPluralFormsScanner::nextToken()
236 wxPluralFormsToken::Type type
= wxPluralFormsToken::T_ERROR
;
237 while (isspace(*m_s
))
243 type
= wxPluralFormsToken::T_EOF
;
245 else if (isdigit(*m_s
))
247 wxPluralFormsToken::Number number
= *m_s
++ - '0';
248 while (isdigit(*m_s
))
250 number
= number
* 10 + (*m_s
++ - '0');
252 m_token
.setNumber(number
);
253 type
= wxPluralFormsToken::T_NUMBER
;
255 else if (isalpha(*m_s
))
257 const char* begin
= m_s
++;
258 while (isalnum(*m_s
))
262 size_t size
= m_s
- begin
;
263 if (size
== 1 && memcmp(begin
, "n", size
) == 0)
265 type
= wxPluralFormsToken::T_N
;
267 else if (size
== 6 && memcmp(begin
, "plural", size
) == 0)
269 type
= wxPluralFormsToken::T_PLURAL
;
271 else if (size
== 8 && memcmp(begin
, "nplurals", size
) == 0)
273 type
= wxPluralFormsToken::T_NPLURALS
;
276 else if (*m_s
== '=')
282 type
= wxPluralFormsToken::T_EQUAL
;
286 type
= wxPluralFormsToken::T_ASSIGN
;
289 else if (*m_s
== '>')
295 type
= wxPluralFormsToken::T_GREATER_OR_EQUAL
;
299 type
= wxPluralFormsToken::T_GREATER
;
302 else if (*m_s
== '<')
308 type
= wxPluralFormsToken::T_LESS_OR_EQUAL
;
312 type
= wxPluralFormsToken::T_LESS
;
315 else if (*m_s
== '%')
318 type
= wxPluralFormsToken::T_REMINDER
;
320 else if (*m_s
== '!' && m_s
[1] == '=')
323 type
= wxPluralFormsToken::T_NOT_EQUAL
;
325 else if (*m_s
== '&' && m_s
[1] == '&')
328 type
= wxPluralFormsToken::T_LOGICAL_AND
;
330 else if (*m_s
== '|' && m_s
[1] == '|')
333 type
= wxPluralFormsToken::T_LOGICAL_OR
;
335 else if (*m_s
== '?')
338 type
= wxPluralFormsToken::T_QUESTION
;
340 else if (*m_s
== ':')
343 type
= wxPluralFormsToken::T_COLON
;
344 } else if (*m_s
== ';') {
346 type
= wxPluralFormsToken::T_SEMICOLON
;
348 else if (*m_s
== '(')
351 type
= wxPluralFormsToken::T_LEFT_BRACKET
;
353 else if (*m_s
== ')')
356 type
= wxPluralFormsToken::T_RIGHT_BRACKET
;
358 m_token
.setType(type
);
359 return type
!= wxPluralFormsToken::T_ERROR
;
362 class wxPluralFormsNode
;
364 // NB: Can't use wxDEFINE_SCOPED_PTR_TYPE because wxPluralFormsNode is not
365 // fully defined yet:
366 class wxPluralFormsNodePtr
369 wxPluralFormsNodePtr(wxPluralFormsNode
*p
= NULL
) : m_p(p
) {}
370 ~wxPluralFormsNodePtr();
371 wxPluralFormsNode
& operator*() const { return *m_p
; }
372 wxPluralFormsNode
* operator->() const { return m_p
; }
373 wxPluralFormsNode
* get() const { return m_p
; }
374 wxPluralFormsNode
* release();
375 void reset(wxPluralFormsNode
*p
);
378 wxPluralFormsNode
*m_p
;
381 class wxPluralFormsNode
384 wxPluralFormsNode(const wxPluralFormsToken
& token
) : m_token(token
) {}
385 const wxPluralFormsToken
& token() const { return m_token
; }
386 const wxPluralFormsNode
* node(size_t i
) const
387 { return m_nodes
[i
].get(); }
388 void setNode(size_t i
, wxPluralFormsNode
* n
);
389 wxPluralFormsNode
* releaseNode(size_t i
);
390 wxPluralFormsToken::Number
evaluate(wxPluralFormsToken::Number n
) const;
393 wxPluralFormsToken m_token
;
394 wxPluralFormsNodePtr m_nodes
[3];
397 wxPluralFormsNodePtr::~wxPluralFormsNodePtr()
401 wxPluralFormsNode
* wxPluralFormsNodePtr::release()
403 wxPluralFormsNode
*p
= m_p
;
407 void wxPluralFormsNodePtr::reset(wxPluralFormsNode
*p
)
417 void wxPluralFormsNode::setNode(size_t i
, wxPluralFormsNode
* n
)
422 wxPluralFormsNode
* wxPluralFormsNode::releaseNode(size_t i
)
424 return m_nodes
[i
].release();
427 wxPluralFormsToken::Number
428 wxPluralFormsNode::evaluate(wxPluralFormsToken::Number n
) const
430 switch (token().type())
433 case wxPluralFormsToken::T_NUMBER
:
434 return token().number();
435 case wxPluralFormsToken::T_N
:
438 case wxPluralFormsToken::T_EQUAL
:
439 return node(0)->evaluate(n
) == node(1)->evaluate(n
);
440 case wxPluralFormsToken::T_NOT_EQUAL
:
441 return node(0)->evaluate(n
) != node(1)->evaluate(n
);
442 case wxPluralFormsToken::T_GREATER
:
443 return node(0)->evaluate(n
) > node(1)->evaluate(n
);
444 case wxPluralFormsToken::T_GREATER_OR_EQUAL
:
445 return node(0)->evaluate(n
) >= node(1)->evaluate(n
);
446 case wxPluralFormsToken::T_LESS
:
447 return node(0)->evaluate(n
) < node(1)->evaluate(n
);
448 case wxPluralFormsToken::T_LESS_OR_EQUAL
:
449 return node(0)->evaluate(n
) <= node(1)->evaluate(n
);
450 case wxPluralFormsToken::T_REMINDER
:
452 wxPluralFormsToken::Number number
= node(1)->evaluate(n
);
455 return node(0)->evaluate(n
) % number
;
462 case wxPluralFormsToken::T_LOGICAL_AND
:
463 return node(0)->evaluate(n
) && node(1)->evaluate(n
);
464 case wxPluralFormsToken::T_LOGICAL_OR
:
465 return node(0)->evaluate(n
) || node(1)->evaluate(n
);
467 case wxPluralFormsToken::T_QUESTION
:
468 return node(0)->evaluate(n
)
469 ? node(1)->evaluate(n
)
470 : node(2)->evaluate(n
);
477 class wxPluralFormsCalculator
480 wxPluralFormsCalculator() : m_nplurals(0), m_plural(0) {}
482 // input: number, returns msgstr index
483 int evaluate(int n
) const;
485 // input: text after "Plural-Forms:" (e.g. "nplurals=2; plural=(n != 1);"),
486 // if s == 0, creates default handler
487 // returns 0 if error
488 static wxPluralFormsCalculator
* make(const char* s
= 0);
490 ~wxPluralFormsCalculator() {}
492 void init(wxPluralFormsToken::Number nplurals
, wxPluralFormsNode
* plural
);
495 wxPluralFormsToken::Number m_nplurals
;
496 wxPluralFormsNodePtr m_plural
;
499 wxDEFINE_SCOPED_PTR_TYPE(wxPluralFormsCalculator
)
501 void wxPluralFormsCalculator::init(wxPluralFormsToken::Number nplurals
,
502 wxPluralFormsNode
* plural
)
504 m_nplurals
= nplurals
;
505 m_plural
.reset(plural
);
508 int wxPluralFormsCalculator::evaluate(int n
) const
510 if (m_plural
.get() == 0)
514 wxPluralFormsToken::Number number
= m_plural
->evaluate(n
);
515 if (number
< 0 || number
> m_nplurals
)
523 class wxPluralFormsParser
526 wxPluralFormsParser(wxPluralFormsScanner
& scanner
) : m_scanner(scanner
) {}
527 bool parse(wxPluralFormsCalculator
& rCalculator
);
530 wxPluralFormsNode
* parsePlural();
531 // stops at T_SEMICOLON, returns 0 if error
532 wxPluralFormsScanner
& m_scanner
;
533 const wxPluralFormsToken
& token() const;
536 wxPluralFormsNode
* expression();
537 wxPluralFormsNode
* logicalOrExpression();
538 wxPluralFormsNode
* logicalAndExpression();
539 wxPluralFormsNode
* equalityExpression();
540 wxPluralFormsNode
* multiplicativeExpression();
541 wxPluralFormsNode
* relationalExpression();
542 wxPluralFormsNode
* pmExpression();
545 bool wxPluralFormsParser::parse(wxPluralFormsCalculator
& rCalculator
)
547 if (token().type() != wxPluralFormsToken::T_NPLURALS
)
551 if (token().type() != wxPluralFormsToken::T_ASSIGN
)
555 if (token().type() != wxPluralFormsToken::T_NUMBER
)
557 wxPluralFormsToken::Number nplurals
= token().number();
560 if (token().type() != wxPluralFormsToken::T_SEMICOLON
)
564 if (token().type() != wxPluralFormsToken::T_PLURAL
)
568 if (token().type() != wxPluralFormsToken::T_ASSIGN
)
572 wxPluralFormsNode
* plural
= parsePlural();
575 if (token().type() != wxPluralFormsToken::T_SEMICOLON
)
579 if (token().type() != wxPluralFormsToken::T_EOF
)
581 rCalculator
.init(nplurals
, plural
);
585 wxPluralFormsNode
* wxPluralFormsParser::parsePlural()
587 wxPluralFormsNode
* p
= expression();
592 wxPluralFormsNodePtr
n(p
);
593 if (token().type() != wxPluralFormsToken::T_SEMICOLON
)
600 const wxPluralFormsToken
& wxPluralFormsParser::token() const
602 return m_scanner
.token();
605 bool wxPluralFormsParser::nextToken()
607 if (!m_scanner
.nextToken())
612 wxPluralFormsNode
* wxPluralFormsParser::expression()
614 wxPluralFormsNode
* p
= logicalOrExpression();
617 wxPluralFormsNodePtr
n(p
);
618 if (token().type() == wxPluralFormsToken::T_QUESTION
)
620 wxPluralFormsNodePtr
qn(new wxPluralFormsNode(token()));
631 if (token().type() != wxPluralFormsToken::T_COLON
)
645 qn
->setNode(0, n
.release());
651 wxPluralFormsNode
*wxPluralFormsParser::logicalOrExpression()
653 wxPluralFormsNode
* p
= logicalAndExpression();
656 wxPluralFormsNodePtr
ln(p
);
657 if (token().type() == wxPluralFormsToken::T_LOGICAL_OR
)
659 wxPluralFormsNodePtr
un(new wxPluralFormsNode(token()));
664 p
= logicalOrExpression();
669 wxPluralFormsNodePtr
rn(p
); // right
670 if (rn
->token().type() == wxPluralFormsToken::T_LOGICAL_OR
)
672 // see logicalAndExpression comment
673 un
->setNode(0, ln
.release());
674 un
->setNode(1, rn
->releaseNode(0));
675 rn
->setNode(0, un
.release());
680 un
->setNode(0, ln
.release());
681 un
->setNode(1, rn
.release());
687 wxPluralFormsNode
* wxPluralFormsParser::logicalAndExpression()
689 wxPluralFormsNode
* p
= equalityExpression();
692 wxPluralFormsNodePtr
ln(p
); // left
693 if (token().type() == wxPluralFormsToken::T_LOGICAL_AND
)
695 wxPluralFormsNodePtr
un(new wxPluralFormsNode(token())); // up
700 p
= logicalAndExpression();
705 wxPluralFormsNodePtr
rn(p
); // right
706 if (rn
->token().type() == wxPluralFormsToken::T_LOGICAL_AND
)
708 // transform 1 && (2 && 3) -> (1 && 2) && 3
712 un
->setNode(0, ln
.release());
713 un
->setNode(1, rn
->releaseNode(0));
714 rn
->setNode(0, un
.release());
718 un
->setNode(0, ln
.release());
719 un
->setNode(1, rn
.release());
725 wxPluralFormsNode
* wxPluralFormsParser::equalityExpression()
727 wxPluralFormsNode
* p
= relationalExpression();
730 wxPluralFormsNodePtr
n(p
);
731 if (token().type() == wxPluralFormsToken::T_EQUAL
732 || token().type() == wxPluralFormsToken::T_NOT_EQUAL
)
734 wxPluralFormsNodePtr
qn(new wxPluralFormsNode(token()));
739 p
= relationalExpression();
745 qn
->setNode(0, n
.release());
751 wxPluralFormsNode
* wxPluralFormsParser::relationalExpression()
753 wxPluralFormsNode
* p
= multiplicativeExpression();
756 wxPluralFormsNodePtr
n(p
);
757 if (token().type() == wxPluralFormsToken::T_GREATER
758 || token().type() == wxPluralFormsToken::T_LESS
759 || token().type() == wxPluralFormsToken::T_GREATER_OR_EQUAL
760 || token().type() == wxPluralFormsToken::T_LESS_OR_EQUAL
)
762 wxPluralFormsNodePtr
qn(new wxPluralFormsNode(token()));
767 p
= multiplicativeExpression();
773 qn
->setNode(0, n
.release());
779 wxPluralFormsNode
* wxPluralFormsParser::multiplicativeExpression()
781 wxPluralFormsNode
* p
= pmExpression();
784 wxPluralFormsNodePtr
n(p
);
785 if (token().type() == wxPluralFormsToken::T_REMINDER
)
787 wxPluralFormsNodePtr
qn(new wxPluralFormsNode(token()));
798 qn
->setNode(0, n
.release());
804 wxPluralFormsNode
* wxPluralFormsParser::pmExpression()
806 wxPluralFormsNodePtr n
;
807 if (token().type() == wxPluralFormsToken::T_N
808 || token().type() == wxPluralFormsToken::T_NUMBER
)
810 n
.reset(new wxPluralFormsNode(token()));
816 else if (token().type() == wxPluralFormsToken::T_LEFT_BRACKET
) {
821 wxPluralFormsNode
* p
= expression();
827 if (token().type() != wxPluralFormsToken::T_RIGHT_BRACKET
)
843 wxPluralFormsCalculator
* wxPluralFormsCalculator::make(const char* s
)
845 wxPluralFormsCalculatorPtr
calculator(new wxPluralFormsCalculator
);
848 wxPluralFormsScanner
scanner(s
);
849 wxPluralFormsParser
p(scanner
);
850 if (!p
.parse(*calculator
))
855 return calculator
.release();
861 // ----------------------------------------------------------------------------
862 // wxMsgCatalogFile corresponds to one disk-file message catalog.
864 // This is a "low-level" class and is used only by wxMsgCatalog
865 // ----------------------------------------------------------------------------
867 WX_DECLARE_EXPORTED_STRING_HASH_MAP(wxString
, wxMessagesHash
);
869 class wxMsgCatalogFile
876 // load the catalog from disk (szDirPrefix corresponds to language)
877 bool Load(const wxString
& szDirPrefix
, const wxString
& szName
,
878 wxPluralFormsCalculatorPtr
& rPluralFormsCalculator
);
880 // fills the hash with string-translation pairs
881 void FillHash(wxMessagesHash
& hash
,
882 const wxString
& msgIdCharset
,
883 bool convertEncoding
) const;
885 // return the charset of the strings in this catalog or empty string if
887 wxString
GetCharset() const { return m_charset
; }
890 // this implementation is binary compatible with GNU gettext() version 0.10
892 // an entry in the string table
893 struct wxMsgTableEntry
895 size_t32 nLen
; // length of the string
896 size_t32 ofsString
; // pointer to the string
899 // header of a .mo file
900 struct wxMsgCatalogHeader
902 size_t32 magic
, // offset +00: magic id
903 revision
, // +04: revision
904 numStrings
; // +08: number of strings in the file
905 size_t32 ofsOrigTable
, // +0C: start of original string table
906 ofsTransTable
; // +10: start of translated string table
907 size_t32 nHashSize
, // +14: hash table size
908 ofsHashTable
; // +18: offset of hash table start
911 // all data is stored here
912 wxMemoryBuffer m_data
;
915 size_t32 m_numStrings
; // number of strings in this domain
916 wxMsgTableEntry
*m_pOrigTable
, // pointer to original strings
917 *m_pTransTable
; // translated
919 wxString m_charset
; // from the message catalog header
922 // swap the 2 halves of 32 bit integer if needed
923 size_t32
Swap(size_t32 ui
) const
925 return m_bSwapped
? (ui
<< 24) | ((ui
& 0xff00) << 8) |
926 ((ui
>> 8) & 0xff00) | (ui
>> 24)
930 // just return the pointer to the start of the data as "char *" to
931 // facilitate doing pointer arithmetic with it
932 char *StringData() const
934 return wx_static_cast(char *, m_data
.GetData());
937 const char *StringAtOfs(wxMsgTableEntry
*pTable
, size_t32 n
) const
939 const wxMsgTableEntry
* const ent
= pTable
+ n
;
941 // this check could fail for a corrupt message catalog
942 size_t32 ofsString
= Swap(ent
->ofsString
);
943 if ( ofsString
+ Swap(ent
->nLen
) > m_data
.GetDataLen())
948 return StringData() + ofsString
;
951 bool m_bSwapped
; // wrong endianness?
953 DECLARE_NO_COPY_CLASS(wxMsgCatalogFile
)
957 // ----------------------------------------------------------------------------
958 // wxMsgCatalog corresponds to one loaded message catalog.
960 // This is a "low-level" class and is used only by wxLocale (that's why
961 // it's designed to be stored in a linked list)
962 // ----------------------------------------------------------------------------
967 wxMsgCatalog() { m_conv
= NULL
; }
970 // load the catalog from disk (szDirPrefix corresponds to language)
971 bool Load(const wxString
& dirPrefix
, const wxString
& name
,
972 const wxString
& msgIdCharset
, bool bConvertEncoding
= false);
974 // get name of the catalog
975 wxString
GetName() const { return m_name
; }
977 // get the translated string: returns NULL if not found
978 const wxString
*GetString(const wxString
& sz
, size_t n
= size_t(-1)) const;
980 // public variable pointing to the next element in a linked list (or NULL)
981 wxMsgCatalog
*m_pNext
;
984 wxMessagesHash m_messages
; // all messages in the catalog
985 wxString m_name
; // name of the domain
987 // the conversion corresponding to this catalog charset if we installed it
991 wxPluralFormsCalculatorPtr m_pluralFormsCalculator
;
994 // ----------------------------------------------------------------------------
996 // ----------------------------------------------------------------------------
998 // the list of the directories to search for message catalog files
999 static wxArrayString gs_searchPrefixes
;
1001 // ============================================================================
1003 // ============================================================================
1005 // ----------------------------------------------------------------------------
1006 // wxMsgCatalogFile class
1007 // ----------------------------------------------------------------------------
1009 wxMsgCatalogFile::wxMsgCatalogFile()
1013 wxMsgCatalogFile::~wxMsgCatalogFile()
1017 // return the directories to search for message catalogs under the given
1018 // prefix, separated by wxPATH_SEP
1020 wxString
GetMsgCatalogSubdirs(const wxString
& prefix
, const wxString
& lang
)
1022 // Search first in Unix-standard prefix/lang/LC_MESSAGES, then in
1023 // prefix/lang and finally in just prefix.
1025 // Note that we use LC_MESSAGES on all platforms and not just Unix, because
1026 // it doesn't cost much to look into one more directory and doing it this
1027 // way has two important benefits:
1028 // a) we don't break compatibility with wx-2.6 and older by stopping to
1029 // look in a directory where the catalogs used to be and thus silently
1030 // breaking apps after they are recompiled against the latest wx
1031 // b) it makes it possible to package app's support files in the same
1032 // way on all target platforms
1033 wxString pathPrefix
;
1034 pathPrefix
<< prefix
<< wxFILE_SEP_PATH
<< lang
;
1036 wxString searchPath
;
1037 searchPath
.reserve(4*pathPrefix
.length());
1038 searchPath
<< pathPrefix
<< wxFILE_SEP_PATH
<< "LC_MESSAGES" << wxPATH_SEP
1039 << prefix
<< wxFILE_SEP_PATH
<< wxPATH_SEP
1045 // construct the search path for the given language
1046 static wxString
GetFullSearchPath(const wxString
& lang
)
1048 // first take the entries explicitly added by the program
1049 wxArrayString paths
;
1050 paths
.reserve(gs_searchPrefixes
.size() + 1);
1052 count
= gs_searchPrefixes
.size();
1053 for ( n
= 0; n
< count
; n
++ )
1055 paths
.Add(GetMsgCatalogSubdirs(gs_searchPrefixes
[n
], lang
));
1060 // then look in the standard location
1061 const wxString stdp
= wxStandardPaths::Get().
1062 GetLocalizedResourcesDir(lang
, wxStandardPaths::ResourceCat_Messages
);
1064 if ( paths
.Index(stdp
) == wxNOT_FOUND
)
1066 #endif // wxUSE_STDPATHS
1068 // last look in default locations
1070 // LC_PATH is a standard env var containing the search path for the .mo
1072 const wxChar
*pszLcPath
= wxGetenv(wxT("LC_PATH"));
1075 const wxString lcp
= GetMsgCatalogSubdirs(pszLcPath
, lang
);
1076 if ( paths
.Index(lcp
) == wxNOT_FOUND
)
1080 // also add the one from where wxWin was installed:
1081 wxString wxp
= wxGetInstallPrefix();
1084 wxp
= GetMsgCatalogSubdirs(wxp
+ _T("/share/locale"), lang
);
1085 if ( paths
.Index(wxp
) == wxNOT_FOUND
)
1091 // finally construct the full search path
1092 wxString searchPath
;
1093 searchPath
.reserve(500);
1094 count
= paths
.size();
1095 for ( n
= 0; n
< count
; n
++ )
1097 searchPath
+= paths
[n
];
1098 if ( n
!= count
- 1 )
1099 searchPath
+= wxPATH_SEP
;
1105 // open disk file and read in it's contents
1106 bool wxMsgCatalogFile::Load(const wxString
& szDirPrefix
, const wxString
& szName
,
1107 wxPluralFormsCalculatorPtr
& rPluralFormsCalculator
)
1109 wxString searchPath
;
1112 // first look for the catalog for this language and the current locale:
1113 // notice that we don't use the system name for the locale as this would
1114 // force us to install catalogs in different locations depending on the
1115 // system but always use the canonical name
1116 wxFontEncoding encSys
= wxLocale::GetSystemEncoding();
1117 if ( encSys
!= wxFONTENCODING_SYSTEM
)
1119 wxString
fullname(szDirPrefix
);
1120 fullname
<< _T('.') << wxFontMapperBase::GetEncodingName(encSys
);
1121 searchPath
<< GetFullSearchPath(fullname
) << wxPATH_SEP
;
1123 #endif // wxUSE_FONTMAP
1126 searchPath
+= GetFullSearchPath(szDirPrefix
);
1127 size_t sublocaleIndex
= szDirPrefix
.find(wxT('_'));
1128 if ( sublocaleIndex
!= wxString::npos
)
1130 // also add just base locale name: for things like "fr_BE" (belgium
1131 // french) we should use "fr" if no belgium specific message catalogs
1133 searchPath
<< wxPATH_SEP
1134 << GetFullSearchPath(szDirPrefix
.Left(sublocaleIndex
));
1137 // don't give translation errors here because the wxstd catalog might
1138 // not yet be loaded (and it's normal)
1140 // (we're using an object because we have several return paths)
1142 NoTransErr noTransErr
;
1143 wxLogVerbose(_("looking for catalog '%s' in path '%s'."),
1144 szName
, searchPath
.c_str());
1145 wxLogTrace(TRACE_I18N
, _T("Looking for \"%s.mo\" in \"%s\""),
1146 szName
, searchPath
.c_str());
1148 wxFileName
fn(szName
);
1149 fn
.SetExt(_T("mo"));
1151 wxString strFullName
;
1152 #if wxUSE_FILESYSTEM
1153 wxFileSystem fileSys
;
1154 if ( !fileSys
.FindFileInPath(&strFullName
, searchPath
, fn
.GetFullPath()) )
1155 #else // !wxUSE_FILESYSTEM
1156 if ( !wxFindFileInPath(&strFullName
, searchPath
, fn
.GetFullPath()) )
1157 #endif // wxUSE_FILESYSTEM/!wxUSE_FILESYSTEM
1159 wxLogVerbose(_("catalog file for domain '%s' not found."), szName
);
1160 wxLogTrace(TRACE_I18N
, _T("Catalog \"%s.mo\" not found"), szName
);
1164 // open file and read its data
1165 wxLogVerbose(_("using catalog '%s' from '%s'."), szName
, strFullName
.c_str());
1166 wxLogTrace(TRACE_I18N
, _T("Using catalog \"%s\"."), strFullName
.c_str());
1168 #if wxUSE_FILESYSTEM
1169 wxFSFile
* const fileMsg
= fileSys
.OpenFile(strFullName
);
1173 wxInputStream
*fileStream
= fileMsg
->GetStream();
1174 m_data
.SetDataLen(0);
1176 static const size_t chunkSize
= 4096;
1177 while ( !fileStream
->Eof() ) {
1178 fileStream
->Read(m_data
.GetAppendBuf(chunkSize
), chunkSize
);
1179 m_data
.UngetAppendBuf(fileStream
->LastRead());
1183 #else // !wxUSE_FILESYSTEM
1184 wxFile
fileMsg(strFullName
);
1185 if ( !fileMsg
.IsOpened() )
1188 // get the file size (assume it is less than 4Gb...)
1189 wxFileOffset lenFile
= fileMsg
.Length();
1190 if ( lenFile
== wxInvalidOffset
)
1193 size_t nSize
= wx_truncate_cast(size_t, lenFile
);
1194 wxASSERT_MSG( nSize
== lenFile
+ size_t(0), _T("message catalog bigger than 4GB?") );
1196 // read the whole file in memory
1197 if ( fileMsg
.Read(m_data
.GetWriteBuf(nSize
), nSize
) != lenFile
)
1199 #endif // wxUSE_FILESYSTEM/!wxUSE_FILESYSTEM
1203 bool bValid
= m_data
.GetDataLen() > sizeof(wxMsgCatalogHeader
);
1205 const wxMsgCatalogHeader
*pHeader
= (wxMsgCatalogHeader
*)m_data
.GetData();
1207 // we'll have to swap all the integers if it's true
1208 m_bSwapped
= pHeader
->magic
== MSGCATALOG_MAGIC_SW
;
1210 // check the magic number
1211 bValid
= m_bSwapped
|| pHeader
->magic
== MSGCATALOG_MAGIC
;
1215 // it's either too short or has incorrect magic number
1216 wxLogWarning(_("'%s' is not a valid message catalog."), strFullName
.c_str());
1222 m_numStrings
= Swap(pHeader
->numStrings
);
1223 m_pOrigTable
= (wxMsgTableEntry
*)(StringData() +
1224 Swap(pHeader
->ofsOrigTable
));
1225 m_pTransTable
= (wxMsgTableEntry
*)(StringData() +
1226 Swap(pHeader
->ofsTransTable
));
1228 // now parse catalog's header and try to extract catalog charset and
1229 // plural forms formula from it:
1231 const char* headerData
= StringAtOfs(m_pOrigTable
, 0);
1232 if (headerData
&& headerData
[0] == 0)
1234 // Extract the charset:
1235 wxString header
= wxString::FromAscii(StringAtOfs(m_pTransTable
, 0));
1236 int begin
= header
.Find(wxT("Content-Type: text/plain; charset="));
1237 if (begin
!= wxNOT_FOUND
)
1239 begin
+= 34; //strlen("Content-Type: text/plain; charset=")
1240 size_t end
= header
.find('\n', begin
);
1241 if (end
!= size_t(-1))
1243 m_charset
.assign(header
, begin
, end
- begin
);
1244 if (m_charset
== wxT("CHARSET"))
1246 // "CHARSET" is not valid charset, but lazy translator
1251 // else: incorrectly filled Content-Type header
1253 // Extract plural forms:
1254 begin
= header
.Find(wxT("Plural-Forms:"));
1255 if (begin
!= wxNOT_FOUND
)
1258 size_t end
= header
.find('\n', begin
);
1259 if (end
!= size_t(-1))
1261 wxString
pfs(header
, begin
, end
- begin
);
1262 wxPluralFormsCalculator
* pCalculator
= wxPluralFormsCalculator
1263 ::make(pfs
.ToAscii());
1264 if (pCalculator
!= 0)
1266 rPluralFormsCalculator
.reset(pCalculator
);
1270 wxLogVerbose(_("Cannot parse Plural-Forms:'%s'"), pfs
.c_str());
1274 if (rPluralFormsCalculator
.get() == NULL
)
1276 rPluralFormsCalculator
.reset(wxPluralFormsCalculator::make());
1280 // everything is fine
1284 void wxMsgCatalogFile::FillHash(wxMessagesHash
& hash
,
1285 const wxString
& msgIdCharset
,
1286 bool convertEncoding
) const
1289 // this parameter doesn't make sense, we always must convert encoding in
1291 convertEncoding
= true;
1293 if ( convertEncoding
)
1295 // determine if we need any conversion at all
1296 wxFontEncoding encCat
= wxFontMapperBase::GetEncodingFromName(m_charset
);
1297 if ( encCat
== wxLocale::GetSystemEncoding() )
1299 // no need to convert
1300 convertEncoding
= false;
1303 #endif // wxUSE_UNICODE/wxUSE_FONTMAP
1306 // conversion to use to convert catalog strings to the GUI encoding
1307 wxMBConv
*inputConv
,
1308 *inputConvPtr
= NULL
; // same as inputConv but safely deleteable
1309 if ( convertEncoding
&& !m_charset
.empty() )
1312 inputConv
= new wxCSConv(m_charset
);
1314 else // no need or not possible to convert the encoding
1317 // we must somehow convert the narrow strings in the message catalog to
1318 // wide strings, so use the default conversion if we have no charset
1319 inputConv
= wxConvCurrent
;
1320 #else // !wxUSE_UNICODE
1322 #endif // wxUSE_UNICODE/!wxUSE_UNICODE
1325 // conversion to apply to msgid strings before looking them up: we only
1326 // need it if the msgids are neither in 7 bit ASCII nor in the same
1327 // encoding as the catalog
1328 wxCSConv
*sourceConv
= msgIdCharset
.empty() || (msgIdCharset
== m_charset
)
1330 : new wxCSConv(msgIdCharset
);
1333 wxASSERT_MSG( msgIdCharset
.empty(),
1334 _T("non-ASCII msgid languages only supported if wxUSE_WCHAR_T=1") );
1336 wxEncodingConverter converter
;
1337 if ( convertEncoding
)
1339 wxFontEncoding targetEnc
= wxFONTENCODING_SYSTEM
;
1340 wxFontEncoding enc
= wxFontMapperBase::Get()->CharsetToEncoding(m_charset
, false);
1341 if ( enc
== wxFONTENCODING_SYSTEM
)
1343 convertEncoding
= false; // unknown encoding
1347 targetEnc
= wxLocale::GetSystemEncoding();
1348 if (targetEnc
== wxFONTENCODING_SYSTEM
)
1350 wxFontEncodingArray a
= wxEncodingConverter::GetPlatformEquivalents(enc
);
1352 // no conversion needed, locale uses native encoding
1353 convertEncoding
= false;
1354 if (a
.GetCount() == 0)
1355 // we don't know common equiv. under this platform
1356 convertEncoding
= false;
1361 if ( convertEncoding
)
1363 converter
.Init(enc
, targetEnc
);
1366 #endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T
1367 (void)convertEncoding
; // get rid of warnings about unused parameter
1369 for (size_t32 i
= 0; i
< m_numStrings
; i
++)
1371 const char *data
= StringAtOfs(m_pOrigTable
, i
);
1375 msgid
= wxString(data
, *inputConv
);
1378 if ( inputConv
&& sourceConv
)
1379 msgid
= wxString(inputConv
->cMB2WC(data
), *sourceConv
);
1383 #endif // wxUSE_UNICODE
1385 data
= StringAtOfs(m_pTransTable
, i
);
1386 size_t length
= Swap(m_pTransTable
[i
].nLen
);
1389 while (offset
< length
)
1391 const char * const str
= data
+ offset
;
1395 msgstr
= wxString(str
, *inputConv
);
1398 msgstr
= wxString(inputConv
->cMB2WC(str
), *wxConvUI
);
1401 #else // !wxUSE_WCHAR_T
1403 if ( bConvertEncoding
)
1404 msgstr
= wxString(converter
.Convert(str
));
1408 #endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T
1410 if ( !msgstr
.empty() )
1412 hash
[index
== 0 ? msgid
: msgid
+ wxChar(index
)] = msgstr
;
1416 offset
+= strlen(str
) + 1;
1423 delete inputConvPtr
;
1424 #endif // wxUSE_WCHAR_T
1428 // ----------------------------------------------------------------------------
1429 // wxMsgCatalog class
1430 // ----------------------------------------------------------------------------
1432 wxMsgCatalog::~wxMsgCatalog()
1436 if ( wxConvUI
== m_conv
)
1438 // we only change wxConvUI if it points to wxConvLocal so we reset
1439 // it back to it too
1440 wxConvUI
= &wxConvLocal
;
1447 bool wxMsgCatalog::Load(const wxString
& dirPrefix
, const wxString
& name
,
1448 const wxString
& msgIdCharset
, bool bConvertEncoding
)
1450 wxMsgCatalogFile file
;
1454 if ( !file
.Load(dirPrefix
, name
, m_pluralFormsCalculator
) )
1457 file
.FillHash(m_messages
, msgIdCharset
, bConvertEncoding
);
1459 // we should use a conversion compatible with the message catalog encoding
1460 // in the GUI if we don't convert the strings to the current conversion but
1461 // as the encoding is global, only change it once, otherwise we could get
1462 // into trouble if we use several message catalogs with different encodings
1464 // this is, of course, a hack but it at least allows the program to use
1465 // message catalogs in any encodings without asking the user to change his
1467 if ( !bConvertEncoding
&&
1468 !file
.GetCharset().empty() &&
1469 wxConvUI
== &wxConvLocal
)
1472 m_conv
= new wxCSConv(file
.GetCharset());
1478 const wxString
*wxMsgCatalog::GetString(const wxString
& str
, size_t n
) const
1481 if (n
!= size_t(-1))
1483 index
= m_pluralFormsCalculator
->evaluate(n
);
1485 wxMessagesHash::const_iterator i
;
1488 i
= m_messages
.find(wxString(str
) + wxChar(index
)); // plural
1492 i
= m_messages
.find(str
);
1495 if ( i
!= m_messages
.end() )
1503 // ----------------------------------------------------------------------------
1505 // ----------------------------------------------------------------------------
1507 #include "wx/arrimpl.cpp"
1508 WX_DECLARE_EXPORTED_OBJARRAY(wxLanguageInfo
, wxLanguageInfoArray
);
1509 WX_DEFINE_OBJARRAY(wxLanguageInfoArray
)
1511 wxLanguageInfoArray
*wxLocale::ms_languagesDB
= NULL
;
1513 /*static*/ void wxLocale::CreateLanguagesDB()
1515 if (ms_languagesDB
== NULL
)
1517 ms_languagesDB
= new wxLanguageInfoArray
;
1522 /*static*/ void wxLocale::DestroyLanguagesDB()
1524 delete ms_languagesDB
;
1525 ms_languagesDB
= NULL
;
1529 void wxLocale::DoCommonInit()
1531 m_pszOldLocale
= NULL
;
1533 m_pOldLocale
= wxSetLocale(this);
1536 m_language
= wxLANGUAGE_UNKNOWN
;
1537 m_initialized
= false;
1540 // NB: this function has (desired) side effect of changing current locale
1541 bool wxLocale::Init(const wxString
& name
,
1542 const wxString
& shortName
,
1543 const wxString
& locale
,
1545 bool bConvertEncoding
)
1547 wxASSERT_MSG( !m_initialized
,
1548 _T("you can't call wxLocale::Init more than once") );
1550 m_initialized
= true;
1552 m_strShort
= shortName
;
1553 m_bConvertEncoding
= bConvertEncoding
;
1554 m_language
= wxLANGUAGE_UNKNOWN
;
1556 // change current locale (default: same as long name)
1557 wxString
szLocale(locale
);
1558 if ( szLocale
.empty() )
1560 // the argument to setlocale()
1561 szLocale
= shortName
;
1563 wxCHECK_MSG( !szLocale
.empty(), false,
1564 _T("no locale to set in wxLocale::Init()") );
1568 // FIXME: I'm guessing here
1569 wxChar localeName
[256];
1570 int ret
= GetLocaleInfo(LOCALE_USER_DEFAULT
, LOCALE_SLANGUAGE
, localeName
,
1574 m_pszOldLocale
= wxStrdup(wxConvLibc
.cWC2MB(localeName
));
1577 m_pszOldLocale
= NULL
;
1579 // TODO: how to find languageId
1580 // SetLocaleInfo(languageId, SORT_DEFAULT, localeName);
1582 const char *oldLocale
= wxSetlocale(LC_ALL
, szLocale
);
1584 m_pszOldLocale
= wxStrdup(oldLocale
);
1586 m_pszOldLocale
= NULL
;
1589 if ( m_pszOldLocale
== NULL
)
1590 wxLogError(_("locale '%s' can not be set."), szLocale
);
1592 // the short name will be used to look for catalog files as well,
1593 // so we need something here
1594 if ( m_strShort
.empty() ) {
1595 // FIXME I don't know how these 2 letter abbreviations are formed,
1596 // this wild guess is surely wrong
1597 if ( !szLocale
.empty() )
1599 m_strShort
+= (wxChar
)wxTolower(szLocale
[0]);
1600 if ( szLocale
.length() > 1 )
1601 m_strShort
+= (wxChar
)wxTolower(szLocale
[1]);
1605 // load the default catalog with wxWidgets standard messages
1610 bOk
= AddCatalog(wxT("wxstd"));
1612 // there may be a catalog with toolkit specific overrides, it is not
1613 // an error if this does not exist
1616 wxString
port(wxPlatformInfo::Get().GetPortIdName());
1617 if ( !port
.empty() )
1619 AddCatalog(port
.BeforeFirst(wxT('/')).MakeLower());
1628 #if defined(__UNIX__) && wxUSE_UNICODE && !defined(__WXMAC__)
1629 static const char *wxSetlocaleTryUTF8(int c
, const wxString
& lc
)
1631 const char *l
= NULL
;
1633 // NB: We prefer to set UTF-8 locale if it's possible and only fall back to
1634 // non-UTF-8 locale if it fails
1640 buf2
= buf
+ wxT(".UTF-8");
1641 l
= wxSetlocale(c
, buf2
);
1644 buf2
= buf
+ wxT(".utf-8");
1645 l
= wxSetlocale(c
, buf2
);
1649 buf2
= buf
+ wxT(".UTF8");
1650 l
= wxSetlocale(c
, buf2
);
1654 buf2
= buf
+ wxT(".utf8");
1655 l
= wxSetlocale(c
, buf2
);
1659 // if we can't set UTF-8 locale, try non-UTF-8 one:
1661 l
= wxSetlocale(c
, lc
);
1666 #define wxSetlocaleTryUTF8(c, lc) wxSetlocale(c, lc)
1669 bool wxLocale::Init(int language
, int flags
)
1673 int lang
= language
;
1674 if (lang
== wxLANGUAGE_DEFAULT
)
1676 // auto detect the language
1677 lang
= GetSystemLanguage();
1680 // We failed to detect system language, so we will use English:
1681 if (lang
== wxLANGUAGE_UNKNOWN
)
1686 const wxLanguageInfo
*info
= GetLanguageInfo(lang
);
1688 // Unknown language:
1691 wxLogError(wxT("Unknown language %i."), lang
);
1695 wxString name
= info
->Description
;
1696 wxString canonical
= info
->CanonicalName
;
1700 #if defined(__OS2__)
1701 const char *retloc
= wxSetlocale(LC_ALL
, wxEmptyString
);
1702 #elif defined(__UNIX__) && !defined(__WXMAC__)
1703 if (language
!= wxLANGUAGE_DEFAULT
)
1704 locale
= info
->CanonicalName
;
1706 const char *retloc
= wxSetlocaleTryUTF8(LC_ALL
, locale
);
1708 const wxString langOnly
= locale
.Left(2);
1711 // Some C libraries don't like xx_YY form and require xx only
1712 retloc
= wxSetlocaleTryUTF8(LC_ALL
, langOnly
);
1716 // some systems (e.g. FreeBSD and HP-UX) don't have xx_YY aliases but
1717 // require the full xx_YY.encoding form, so try using UTF-8 because this is
1718 // the only thing we can do generically
1720 // TODO: add encodings applicable to each language to the lang DB and try
1721 // them all in turn here
1724 const wxChar
**names
=
1725 wxFontMapperBase::GetAllEncodingNames(wxFONTENCODING_UTF8
);
1728 retloc
= wxSetlocale(LC_ALL
, locale
+ _T('.') + *names
++);
1733 #endif // wxUSE_FONTMAP
1737 // Some C libraries (namely glibc) still use old ISO 639,
1738 // so will translate the abbrev for them
1740 if ( langOnly
== wxT("he") )
1741 localeAlt
= wxT("iw") + locale
.Mid(3);
1742 else if ( langOnly
== wxT("id") )
1743 localeAlt
= wxT("in") + locale
.Mid(3);
1744 else if ( langOnly
== wxT("yi") )
1745 localeAlt
= wxT("ji") + locale
.Mid(3);
1746 else if ( langOnly
== wxT("nb") )
1747 localeAlt
= wxT("no_NO");
1748 else if ( langOnly
== wxT("nn") )
1749 localeAlt
= wxT("no_NY");
1751 if ( !localeAlt
.empty() )
1753 retloc
= wxSetlocaleTryUTF8(LC_ALL
, localeAlt
);
1755 retloc
= wxSetlocaleTryUTF8(LC_ALL
, localeAlt
.Left(2));
1763 // at least in AIX 5.2 libc is buggy and the string returned from
1764 // setlocale(LC_ALL) can't be passed back to it because it returns 6
1765 // strings (one for each locale category), i.e. for C locale we get back
1768 // this contradicts IBM own docs but this is not of much help, so just work
1769 // around it in the crudest possible manner
1770 char* p
= const_cast<char*>(wxStrchr(retloc
, ' '));
1775 #elif defined(__WIN32__)
1777 #if wxUSE_UNICODE && (defined(__VISUALC__) || defined(__MINGW32__))
1778 // NB: setlocale() from msvcrt.dll (used by VC++ and Mingw)
1779 // can't set locale to language that can only be written using
1780 // Unicode. Therefore wxSetlocale call failed, but we don't want
1781 // to report it as an error -- so that at least message catalogs
1782 // can be used. Watch for code marked with
1783 // #ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS bellow.
1784 #define SETLOCALE_FAILS_ON_UNICODE_LANGS
1787 const char *retloc
= "C";
1788 if (language
!= wxLANGUAGE_DEFAULT
)
1790 if (info
->WinLang
== 0)
1792 wxLogWarning(wxT("Locale '%s' not supported by OS."), name
.c_str());
1793 // retloc already set to "C"
1798 #ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS
1802 wxUint32 lcid
= MAKELCID(MAKELANGID(info
->WinLang
, info
->WinSublang
),
1806 SetThreadLocale(lcid
);
1808 // NB: we must translate LCID to CRT's setlocale string ourselves,
1809 // because SetThreadLocale does not modify change the
1810 // interpretation of setlocale(LC_ALL, "") call:
1812 buffer
[0] = wxT('\0');
1813 GetLocaleInfo(lcid
, LOCALE_SENGLANGUAGE
, buffer
, 256);
1815 if (GetLocaleInfo(lcid
, LOCALE_SENGCOUNTRY
, buffer
, 256) > 0)
1816 locale
<< wxT("_") << buffer
;
1817 if (GetLocaleInfo(lcid
, LOCALE_IDEFAULTANSICODEPAGE
, buffer
, 256) > 0)
1819 codepage
= wxAtoi(buffer
);
1821 locale
<< wxT(".") << buffer
;
1825 wxLogLastError(wxT("SetThreadLocale"));
1832 retloc
= wxSetlocale(LC_ALL
, locale
);
1834 #ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS
1835 if (codepage
== 0 && retloc
== NULL
)
1847 retloc
= wxSetlocale(LC_ALL
, wxEmptyString
);
1851 #ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS
1855 if (GetLocaleInfo(LOCALE_USER_DEFAULT
,
1856 LOCALE_IDEFAULTANSICODEPAGE
, buffer
, 16) > 0 &&
1857 wxStrcmp(buffer
, wxT("0")) == 0)
1867 #elif defined(__WXMAC__)
1868 if (lang
== wxLANGUAGE_DEFAULT
)
1869 locale
= wxEmptyString
;
1871 locale
= info
->CanonicalName
;
1873 const char *retloc
= wxSetlocale(LC_ALL
, locale
);
1877 // Some C libraries don't like xx_YY form and require xx only
1878 retloc
= wxSetlocale(LC_ALL
, locale
.Mid(0,2));
1883 #define WX_NO_LOCALE_SUPPORT
1886 #ifndef WX_NO_LOCALE_SUPPORT
1889 wxLogWarning(_("Cannot set locale to language \"%s\"."), name
.c_str());
1891 // continue nevertheless and try to load at least the translations for
1895 if ( !Init(name
, canonical
, retloc
,
1896 (flags
& wxLOCALE_LOAD_DEFAULT
) != 0,
1897 (flags
& wxLOCALE_CONV_ENCODING
) != 0) )
1902 if (IsOk()) // setlocale() succeeded
1906 #endif // !WX_NO_LOCALE_SUPPORT
1911 void wxLocale::AddCatalogLookupPathPrefix(const wxString
& prefix
)
1913 if ( gs_searchPrefixes
.Index(prefix
) == wxNOT_FOUND
)
1915 gs_searchPrefixes
.Add(prefix
);
1917 //else: already have it
1920 /*static*/ int wxLocale::GetSystemLanguage()
1922 CreateLanguagesDB();
1924 // init i to avoid compiler warning
1926 count
= ms_languagesDB
->GetCount();
1928 #if defined(__UNIX__) && !defined(__WXMAC__)
1929 // first get the string identifying the language from the environment
1931 if (!wxGetEnv(wxT("LC_ALL"), &langFull
) &&
1932 !wxGetEnv(wxT("LC_MESSAGES"), &langFull
) &&
1933 !wxGetEnv(wxT("LANG"), &langFull
))
1935 // no language specified, treat it as English
1936 return wxLANGUAGE_ENGLISH_US
;
1939 if ( langFull
== _T("C") || langFull
== _T("POSIX") )
1941 // default C locale is English too
1942 return wxLANGUAGE_ENGLISH_US
;
1945 // the language string has the following form
1947 // lang[_LANG][.encoding][@modifier]
1949 // (see environ(5) in the Open Unix specification)
1951 // where lang is the primary language, LANG is a sublang/territory,
1952 // encoding is the charset to use and modifier "allows the user to select
1953 // a specific instance of localization data within a single category"
1955 // for example, the following strings are valid:
1960 // de_DE.iso88591@euro
1962 // for now we don't use the encoding, although we probably should (doing
1963 // translations of the msg catalogs on the fly as required) (TODO)
1965 // we don't use the modifiers neither but we probably should translate
1966 // "euro" into iso885915
1967 size_t posEndLang
= langFull
.find_first_of(_T("@."));
1968 if ( posEndLang
!= wxString::npos
)
1970 langFull
.Truncate(posEndLang
);
1973 // in addition to the format above, we also can have full language names
1974 // in LANG env var - for example, SuSE is known to use LANG="german" - so
1977 // do we have just the language (or sublang too)?
1978 bool justLang
= langFull
.length() == LEN_LANG
;
1980 (langFull
.length() == LEN_FULL
&& langFull
[LEN_LANG
] == wxT('_')) )
1982 // 0. Make sure the lang is according to latest ISO 639
1983 // (this is necessary because glibc uses iw and in instead
1984 // of he and id respectively).
1986 // the language itself (second part is the dialect/sublang)
1987 wxString langOrig
= ExtractLang(langFull
);
1990 if ( langOrig
== wxT("iw"))
1992 else if (langOrig
== wxT("in"))
1994 else if (langOrig
== wxT("ji"))
1996 else if (langOrig
== wxT("no_NO"))
1997 lang
= wxT("nb_NO");
1998 else if (langOrig
== wxT("no_NY"))
1999 lang
= wxT("nn_NO");
2000 else if (langOrig
== wxT("no"))
2001 lang
= wxT("nb_NO");
2005 // did we change it?
2006 if ( lang
!= langOrig
)
2008 langFull
= lang
+ ExtractNotLang(langFull
);
2011 // 1. Try to find the language either as is:
2012 for ( i
= 0; i
< count
; i
++ )
2014 if ( ms_languagesDB
->Item(i
).CanonicalName
== langFull
)
2020 // 2. If langFull is of the form xx_YY, try to find xx:
2021 if ( i
== count
&& !justLang
)
2023 for ( i
= 0; i
< count
; i
++ )
2025 if ( ms_languagesDB
->Item(i
).CanonicalName
== lang
)
2032 // 3. If langFull is of the form xx, try to find any xx_YY record:
2033 if ( i
== count
&& justLang
)
2035 for ( i
= 0; i
< count
; i
++ )
2037 if ( ExtractLang(ms_languagesDB
->Item(i
).CanonicalName
)
2045 else // not standard format
2047 // try to find the name in verbose description
2048 for ( i
= 0; i
< count
; i
++ )
2050 if (ms_languagesDB
->Item(i
).Description
.CmpNoCase(langFull
) == 0)
2056 #elif defined(__WXMAC__)
2057 const wxChar
* lc
= NULL
;
2058 long lang
= GetScriptVariable( smSystemScript
, smScriptLang
) ;
2059 switch( GetScriptManagerVariable( smRegionCode
) ) {
2075 case verNetherlands
:
2130 // _CY is not part of wx, so we have to translate according to the system language
2131 if ( lang
== langGreek
) {
2134 else if ( lang
== langTurkish
) {
2141 case verYugoCroatian
:
2147 case verPakistanUrdu
:
2150 case verTurkishModified
:
2153 case verItalianSwiss
:
2156 case verInternational
:
2217 case verByeloRussian
:
2239 lc
= wxT("pt_BR ") ;
2247 case verScottishGaelic
:
2262 case verIrishGaelicScript
:
2277 case verSpLatinAmerica
:
2283 case verFrenchUniversal
:
2334 for ( i
= 0; i
< count
; i
++ )
2336 if ( ms_languagesDB
->Item(i
).CanonicalName
== lc
)
2342 #elif defined(__WIN32__)
2343 LCID lcid
= GetUserDefaultLCID();
2346 wxUint32 lang
= PRIMARYLANGID(LANGIDFROMLCID(lcid
));
2347 wxUint32 sublang
= SUBLANGID(LANGIDFROMLCID(lcid
));
2349 for ( i
= 0; i
< count
; i
++ )
2351 if (ms_languagesDB
->Item(i
).WinLang
== lang
&&
2352 ms_languagesDB
->Item(i
).WinSublang
== sublang
)
2358 //else: leave wxlang == wxLANGUAGE_UNKNOWN
2359 #endif // Unix/Win32
2363 // we did find a matching entry, use it
2364 return ms_languagesDB
->Item(i
).Language
;
2367 // no info about this language in the database
2368 return wxLANGUAGE_UNKNOWN
;
2371 // ----------------------------------------------------------------------------
2373 // ----------------------------------------------------------------------------
2375 // this is a bit strange as under Windows we get the encoding name using its
2376 // numeric value and under Unix we do it the other way round, but this just
2377 // reflects the way different systems provide the encoding info
2380 wxString
wxLocale::GetSystemEncodingName()
2384 #if defined(__WIN32__) && !defined(__WXMICROWIN__)
2385 // FIXME: what is the error return value for GetACP()?
2386 UINT codepage
= ::GetACP();
2387 encname
.Printf(_T("windows-%u"), codepage
);
2388 #elif defined(__WXMAC__)
2389 // default is just empty string, this resolves to the default system
2391 #elif defined(__UNIX_LIKE__)
2393 #if defined(HAVE_LANGINFO_H) && defined(CODESET)
2394 // GNU libc provides current character set this way (this conforms
2396 char *oldLocale
= strdup(setlocale(LC_CTYPE
, NULL
));
2397 setlocale(LC_CTYPE
, "");
2398 const char *alang
= nl_langinfo(CODESET
);
2399 setlocale(LC_CTYPE
, oldLocale
);
2404 encname
= wxString::FromAscii( alang
);
2406 else // nl_langinfo() failed
2407 #endif // HAVE_LANGINFO_H
2409 // if we can't get at the character set directly, try to see if it's in
2410 // the environment variables (in most cases this won't work, but I was
2412 char *lang
= getenv( "LC_ALL");
2413 char *dot
= lang
? strchr(lang
, '.') : (char *)NULL
;
2416 lang
= getenv( "LC_CTYPE" );
2418 dot
= strchr(lang
, '.' );
2422 lang
= getenv( "LANG");
2424 dot
= strchr(lang
, '.');
2429 encname
= wxString::FromAscii( dot
+1 );
2432 #endif // Win32/Unix
2438 wxFontEncoding
wxLocale::GetSystemEncoding()
2440 #if defined(__WIN32__) && !defined(__WXMICROWIN__)
2441 UINT codepage
= ::GetACP();
2443 // wxWidgets only knows about CP1250-1257, 874, 932, 936, 949, 950
2444 if ( codepage
>= 1250 && codepage
<= 1257 )
2446 return (wxFontEncoding
)(wxFONTENCODING_CP1250
+ codepage
- 1250);
2449 if ( codepage
== 874 )
2451 return wxFONTENCODING_CP874
;
2454 if ( codepage
== 932 )
2456 return wxFONTENCODING_CP932
;
2459 if ( codepage
== 936 )
2461 return wxFONTENCODING_CP936
;
2464 if ( codepage
== 949 )
2466 return wxFONTENCODING_CP949
;
2469 if ( codepage
== 950 )
2471 return wxFONTENCODING_CP950
;
2473 #elif defined(__WXMAC__)
2474 TextEncoding encoding
= 0 ;
2475 encoding
= CFStringGetSystemEncoding() ;
2476 return wxMacGetFontEncFromSystemEnc( encoding
) ;
2477 #elif defined(__UNIX_LIKE__) && wxUSE_FONTMAP
2478 const wxString encname
= GetSystemEncodingName();
2479 if ( !encname
.empty() )
2481 wxFontEncoding enc
= wxFontMapperBase::GetEncodingFromName(encname
);
2483 // on some modern Linux systems (RedHat 8) the default system locale
2484 // is UTF8 -- but it isn't supported by wxGTK1 in ANSI build at all so
2485 // don't even try to use it in this case
2486 #if !wxUSE_UNICODE && \
2487 ((defined(__WXGTK__) && !defined(__WXGTK20__)) || defined(__WXMOTIF__))
2488 if ( enc
== wxFONTENCODING_UTF8
)
2490 // the most similar supported encoding...
2491 enc
= wxFONTENCODING_ISO8859_1
;
2493 #endif // !wxUSE_UNICODE
2495 // GetEncodingFromName() returns wxFONTENCODING_DEFAULT for C locale
2496 // (a.k.a. US-ASCII) which is arguably a bug but keep it like this for
2497 // backwards compatibility and just take care to not return
2498 // wxFONTENCODING_DEFAULT from here as this surely doesn't make sense
2499 if ( enc
== wxFONTENCODING_DEFAULT
)
2501 // we don't have wxFONTENCODING_ASCII, so use the closest one
2502 return wxFONTENCODING_ISO8859_1
;
2505 if ( enc
!= wxFONTENCODING_MAX
)
2509 //else: return wxFONTENCODING_SYSTEM below
2511 #endif // Win32/Unix
2513 return wxFONTENCODING_SYSTEM
;
2517 void wxLocale::AddLanguage(const wxLanguageInfo
& info
)
2519 CreateLanguagesDB();
2520 ms_languagesDB
->Add(info
);
2524 const wxLanguageInfo
*wxLocale::GetLanguageInfo(int lang
)
2526 CreateLanguagesDB();
2528 // calling GetLanguageInfo(wxLANGUAGE_DEFAULT) is a natural thing to do, so
2530 if ( lang
== wxLANGUAGE_DEFAULT
)
2531 lang
= GetSystemLanguage();
2533 const size_t count
= ms_languagesDB
->GetCount();
2534 for ( size_t i
= 0; i
< count
; i
++ )
2536 if ( ms_languagesDB
->Item(i
).Language
== lang
)
2538 // We need to create a temporary here in order to make this work with BCC in final build mode
2539 wxLanguageInfo
*ptr
= &ms_languagesDB
->Item(i
);
2548 wxString
wxLocale::GetLanguageName(int lang
)
2550 const wxLanguageInfo
*info
= GetLanguageInfo(lang
);
2552 return wxEmptyString
;
2554 return info
->Description
;
2558 const wxLanguageInfo
*wxLocale::FindLanguageInfo(const wxString
& locale
)
2560 CreateLanguagesDB();
2562 const wxLanguageInfo
*infoRet
= NULL
;
2564 const size_t count
= ms_languagesDB
->GetCount();
2565 for ( size_t i
= 0; i
< count
; i
++ )
2567 const wxLanguageInfo
*info
= &ms_languagesDB
->Item(i
);
2569 if ( wxStricmp(locale
, info
->CanonicalName
) == 0 ||
2570 wxStricmp(locale
, info
->Description
) == 0 )
2572 // exact match, stop searching
2577 if ( wxStricmp(locale
, info
->CanonicalName
.BeforeFirst(_T('_'))) == 0 )
2579 // a match -- but maybe we'll find an exact one later, so continue
2582 // OTOH, maybe we had already found a language match and in this
2583 // case don't overwrite it because the entry for the default
2584 // country always appears first in ms_languagesDB
2593 wxString
wxLocale::GetSysName() const
2597 return wxSetlocale(LC_ALL
, NULL
);
2599 return wxEmptyString
;
2604 wxLocale::~wxLocale()
2607 wxMsgCatalog
*pTmpCat
;
2608 while ( m_pMsgCat
!= NULL
) {
2609 pTmpCat
= m_pMsgCat
;
2610 m_pMsgCat
= m_pMsgCat
->m_pNext
;
2614 // restore old locale pointer
2615 wxSetLocale(m_pOldLocale
);
2619 wxSetlocale(LC_ALL
, m_pszOldLocale
);
2621 free((wxChar
*)m_pszOldLocale
); // const_cast
2624 // get the translation of given string in current locale
2625 const wxString
& wxLocale::GetString(const wxString
& origString
,
2626 const wxString
& domain
) const
2628 return GetString(origString
, origString
, size_t(-1), domain
);
2631 const wxString
& wxLocale::GetString(const wxString
& origString
,
2632 const wxString
& origString2
,
2634 const wxString
& domain
) const
2636 if ( origString
.empty() )
2637 return GetUntranslatedString(origString
);
2639 const wxString
*trans
= NULL
;
2640 wxMsgCatalog
*pMsgCat
;
2642 if ( !domain
.empty() )
2644 pMsgCat
= FindCatalog(domain
);
2646 // does the catalog exist?
2647 if ( pMsgCat
!= NULL
)
2648 trans
= pMsgCat
->GetString(origString
, n
);
2652 // search in all domains
2653 for ( pMsgCat
= m_pMsgCat
; pMsgCat
!= NULL
; pMsgCat
= pMsgCat
->m_pNext
)
2655 trans
= pMsgCat
->GetString(origString
, n
);
2656 if ( trans
!= NULL
) // take the first found
2661 if ( trans
== NULL
)
2664 if ( !NoTransErr::Suppress() )
2666 NoTransErr noTransErr
;
2668 wxLogTrace(TRACE_I18N
,
2669 _T("string \"%s\"[%ld] not found in %slocale '%s'."),
2670 origString
, (long)n
,
2672 ? (const wxChar
*)wxString::Format(_T("domain '%s' "), domain
).c_str()
2674 m_strLocale
.c_str());
2676 #endif // __WXDEBUG__
2678 if (n
== size_t(-1))
2679 return GetUntranslatedString(origString
);
2681 return GetUntranslatedString(n
== 1 ? origString
: origString2
);
2687 WX_DECLARE_HASH_SET(wxString
, wxStringHash
, wxStringEqual
,
2688 wxLocaleUntranslatedStrings
);
2691 const wxString
& wxLocale::GetUntranslatedString(const wxString
& str
)
2693 static wxLocaleUntranslatedStrings s_strings
;
2695 wxLocaleUntranslatedStrings::iterator i
= s_strings
.find(str
);
2696 if ( i
== s_strings
.end() )
2697 return *s_strings
.insert(str
).first
;
2702 wxString
wxLocale::GetHeaderValue(const wxString
& header
,
2703 const wxString
& domain
) const
2705 if ( header
.empty() )
2706 return wxEmptyString
;
2708 const wxString
*trans
= NULL
;
2709 wxMsgCatalog
*pMsgCat
;
2711 if ( !domain
.empty() )
2713 pMsgCat
= FindCatalog(domain
);
2715 // does the catalog exist?
2716 if ( pMsgCat
== NULL
)
2717 return wxEmptyString
;
2719 trans
= pMsgCat
->GetString(wxEmptyString
, (size_t)-1);
2723 // search in all domains
2724 for ( pMsgCat
= m_pMsgCat
; pMsgCat
!= NULL
; pMsgCat
= pMsgCat
->m_pNext
)
2726 trans
= pMsgCat
->GetString(wxEmptyString
, (size_t)-1);
2727 if ( trans
!= NULL
) // take the first found
2732 if ( !trans
|| trans
->empty() )
2733 return wxEmptyString
;
2735 size_t found
= trans
->find(header
);
2736 if ( found
== wxString::npos
)
2737 return wxEmptyString
;
2739 found
+= header
.length() + 2 /* ': ' */;
2741 // Every header is separated by \n
2743 size_t endLine
= trans
->find(wxT('\n'), found
);
2744 size_t len
= (endLine
== wxString::npos
) ?
2745 wxString::npos
: (endLine
- found
);
2747 return trans
->substr(found
, len
);
2751 // find catalog by name in a linked list, return NULL if !found
2752 wxMsgCatalog
*wxLocale::FindCatalog(const wxString
& domain
) const
2754 // linear search in the linked list
2755 wxMsgCatalog
*pMsgCat
;
2756 for ( pMsgCat
= m_pMsgCat
; pMsgCat
!= NULL
; pMsgCat
= pMsgCat
->m_pNext
)
2758 if ( pMsgCat
->GetName() == domain
)
2765 // check if the given locale is provided by OS and C run time
2767 bool wxLocale::IsAvailable(int lang
)
2769 const wxLanguageInfo
*info
= wxLocale::GetLanguageInfo(lang
);
2770 wxCHECK_MSG( info
, false, _T("invalid language") );
2772 #if defined(__WIN32__)
2773 if ( !info
->WinLang
)
2776 if ( !::IsValidLocale
2778 MAKELCID(MAKELANGID(info
->WinLang
, info
->WinSublang
),
2784 #elif defined(__UNIX__)
2786 // Test if setting the locale works, then set it back.
2787 const char *oldLocale
= wxSetlocale(LC_ALL
, "");
2788 const char *tmp
= wxSetlocaleTryUTF8(LC_ALL
, info
->CanonicalName
);
2791 // Some C libraries don't like xx_YY form and require xx only
2792 tmp
= wxSetlocaleTryUTF8(LC_ALL
, info
->CanonicalName
.Left(2));
2796 // restore the original locale
2797 wxSetlocale(LC_ALL
, oldLocale
);
2803 // check if the given catalog is loaded
2804 bool wxLocale::IsLoaded(const wxString
& szDomain
) const
2806 return FindCatalog(szDomain
) != NULL
;
2809 // add a catalog to our linked list
2810 bool wxLocale::AddCatalog(const wxString
& szDomain
)
2812 return AddCatalog(szDomain
, wxLANGUAGE_ENGLISH_US
, wxEmptyString
);
2815 // add a catalog to our linked list
2816 bool wxLocale::AddCatalog(const wxString
& szDomain
,
2817 wxLanguage msgIdLanguage
,
2818 const wxString
& msgIdCharset
)
2821 wxMsgCatalog
*pMsgCat
= new wxMsgCatalog
;
2823 if ( pMsgCat
->Load(m_strShort
, szDomain
, msgIdCharset
, m_bConvertEncoding
) ) {
2824 // add it to the head of the list so that in GetString it will
2825 // be searched before the catalogs added earlier
2826 pMsgCat
->m_pNext
= m_pMsgCat
;
2827 m_pMsgCat
= pMsgCat
;
2832 // don't add it because it couldn't be loaded anyway
2835 // It is OK to not load catalog if the msgid language and m_language match,
2836 // in which case we can directly display the texts embedded in program's
2838 if (m_language
== msgIdLanguage
)
2841 // If there's no exact match, we may still get partial match where the
2842 // (basic) language is same, but the country differs. For example, it's
2843 // permitted to use en_US strings from sources even if m_language is en_GB:
2844 const wxLanguageInfo
*msgIdLangInfo
= GetLanguageInfo(msgIdLanguage
);
2845 if ( msgIdLangInfo
&&
2846 msgIdLangInfo
->CanonicalName
.Mid(0, 2) == m_strShort
.Mid(0, 2) )
2855 // ----------------------------------------------------------------------------
2856 // accessors for locale-dependent data
2857 // ----------------------------------------------------------------------------
2859 #if defined(__WXMSW__)
2862 wxString
wxLocale::GetInfo(wxLocaleInfo index
, wxLocaleCategory
WXUNUSED(cat
))
2867 buffer
[0] = wxT('\0');
2870 case wxLOCALE_DECIMAL_POINT
:
2871 count
= ::GetLocaleInfo(LOCALE_USER_DEFAULT
, LOCALE_SDECIMAL
, buffer
, 256);
2878 case wxSYS_LIST_SEPARATOR
:
2879 count
= ::GetLocaleInfo(LOCALE_USER_DEFAULT
, LOCALE_SLIST
, buffer
, 256);
2885 case wxSYS_LEADING_ZERO
: // 0 means no leading zero, 1 means leading zero
2886 count
= ::GetLocaleInfo(LOCALE_USER_DEFAULT
, LOCALE_ILZERO
, buffer
, 256);
2894 wxFAIL_MSG(wxT("Unknown System String !"));
2899 #elif defined(__WXOSX__)
2902 wxString
wxLocale::GetInfo(wxLocaleInfo index
, wxLocaleCategory
WXUNUSED(cat
))
2904 wxCFRef
<CFLocaleRef
> userLocaleRef(CFLocaleCopyCurrent());
2908 case wxLOCALE_THOUSANDS_SEP
:
2909 cfstr
= CFLocaleGetValue(userLocaleRef
, kCFLocaleGroupingSeparator
);
2912 case wxLOCALE_DECIMAL_POINT
:
2913 cfstr
= CFLocaleGetValue(userLocaleRef
, kCFLocaleDecimalSeparator
);
2917 wxFAIL_MSG( "Unknown locale info" );
2921 str(CFStringCreateCopy(NULL
, static_cast<CFStringRef
>(cfstr
)));
2922 return str
.AsString();
2925 #else // !__WXMSW__ && !__WXMAC__
2928 wxString
wxLocale::GetInfo(wxLocaleInfo index
, wxLocaleCategory cat
)
2930 struct lconv
*locale_info
= localeconv();
2933 case wxLOCALE_CAT_NUMBER
:
2936 case wxLOCALE_THOUSANDS_SEP
:
2937 return wxString(locale_info
->thousands_sep
,
2939 case wxLOCALE_DECIMAL_POINT
:
2940 return wxString(locale_info
->decimal_point
,
2943 return wxEmptyString
;
2945 case wxLOCALE_CAT_MONEY
:
2948 case wxLOCALE_THOUSANDS_SEP
:
2949 return wxString(locale_info
->mon_thousands_sep
,
2951 case wxLOCALE_DECIMAL_POINT
:
2952 return wxString(locale_info
->mon_decimal_point
,
2955 return wxEmptyString
;
2958 return wxEmptyString
;
2964 // ----------------------------------------------------------------------------
2965 // global functions and variables
2966 // ----------------------------------------------------------------------------
2968 // retrieve/change current locale
2969 // ------------------------------
2971 // the current locale object
2972 static wxLocale
*g_pLocale
= NULL
;
2974 wxLocale
*wxGetLocale()
2979 wxLocale
*wxSetLocale(wxLocale
*pLocale
)
2981 wxLocale
*pOld
= g_pLocale
;
2982 g_pLocale
= pLocale
;
2988 // ----------------------------------------------------------------------------
2989 // wxLocale module (for lazy destruction of languagesDB)
2990 // ----------------------------------------------------------------------------
2992 class wxLocaleModule
: public wxModule
2994 DECLARE_DYNAMIC_CLASS(wxLocaleModule
)
2997 bool OnInit() { return true; }
2998 void OnExit() { wxLocale::DestroyLanguagesDB(); }
3001 IMPLEMENT_DYNAMIC_CLASS(wxLocaleModule
, wxModule
)
3005 // ----------------------------------------------------------------------------
3006 // default languages table & initialization
3007 // ----------------------------------------------------------------------------
3011 // --- --- --- generated code begins here --- --- ---
3013 // This table is generated by misc/languages/genlang.py
3014 // When making changes, please put them into misc/languages/langtabl.txt
3016 #if !defined(__WIN32__) || defined(__WXMICROWIN__)
3018 #define SETWINLANG(info,lang,sublang)
3022 #define SETWINLANG(info,lang,sublang) \
3023 info.WinLang = lang, info.WinSublang = sublang;
3025 #ifndef LANG_AFRIKAANS
3026 #define LANG_AFRIKAANS (0)
3028 #ifndef LANG_ALBANIAN
3029 #define LANG_ALBANIAN (0)
3032 #define LANG_ARABIC (0)
3034 #ifndef LANG_ARMENIAN
3035 #define LANG_ARMENIAN (0)
3037 #ifndef LANG_ASSAMESE
3038 #define LANG_ASSAMESE (0)
3041 #define LANG_AZERI (0)
3044 #define LANG_BASQUE (0)
3046 #ifndef LANG_BELARUSIAN
3047 #define LANG_BELARUSIAN (0)
3049 #ifndef LANG_BENGALI
3050 #define LANG_BENGALI (0)
3052 #ifndef LANG_BULGARIAN
3053 #define LANG_BULGARIAN (0)
3055 #ifndef LANG_CATALAN
3056 #define LANG_CATALAN (0)
3058 #ifndef LANG_CHINESE
3059 #define LANG_CHINESE (0)
3061 #ifndef LANG_CROATIAN
3062 #define LANG_CROATIAN (0)
3065 #define LANG_CZECH (0)
3068 #define LANG_DANISH (0)
3071 #define LANG_DUTCH (0)
3073 #ifndef LANG_ENGLISH
3074 #define LANG_ENGLISH (0)
3076 #ifndef LANG_ESTONIAN
3077 #define LANG_ESTONIAN (0)
3079 #ifndef LANG_FAEROESE
3080 #define LANG_FAEROESE (0)
3083 #define LANG_FARSI (0)
3085 #ifndef LANG_FINNISH
3086 #define LANG_FINNISH (0)
3089 #define LANG_FRENCH (0)
3091 #ifndef LANG_GEORGIAN
3092 #define LANG_GEORGIAN (0)
3095 #define LANG_GERMAN (0)
3098 #define LANG_GREEK (0)
3100 #ifndef LANG_GUJARATI
3101 #define LANG_GUJARATI (0)
3104 #define LANG_HEBREW (0)
3107 #define LANG_HINDI (0)
3109 #ifndef LANG_HUNGARIAN
3110 #define LANG_HUNGARIAN (0)
3112 #ifndef LANG_ICELANDIC
3113 #define LANG_ICELANDIC (0)
3115 #ifndef LANG_INDONESIAN
3116 #define LANG_INDONESIAN (0)
3118 #ifndef LANG_ITALIAN
3119 #define LANG_ITALIAN (0)
3121 #ifndef LANG_JAPANESE
3122 #define LANG_JAPANESE (0)
3124 #ifndef LANG_KANNADA
3125 #define LANG_KANNADA (0)
3127 #ifndef LANG_KASHMIRI
3128 #define LANG_KASHMIRI (0)
3131 #define LANG_KAZAK (0)
3133 #ifndef LANG_KONKANI
3134 #define LANG_KONKANI (0)
3137 #define LANG_KOREAN (0)
3139 #ifndef LANG_LATVIAN
3140 #define LANG_LATVIAN (0)
3142 #ifndef LANG_LITHUANIAN
3143 #define LANG_LITHUANIAN (0)
3145 #ifndef LANG_MACEDONIAN
3146 #define LANG_MACEDONIAN (0)
3149 #define LANG_MALAY (0)
3151 #ifndef LANG_MALAYALAM
3152 #define LANG_MALAYALAM (0)
3154 #ifndef LANG_MANIPURI
3155 #define LANG_MANIPURI (0)
3157 #ifndef LANG_MARATHI
3158 #define LANG_MARATHI (0)
3161 #define LANG_NEPALI (0)
3163 #ifndef LANG_NORWEGIAN
3164 #define LANG_NORWEGIAN (0)
3167 #define LANG_ORIYA (0)
3170 #define LANG_POLISH (0)
3172 #ifndef LANG_PORTUGUESE
3173 #define LANG_PORTUGUESE (0)
3175 #ifndef LANG_PUNJABI
3176 #define LANG_PUNJABI (0)
3178 #ifndef LANG_ROMANIAN
3179 #define LANG_ROMANIAN (0)
3181 #ifndef LANG_RUSSIAN
3182 #define LANG_RUSSIAN (0)
3184 #ifndef LANG_SANSKRIT
3185 #define LANG_SANSKRIT (0)
3187 #ifndef LANG_SERBIAN
3188 #define LANG_SERBIAN (0)
3191 #define LANG_SINDHI (0)
3194 #define LANG_SLOVAK (0)
3196 #ifndef LANG_SLOVENIAN
3197 #define LANG_SLOVENIAN (0)
3199 #ifndef LANG_SPANISH
3200 #define LANG_SPANISH (0)
3202 #ifndef LANG_SWAHILI
3203 #define LANG_SWAHILI (0)
3205 #ifndef LANG_SWEDISH
3206 #define LANG_SWEDISH (0)
3209 #define LANG_TAMIL (0)
3212 #define LANG_TATAR (0)
3215 #define LANG_TELUGU (0)
3218 #define LANG_THAI (0)
3220 #ifndef LANG_TURKISH
3221 #define LANG_TURKISH (0)
3223 #ifndef LANG_UKRAINIAN
3224 #define LANG_UKRAINIAN (0)
3227 #define LANG_URDU (0)
3230 #define LANG_UZBEK (0)
3232 #ifndef LANG_VIETNAMESE
3233 #define LANG_VIETNAMESE (0)
3235 #ifndef SUBLANG_ARABIC_ALGERIA
3236 #define SUBLANG_ARABIC_ALGERIA SUBLANG_DEFAULT
3238 #ifndef SUBLANG_ARABIC_BAHRAIN
3239 #define SUBLANG_ARABIC_BAHRAIN SUBLANG_DEFAULT
3241 #ifndef SUBLANG_ARABIC_EGYPT
3242 #define SUBLANG_ARABIC_EGYPT SUBLANG_DEFAULT
3244 #ifndef SUBLANG_ARABIC_IRAQ
3245 #define SUBLANG_ARABIC_IRAQ SUBLANG_DEFAULT
3247 #ifndef SUBLANG_ARABIC_JORDAN
3248 #define SUBLANG_ARABIC_JORDAN SUBLANG_DEFAULT
3250 #ifndef SUBLANG_ARABIC_KUWAIT
3251 #define SUBLANG_ARABIC_KUWAIT SUBLANG_DEFAULT
3253 #ifndef SUBLANG_ARABIC_LEBANON
3254 #define SUBLANG_ARABIC_LEBANON SUBLANG_DEFAULT
3256 #ifndef SUBLANG_ARABIC_LIBYA
3257 #define SUBLANG_ARABIC_LIBYA SUBLANG_DEFAULT
3259 #ifndef SUBLANG_ARABIC_MOROCCO
3260 #define SUBLANG_ARABIC_MOROCCO SUBLANG_DEFAULT
3262 #ifndef SUBLANG_ARABIC_OMAN
3263 #define SUBLANG_ARABIC_OMAN SUBLANG_DEFAULT
3265 #ifndef SUBLANG_ARABIC_QATAR
3266 #define SUBLANG_ARABIC_QATAR SUBLANG_DEFAULT
3268 #ifndef SUBLANG_ARABIC_SAUDI_ARABIA
3269 #define SUBLANG_ARABIC_SAUDI_ARABIA SUBLANG_DEFAULT
3271 #ifndef SUBLANG_ARABIC_SYRIA
3272 #define SUBLANG_ARABIC_SYRIA SUBLANG_DEFAULT
3274 #ifndef SUBLANG_ARABIC_TUNISIA
3275 #define SUBLANG_ARABIC_TUNISIA SUBLANG_DEFAULT
3277 #ifndef SUBLANG_ARABIC_UAE
3278 #define SUBLANG_ARABIC_UAE SUBLANG_DEFAULT
3280 #ifndef SUBLANG_ARABIC_YEMEN
3281 #define SUBLANG_ARABIC_YEMEN SUBLANG_DEFAULT
3283 #ifndef SUBLANG_AZERI_CYRILLIC
3284 #define SUBLANG_AZERI_CYRILLIC SUBLANG_DEFAULT
3286 #ifndef SUBLANG_AZERI_LATIN
3287 #define SUBLANG_AZERI_LATIN SUBLANG_DEFAULT
3289 #ifndef SUBLANG_CHINESE_SIMPLIFIED
3290 #define SUBLANG_CHINESE_SIMPLIFIED SUBLANG_DEFAULT
3292 #ifndef SUBLANG_CHINESE_TRADITIONAL
3293 #define SUBLANG_CHINESE_TRADITIONAL SUBLANG_DEFAULT
3295 #ifndef SUBLANG_CHINESE_HONGKONG
3296 #define SUBLANG_CHINESE_HONGKONG SUBLANG_DEFAULT
3298 #ifndef SUBLANG_CHINESE_MACAU
3299 #define SUBLANG_CHINESE_MACAU SUBLANG_DEFAULT
3301 #ifndef SUBLANG_CHINESE_SINGAPORE
3302 #define SUBLANG_CHINESE_SINGAPORE SUBLANG_DEFAULT
3304 #ifndef SUBLANG_DUTCH
3305 #define SUBLANG_DUTCH SUBLANG_DEFAULT
3307 #ifndef SUBLANG_DUTCH_BELGIAN
3308 #define SUBLANG_DUTCH_BELGIAN SUBLANG_DEFAULT
3310 #ifndef SUBLANG_ENGLISH_UK
3311 #define SUBLANG_ENGLISH_UK SUBLANG_DEFAULT
3313 #ifndef SUBLANG_ENGLISH_US
3314 #define SUBLANG_ENGLISH_US SUBLANG_DEFAULT
3316 #ifndef SUBLANG_ENGLISH_AUS
3317 #define SUBLANG_ENGLISH_AUS SUBLANG_DEFAULT
3319 #ifndef SUBLANG_ENGLISH_BELIZE
3320 #define SUBLANG_ENGLISH_BELIZE SUBLANG_DEFAULT
3322 #ifndef SUBLANG_ENGLISH_CAN
3323 #define SUBLANG_ENGLISH_CAN SUBLANG_DEFAULT
3325 #ifndef SUBLANG_ENGLISH_CARIBBEAN
3326 #define SUBLANG_ENGLISH_CARIBBEAN SUBLANG_DEFAULT
3328 #ifndef SUBLANG_ENGLISH_EIRE
3329 #define SUBLANG_ENGLISH_EIRE SUBLANG_DEFAULT
3331 #ifndef SUBLANG_ENGLISH_JAMAICA
3332 #define SUBLANG_ENGLISH_JAMAICA SUBLANG_DEFAULT
3334 #ifndef SUBLANG_ENGLISH_NZ
3335 #define SUBLANG_ENGLISH_NZ SUBLANG_DEFAULT
3337 #ifndef SUBLANG_ENGLISH_PHILIPPINES
3338 #define SUBLANG_ENGLISH_PHILIPPINES SUBLANG_DEFAULT
3340 #ifndef SUBLANG_ENGLISH_SOUTH_AFRICA
3341 #define SUBLANG_ENGLISH_SOUTH_AFRICA SUBLANG_DEFAULT
3343 #ifndef SUBLANG_ENGLISH_TRINIDAD
3344 #define SUBLANG_ENGLISH_TRINIDAD SUBLANG_DEFAULT
3346 #ifndef SUBLANG_ENGLISH_ZIMBABWE
3347 #define SUBLANG_ENGLISH_ZIMBABWE SUBLANG_DEFAULT
3349 #ifndef SUBLANG_FRENCH
3350 #define SUBLANG_FRENCH SUBLANG_DEFAULT
3352 #ifndef SUBLANG_FRENCH_BELGIAN
3353 #define SUBLANG_FRENCH_BELGIAN SUBLANG_DEFAULT
3355 #ifndef SUBLANG_FRENCH_CANADIAN
3356 #define SUBLANG_FRENCH_CANADIAN SUBLANG_DEFAULT
3358 #ifndef SUBLANG_FRENCH_LUXEMBOURG
3359 #define SUBLANG_FRENCH_LUXEMBOURG SUBLANG_DEFAULT
3361 #ifndef SUBLANG_FRENCH_MONACO
3362 #define SUBLANG_FRENCH_MONACO SUBLANG_DEFAULT
3364 #ifndef SUBLANG_FRENCH_SWISS
3365 #define SUBLANG_FRENCH_SWISS SUBLANG_DEFAULT
3367 #ifndef SUBLANG_GERMAN
3368 #define SUBLANG_GERMAN SUBLANG_DEFAULT
3370 #ifndef SUBLANG_GERMAN_AUSTRIAN
3371 #define SUBLANG_GERMAN_AUSTRIAN SUBLANG_DEFAULT
3373 #ifndef SUBLANG_GERMAN_LIECHTENSTEIN
3374 #define SUBLANG_GERMAN_LIECHTENSTEIN SUBLANG_DEFAULT
3376 #ifndef SUBLANG_GERMAN_LUXEMBOURG
3377 #define SUBLANG_GERMAN_LUXEMBOURG SUBLANG_DEFAULT
3379 #ifndef SUBLANG_GERMAN_SWISS
3380 #define SUBLANG_GERMAN_SWISS SUBLANG_DEFAULT
3382 #ifndef SUBLANG_ITALIAN
3383 #define SUBLANG_ITALIAN SUBLANG_DEFAULT
3385 #ifndef SUBLANG_ITALIAN_SWISS
3386 #define SUBLANG_ITALIAN_SWISS SUBLANG_DEFAULT
3388 #ifndef SUBLANG_KASHMIRI_INDIA
3389 #define SUBLANG_KASHMIRI_INDIA SUBLANG_DEFAULT
3391 #ifndef SUBLANG_KOREAN
3392 #define SUBLANG_KOREAN SUBLANG_DEFAULT
3394 #ifndef SUBLANG_LITHUANIAN
3395 #define SUBLANG_LITHUANIAN SUBLANG_DEFAULT
3397 #ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM
3398 #define SUBLANG_MALAY_BRUNEI_DARUSSALAM SUBLANG_DEFAULT
3400 #ifndef SUBLANG_MALAY_MALAYSIA
3401 #define SUBLANG_MALAY_MALAYSIA SUBLANG_DEFAULT
3403 #ifndef SUBLANG_NEPALI_INDIA
3404 #define SUBLANG_NEPALI_INDIA SUBLANG_DEFAULT
3406 #ifndef SUBLANG_NORWEGIAN_BOKMAL
3407 #define SUBLANG_NORWEGIAN_BOKMAL SUBLANG_DEFAULT
3409 #ifndef SUBLANG_NORWEGIAN_NYNORSK
3410 #define SUBLANG_NORWEGIAN_NYNORSK SUBLANG_DEFAULT
3412 #ifndef SUBLANG_PORTUGUESE
3413 #define SUBLANG_PORTUGUESE SUBLANG_DEFAULT
3415 #ifndef SUBLANG_PORTUGUESE_BRAZILIAN
3416 #define SUBLANG_PORTUGUESE_BRAZILIAN SUBLANG_DEFAULT
3418 #ifndef SUBLANG_SERBIAN_CYRILLIC
3419 #define SUBLANG_SERBIAN_CYRILLIC SUBLANG_DEFAULT
3421 #ifndef SUBLANG_SERBIAN_LATIN
3422 #define SUBLANG_SERBIAN_LATIN SUBLANG_DEFAULT
3424 #ifndef SUBLANG_SPANISH
3425 #define SUBLANG_SPANISH SUBLANG_DEFAULT
3427 #ifndef SUBLANG_SPANISH_ARGENTINA
3428 #define SUBLANG_SPANISH_ARGENTINA SUBLANG_DEFAULT
3430 #ifndef SUBLANG_SPANISH_BOLIVIA
3431 #define SUBLANG_SPANISH_BOLIVIA SUBLANG_DEFAULT
3433 #ifndef SUBLANG_SPANISH_CHILE
3434 #define SUBLANG_SPANISH_CHILE SUBLANG_DEFAULT
3436 #ifndef SUBLANG_SPANISH_COLOMBIA
3437 #define SUBLANG_SPANISH_COLOMBIA SUBLANG_DEFAULT
3439 #ifndef SUBLANG_SPANISH_COSTA_RICA
3440 #define SUBLANG_SPANISH_COSTA_RICA SUBLANG_DEFAULT
3442 #ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC
3443 #define SUBLANG_SPANISH_DOMINICAN_REPUBLIC SUBLANG_DEFAULT
3445 #ifndef SUBLANG_SPANISH_ECUADOR
3446 #define SUBLANG_SPANISH_ECUADOR SUBLANG_DEFAULT
3448 #ifndef SUBLANG_SPANISH_EL_SALVADOR
3449 #define SUBLANG_SPANISH_EL_SALVADOR SUBLANG_DEFAULT
3451 #ifndef SUBLANG_SPANISH_GUATEMALA
3452 #define SUBLANG_SPANISH_GUATEMALA SUBLANG_DEFAULT
3454 #ifndef SUBLANG_SPANISH_HONDURAS
3455 #define SUBLANG_SPANISH_HONDURAS SUBLANG_DEFAULT
3457 #ifndef SUBLANG_SPANISH_MEXICAN
3458 #define SUBLANG_SPANISH_MEXICAN SUBLANG_DEFAULT
3460 #ifndef SUBLANG_SPANISH_MODERN
3461 #define SUBLANG_SPANISH_MODERN SUBLANG_DEFAULT
3463 #ifndef SUBLANG_SPANISH_NICARAGUA
3464 #define SUBLANG_SPANISH_NICARAGUA SUBLANG_DEFAULT
3466 #ifndef SUBLANG_SPANISH_PANAMA
3467 #define SUBLANG_SPANISH_PANAMA SUBLANG_DEFAULT
3469 #ifndef SUBLANG_SPANISH_PARAGUAY
3470 #define SUBLANG_SPANISH_PARAGUAY SUBLANG_DEFAULT
3472 #ifndef SUBLANG_SPANISH_PERU
3473 #define SUBLANG_SPANISH_PERU SUBLANG_DEFAULT
3475 #ifndef SUBLANG_SPANISH_PUERTO_RICO
3476 #define SUBLANG_SPANISH_PUERTO_RICO SUBLANG_DEFAULT
3478 #ifndef SUBLANG_SPANISH_URUGUAY
3479 #define SUBLANG_SPANISH_URUGUAY SUBLANG_DEFAULT
3481 #ifndef SUBLANG_SPANISH_VENEZUELA
3482 #define SUBLANG_SPANISH_VENEZUELA SUBLANG_DEFAULT
3484 #ifndef SUBLANG_SWEDISH
3485 #define SUBLANG_SWEDISH SUBLANG_DEFAULT
3487 #ifndef SUBLANG_SWEDISH_FINLAND
3488 #define SUBLANG_SWEDISH_FINLAND SUBLANG_DEFAULT
3490 #ifndef SUBLANG_URDU_INDIA
3491 #define SUBLANG_URDU_INDIA SUBLANG_DEFAULT
3493 #ifndef SUBLANG_URDU_PAKISTAN
3494 #define SUBLANG_URDU_PAKISTAN SUBLANG_DEFAULT
3496 #ifndef SUBLANG_UZBEK_CYRILLIC
3497 #define SUBLANG_UZBEK_CYRILLIC SUBLANG_DEFAULT
3499 #ifndef SUBLANG_UZBEK_LATIN
3500 #define SUBLANG_UZBEK_LATIN SUBLANG_DEFAULT
3506 #define LNG(wxlang, canonical, winlang, winsublang, layout, desc) \
3507 info.Language = wxlang; \
3508 info.CanonicalName = wxT(canonical); \
3509 info.LayoutDirection = layout; \
3510 info.Description = wxT(desc); \
3511 SETWINLANG(info, winlang, winsublang) \
3514 void wxLocale::InitLanguagesDB()
3516 wxLanguageInfo info
;
3517 wxStringTokenizer tkn
;
3519 LNG(wxLANGUAGE_ABKHAZIAN
, "ab" , 0 , 0 , wxLayout_LeftToRight
, "Abkhazian")
3520 LNG(wxLANGUAGE_AFAR
, "aa" , 0 , 0 , wxLayout_LeftToRight
, "Afar")
3521 LNG(wxLANGUAGE_AFRIKAANS
, "af_ZA", LANG_AFRIKAANS
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Afrikaans")
3522 LNG(wxLANGUAGE_ALBANIAN
, "sq_AL", LANG_ALBANIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Albanian")
3523 LNG(wxLANGUAGE_AMHARIC
, "am" , 0 , 0 , wxLayout_LeftToRight
, "Amharic")
3524 LNG(wxLANGUAGE_ARABIC
, "ar" , LANG_ARABIC
, SUBLANG_DEFAULT
, wxLayout_RightToLeft
, "Arabic")
3525 LNG(wxLANGUAGE_ARABIC_ALGERIA
, "ar_DZ", LANG_ARABIC
, SUBLANG_ARABIC_ALGERIA
, wxLayout_RightToLeft
, "Arabic (Algeria)")
3526 LNG(wxLANGUAGE_ARABIC_BAHRAIN
, "ar_BH", LANG_ARABIC
, SUBLANG_ARABIC_BAHRAIN
, wxLayout_RightToLeft
, "Arabic (Bahrain)")
3527 LNG(wxLANGUAGE_ARABIC_EGYPT
, "ar_EG", LANG_ARABIC
, SUBLANG_ARABIC_EGYPT
, wxLayout_RightToLeft
, "Arabic (Egypt)")
3528 LNG(wxLANGUAGE_ARABIC_IRAQ
, "ar_IQ", LANG_ARABIC
, SUBLANG_ARABIC_IRAQ
, wxLayout_RightToLeft
, "Arabic (Iraq)")
3529 LNG(wxLANGUAGE_ARABIC_JORDAN
, "ar_JO", LANG_ARABIC
, SUBLANG_ARABIC_JORDAN
, wxLayout_RightToLeft
, "Arabic (Jordan)")
3530 LNG(wxLANGUAGE_ARABIC_KUWAIT
, "ar_KW", LANG_ARABIC
, SUBLANG_ARABIC_KUWAIT
, wxLayout_RightToLeft
, "Arabic (Kuwait)")
3531 LNG(wxLANGUAGE_ARABIC_LEBANON
, "ar_LB", LANG_ARABIC
, SUBLANG_ARABIC_LEBANON
, wxLayout_RightToLeft
, "Arabic (Lebanon)")
3532 LNG(wxLANGUAGE_ARABIC_LIBYA
, "ar_LY", LANG_ARABIC
, SUBLANG_ARABIC_LIBYA
, wxLayout_RightToLeft
, "Arabic (Libya)")
3533 LNG(wxLANGUAGE_ARABIC_MOROCCO
, "ar_MA", LANG_ARABIC
, SUBLANG_ARABIC_MOROCCO
, wxLayout_RightToLeft
, "Arabic (Morocco)")
3534 LNG(wxLANGUAGE_ARABIC_OMAN
, "ar_OM", LANG_ARABIC
, SUBLANG_ARABIC_OMAN
, wxLayout_RightToLeft
, "Arabic (Oman)")
3535 LNG(wxLANGUAGE_ARABIC_QATAR
, "ar_QA", LANG_ARABIC
, SUBLANG_ARABIC_QATAR
, wxLayout_RightToLeft
, "Arabic (Qatar)")
3536 LNG(wxLANGUAGE_ARABIC_SAUDI_ARABIA
, "ar_SA", LANG_ARABIC
, SUBLANG_ARABIC_SAUDI_ARABIA
, wxLayout_RightToLeft
, "Arabic (Saudi Arabia)")
3537 LNG(wxLANGUAGE_ARABIC_SUDAN
, "ar_SD", 0 , 0 , wxLayout_RightToLeft
, "Arabic (Sudan)")
3538 LNG(wxLANGUAGE_ARABIC_SYRIA
, "ar_SY", LANG_ARABIC
, SUBLANG_ARABIC_SYRIA
, wxLayout_RightToLeft
, "Arabic (Syria)")
3539 LNG(wxLANGUAGE_ARABIC_TUNISIA
, "ar_TN", LANG_ARABIC
, SUBLANG_ARABIC_TUNISIA
, wxLayout_RightToLeft
, "Arabic (Tunisia)")
3540 LNG(wxLANGUAGE_ARABIC_UAE
, "ar_AE", LANG_ARABIC
, SUBLANG_ARABIC_UAE
, wxLayout_RightToLeft
, "Arabic (Uae)")
3541 LNG(wxLANGUAGE_ARABIC_YEMEN
, "ar_YE", LANG_ARABIC
, SUBLANG_ARABIC_YEMEN
, wxLayout_RightToLeft
, "Arabic (Yemen)")
3542 LNG(wxLANGUAGE_ARMENIAN
, "hy" , LANG_ARMENIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Armenian")
3543 LNG(wxLANGUAGE_ASSAMESE
, "as" , LANG_ASSAMESE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Assamese")
3544 LNG(wxLANGUAGE_AYMARA
, "ay" , 0 , 0 , wxLayout_LeftToRight
, "Aymara")
3545 LNG(wxLANGUAGE_AZERI
, "az" , LANG_AZERI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Azeri")
3546 LNG(wxLANGUAGE_AZERI_CYRILLIC
, "az" , LANG_AZERI
, SUBLANG_AZERI_CYRILLIC
, wxLayout_LeftToRight
, "Azeri (Cyrillic)")
3547 LNG(wxLANGUAGE_AZERI_LATIN
, "az" , LANG_AZERI
, SUBLANG_AZERI_LATIN
, wxLayout_LeftToRight
, "Azeri (Latin)")
3548 LNG(wxLANGUAGE_BASHKIR
, "ba" , 0 , 0 , wxLayout_LeftToRight
, "Bashkir")
3549 LNG(wxLANGUAGE_BASQUE
, "eu_ES", LANG_BASQUE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Basque")
3550 LNG(wxLANGUAGE_BELARUSIAN
, "be_BY", LANG_BELARUSIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Belarusian")
3551 LNG(wxLANGUAGE_BENGALI
, "bn" , LANG_BENGALI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Bengali")
3552 LNG(wxLANGUAGE_BHUTANI
, "dz" , 0 , 0 , wxLayout_LeftToRight
, "Bhutani")
3553 LNG(wxLANGUAGE_BIHARI
, "bh" , 0 , 0 , wxLayout_LeftToRight
, "Bihari")
3554 LNG(wxLANGUAGE_BISLAMA
, "bi" , 0 , 0 , wxLayout_LeftToRight
, "Bislama")
3555 LNG(wxLANGUAGE_BRETON
, "br" , 0 , 0 , wxLayout_LeftToRight
, "Breton")
3556 LNG(wxLANGUAGE_BULGARIAN
, "bg_BG", LANG_BULGARIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Bulgarian")
3557 LNG(wxLANGUAGE_BURMESE
, "my" , 0 , 0 , wxLayout_LeftToRight
, "Burmese")
3558 LNG(wxLANGUAGE_CAMBODIAN
, "km" , 0 , 0 , wxLayout_LeftToRight
, "Cambodian")
3559 LNG(wxLANGUAGE_CATALAN
, "ca_ES", LANG_CATALAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Catalan")
3560 LNG(wxLANGUAGE_CHINESE
, "zh_TW", LANG_CHINESE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Chinese")
3561 LNG(wxLANGUAGE_CHINESE_SIMPLIFIED
, "zh_CN", LANG_CHINESE
, SUBLANG_CHINESE_SIMPLIFIED
, wxLayout_LeftToRight
, "Chinese (Simplified)")
3562 LNG(wxLANGUAGE_CHINESE_TRADITIONAL
, "zh_TW", LANG_CHINESE
, SUBLANG_CHINESE_TRADITIONAL
, wxLayout_LeftToRight
, "Chinese (Traditional)")
3563 LNG(wxLANGUAGE_CHINESE_HONGKONG
, "zh_HK", LANG_CHINESE
, SUBLANG_CHINESE_HONGKONG
, wxLayout_LeftToRight
, "Chinese (Hongkong)")
3564 LNG(wxLANGUAGE_CHINESE_MACAU
, "zh_MO", LANG_CHINESE
, SUBLANG_CHINESE_MACAU
, wxLayout_LeftToRight
, "Chinese (Macau)")
3565 LNG(wxLANGUAGE_CHINESE_SINGAPORE
, "zh_SG", LANG_CHINESE
, SUBLANG_CHINESE_SINGAPORE
, wxLayout_LeftToRight
, "Chinese (Singapore)")
3566 LNG(wxLANGUAGE_CHINESE_TAIWAN
, "zh_TW", LANG_CHINESE
, SUBLANG_CHINESE_TRADITIONAL
, wxLayout_LeftToRight
, "Chinese (Taiwan)")
3567 LNG(wxLANGUAGE_CORSICAN
, "co" , 0 , 0 , wxLayout_LeftToRight
, "Corsican")
3568 LNG(wxLANGUAGE_CROATIAN
, "hr_HR", LANG_CROATIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Croatian")
3569 LNG(wxLANGUAGE_CZECH
, "cs_CZ", LANG_CZECH
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Czech")
3570 LNG(wxLANGUAGE_DANISH
, "da_DK", LANG_DANISH
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Danish")
3571 LNG(wxLANGUAGE_DUTCH
, "nl_NL", LANG_DUTCH
, SUBLANG_DUTCH
, wxLayout_LeftToRight
, "Dutch")
3572 LNG(wxLANGUAGE_DUTCH_BELGIAN
, "nl_BE", LANG_DUTCH
, SUBLANG_DUTCH_BELGIAN
, wxLayout_LeftToRight
, "Dutch (Belgian)")
3573 LNG(wxLANGUAGE_ENGLISH
, "en_GB", LANG_ENGLISH
, SUBLANG_ENGLISH_UK
, wxLayout_LeftToRight
, "English")
3574 LNG(wxLANGUAGE_ENGLISH_UK
, "en_GB", LANG_ENGLISH
, SUBLANG_ENGLISH_UK
, wxLayout_LeftToRight
, "English (U.K.)")
3575 LNG(wxLANGUAGE_ENGLISH_US
, "en_US", LANG_ENGLISH
, SUBLANG_ENGLISH_US
, wxLayout_LeftToRight
, "English (U.S.)")
3576 LNG(wxLANGUAGE_ENGLISH_AUSTRALIA
, "en_AU", LANG_ENGLISH
, SUBLANG_ENGLISH_AUS
, wxLayout_LeftToRight
, "English (Australia)")
3577 LNG(wxLANGUAGE_ENGLISH_BELIZE
, "en_BZ", LANG_ENGLISH
, SUBLANG_ENGLISH_BELIZE
, wxLayout_LeftToRight
, "English (Belize)")
3578 LNG(wxLANGUAGE_ENGLISH_BOTSWANA
, "en_BW", 0 , 0 , wxLayout_LeftToRight
, "English (Botswana)")
3579 LNG(wxLANGUAGE_ENGLISH_CANADA
, "en_CA", LANG_ENGLISH
, SUBLANG_ENGLISH_CAN
, wxLayout_LeftToRight
, "English (Canada)")
3580 LNG(wxLANGUAGE_ENGLISH_CARIBBEAN
, "en_CB", LANG_ENGLISH
, SUBLANG_ENGLISH_CARIBBEAN
, wxLayout_LeftToRight
, "English (Caribbean)")
3581 LNG(wxLANGUAGE_ENGLISH_DENMARK
, "en_DK", 0 , 0 , wxLayout_LeftToRight
, "English (Denmark)")
3582 LNG(wxLANGUAGE_ENGLISH_EIRE
, "en_IE", LANG_ENGLISH
, SUBLANG_ENGLISH_EIRE
, wxLayout_LeftToRight
, "English (Eire)")
3583 LNG(wxLANGUAGE_ENGLISH_JAMAICA
, "en_JM", LANG_ENGLISH
, SUBLANG_ENGLISH_JAMAICA
, wxLayout_LeftToRight
, "English (Jamaica)")
3584 LNG(wxLANGUAGE_ENGLISH_NEW_ZEALAND
, "en_NZ", LANG_ENGLISH
, SUBLANG_ENGLISH_NZ
, wxLayout_LeftToRight
, "English (New Zealand)")
3585 LNG(wxLANGUAGE_ENGLISH_PHILIPPINES
, "en_PH", LANG_ENGLISH
, SUBLANG_ENGLISH_PHILIPPINES
, wxLayout_LeftToRight
, "English (Philippines)")
3586 LNG(wxLANGUAGE_ENGLISH_SOUTH_AFRICA
, "en_ZA", LANG_ENGLISH
, SUBLANG_ENGLISH_SOUTH_AFRICA
, wxLayout_LeftToRight
, "English (South Africa)")
3587 LNG(wxLANGUAGE_ENGLISH_TRINIDAD
, "en_TT", LANG_ENGLISH
, SUBLANG_ENGLISH_TRINIDAD
, wxLayout_LeftToRight
, "English (Trinidad)")
3588 LNG(wxLANGUAGE_ENGLISH_ZIMBABWE
, "en_ZW", LANG_ENGLISH
, SUBLANG_ENGLISH_ZIMBABWE
, wxLayout_LeftToRight
, "English (Zimbabwe)")
3589 LNG(wxLANGUAGE_ESPERANTO
, "eo" , 0 , 0 , wxLayout_LeftToRight
, "Esperanto")
3590 LNG(wxLANGUAGE_ESTONIAN
, "et_EE", LANG_ESTONIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Estonian")
3591 LNG(wxLANGUAGE_FAEROESE
, "fo_FO", LANG_FAEROESE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Faeroese")
3592 LNG(wxLANGUAGE_FARSI
, "fa_IR", LANG_FARSI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Farsi")
3593 LNG(wxLANGUAGE_FIJI
, "fj" , 0 , 0 , wxLayout_LeftToRight
, "Fiji")
3594 LNG(wxLANGUAGE_FINNISH
, "fi_FI", LANG_FINNISH
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Finnish")
3595 LNG(wxLANGUAGE_FRENCH
, "fr_FR", LANG_FRENCH
, SUBLANG_FRENCH
, wxLayout_LeftToRight
, "French")
3596 LNG(wxLANGUAGE_FRENCH_BELGIAN
, "fr_BE", LANG_FRENCH
, SUBLANG_FRENCH_BELGIAN
, wxLayout_LeftToRight
, "French (Belgian)")
3597 LNG(wxLANGUAGE_FRENCH_CANADIAN
, "fr_CA", LANG_FRENCH
, SUBLANG_FRENCH_CANADIAN
, wxLayout_LeftToRight
, "French (Canadian)")
3598 LNG(wxLANGUAGE_FRENCH_LUXEMBOURG
, "fr_LU", LANG_FRENCH
, SUBLANG_FRENCH_LUXEMBOURG
, wxLayout_LeftToRight
, "French (Luxembourg)")
3599 LNG(wxLANGUAGE_FRENCH_MONACO
, "fr_MC", LANG_FRENCH
, SUBLANG_FRENCH_MONACO
, wxLayout_LeftToRight
, "French (Monaco)")
3600 LNG(wxLANGUAGE_FRENCH_SWISS
, "fr_CH", LANG_FRENCH
, SUBLANG_FRENCH_SWISS
, wxLayout_LeftToRight
, "French (Swiss)")
3601 LNG(wxLANGUAGE_FRISIAN
, "fy" , 0 , 0 , wxLayout_LeftToRight
, "Frisian")
3602 LNG(wxLANGUAGE_GALICIAN
, "gl_ES", 0 , 0 , wxLayout_LeftToRight
, "Galician")
3603 LNG(wxLANGUAGE_GEORGIAN
, "ka" , LANG_GEORGIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Georgian")
3604 LNG(wxLANGUAGE_GERMAN
, "de_DE", LANG_GERMAN
, SUBLANG_GERMAN
, wxLayout_LeftToRight
, "German")
3605 LNG(wxLANGUAGE_GERMAN_AUSTRIAN
, "de_AT", LANG_GERMAN
, SUBLANG_GERMAN_AUSTRIAN
, wxLayout_LeftToRight
, "German (Austrian)")
3606 LNG(wxLANGUAGE_GERMAN_BELGIUM
, "de_BE", 0 , 0 , wxLayout_LeftToRight
, "German (Belgium)")
3607 LNG(wxLANGUAGE_GERMAN_LIECHTENSTEIN
, "de_LI", LANG_GERMAN
, SUBLANG_GERMAN_LIECHTENSTEIN
, wxLayout_LeftToRight
, "German (Liechtenstein)")
3608 LNG(wxLANGUAGE_GERMAN_LUXEMBOURG
, "de_LU", LANG_GERMAN
, SUBLANG_GERMAN_LUXEMBOURG
, wxLayout_LeftToRight
, "German (Luxembourg)")
3609 LNG(wxLANGUAGE_GERMAN_SWISS
, "de_CH", LANG_GERMAN
, SUBLANG_GERMAN_SWISS
, wxLayout_LeftToRight
, "German (Swiss)")
3610 LNG(wxLANGUAGE_GREEK
, "el_GR", LANG_GREEK
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Greek")
3611 LNG(wxLANGUAGE_GREENLANDIC
, "kl_GL", 0 , 0 , wxLayout_LeftToRight
, "Greenlandic")
3612 LNG(wxLANGUAGE_GUARANI
, "gn" , 0 , 0 , wxLayout_LeftToRight
, "Guarani")
3613 LNG(wxLANGUAGE_GUJARATI
, "gu" , LANG_GUJARATI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Gujarati")
3614 LNG(wxLANGUAGE_HAUSA
, "ha" , 0 , 0 , wxLayout_LeftToRight
, "Hausa")
3615 LNG(wxLANGUAGE_HEBREW
, "he_IL", LANG_HEBREW
, SUBLANG_DEFAULT
, wxLayout_RightToLeft
, "Hebrew")
3616 LNG(wxLANGUAGE_HINDI
, "hi_IN", LANG_HINDI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Hindi")
3617 LNG(wxLANGUAGE_HUNGARIAN
, "hu_HU", LANG_HUNGARIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Hungarian")
3618 LNG(wxLANGUAGE_ICELANDIC
, "is_IS", LANG_ICELANDIC
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Icelandic")
3619 LNG(wxLANGUAGE_INDONESIAN
, "id_ID", LANG_INDONESIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Indonesian")
3620 LNG(wxLANGUAGE_INTERLINGUA
, "ia" , 0 , 0 , wxLayout_LeftToRight
, "Interlingua")
3621 LNG(wxLANGUAGE_INTERLINGUE
, "ie" , 0 , 0 , wxLayout_LeftToRight
, "Interlingue")
3622 LNG(wxLANGUAGE_INUKTITUT
, "iu" , 0 , 0 , wxLayout_LeftToRight
, "Inuktitut")
3623 LNG(wxLANGUAGE_INUPIAK
, "ik" , 0 , 0 , wxLayout_LeftToRight
, "Inupiak")
3624 LNG(wxLANGUAGE_IRISH
, "ga_IE", 0 , 0 , wxLayout_LeftToRight
, "Irish")
3625 LNG(wxLANGUAGE_ITALIAN
, "it_IT", LANG_ITALIAN
, SUBLANG_ITALIAN
, wxLayout_LeftToRight
, "Italian")
3626 LNG(wxLANGUAGE_ITALIAN_SWISS
, "it_CH", LANG_ITALIAN
, SUBLANG_ITALIAN_SWISS
, wxLayout_LeftToRight
, "Italian (Swiss)")
3627 LNG(wxLANGUAGE_JAPANESE
, "ja_JP", LANG_JAPANESE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Japanese")
3628 LNG(wxLANGUAGE_JAVANESE
, "jw" , 0 , 0 , wxLayout_LeftToRight
, "Javanese")
3629 LNG(wxLANGUAGE_KANNADA
, "kn" , LANG_KANNADA
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Kannada")
3630 LNG(wxLANGUAGE_KASHMIRI
, "ks" , LANG_KASHMIRI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Kashmiri")
3631 LNG(wxLANGUAGE_KASHMIRI_INDIA
, "ks_IN", LANG_KASHMIRI
, SUBLANG_KASHMIRI_INDIA
, wxLayout_LeftToRight
, "Kashmiri (India)")
3632 LNG(wxLANGUAGE_KAZAKH
, "kk" , LANG_KAZAK
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Kazakh")
3633 LNG(wxLANGUAGE_KERNEWEK
, "kw_GB", 0 , 0 , wxLayout_LeftToRight
, "Kernewek")
3634 LNG(wxLANGUAGE_KINYARWANDA
, "rw" , 0 , 0 , wxLayout_LeftToRight
, "Kinyarwanda")
3635 LNG(wxLANGUAGE_KIRGHIZ
, "ky" , 0 , 0 , wxLayout_LeftToRight
, "Kirghiz")
3636 LNG(wxLANGUAGE_KIRUNDI
, "rn" , 0 , 0 , wxLayout_LeftToRight
, "Kirundi")
3637 LNG(wxLANGUAGE_KONKANI
, "" , LANG_KONKANI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Konkani")
3638 LNG(wxLANGUAGE_KOREAN
, "ko_KR", LANG_KOREAN
, SUBLANG_KOREAN
, wxLayout_LeftToRight
, "Korean")
3639 LNG(wxLANGUAGE_KURDISH
, "ku" , 0 , 0 , wxLayout_LeftToRight
, "Kurdish")
3640 LNG(wxLANGUAGE_LAOTHIAN
, "lo" , 0 , 0 , wxLayout_LeftToRight
, "Laothian")
3641 LNG(wxLANGUAGE_LATIN
, "la" , 0 , 0 , wxLayout_LeftToRight
, "Latin")
3642 LNG(wxLANGUAGE_LATVIAN
, "lv_LV", LANG_LATVIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Latvian")
3643 LNG(wxLANGUAGE_LINGALA
, "ln" , 0 , 0 , wxLayout_LeftToRight
, "Lingala")
3644 LNG(wxLANGUAGE_LITHUANIAN
, "lt_LT", LANG_LITHUANIAN
, SUBLANG_LITHUANIAN
, wxLayout_LeftToRight
, "Lithuanian")
3645 LNG(wxLANGUAGE_MACEDONIAN
, "mk_MK", LANG_MACEDONIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Macedonian")
3646 LNG(wxLANGUAGE_MALAGASY
, "mg" , 0 , 0 , wxLayout_LeftToRight
, "Malagasy")
3647 LNG(wxLANGUAGE_MALAY
, "ms_MY", LANG_MALAY
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Malay")
3648 LNG(wxLANGUAGE_MALAYALAM
, "ml" , LANG_MALAYALAM
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Malayalam")
3649 LNG(wxLANGUAGE_MALAY_BRUNEI_DARUSSALAM
, "ms_BN", LANG_MALAY
, SUBLANG_MALAY_BRUNEI_DARUSSALAM
, wxLayout_LeftToRight
, "Malay (Brunei Darussalam)")
3650 LNG(wxLANGUAGE_MALAY_MALAYSIA
, "ms_MY", LANG_MALAY
, SUBLANG_MALAY_MALAYSIA
, wxLayout_LeftToRight
, "Malay (Malaysia)")
3651 LNG(wxLANGUAGE_MALTESE
, "mt_MT", 0 , 0 , wxLayout_LeftToRight
, "Maltese")
3652 LNG(wxLANGUAGE_MANIPURI
, "" , LANG_MANIPURI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Manipuri")
3653 LNG(wxLANGUAGE_MAORI
, "mi" , 0 , 0 , wxLayout_LeftToRight
, "Maori")
3654 LNG(wxLANGUAGE_MARATHI
, "mr_IN", LANG_MARATHI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Marathi")
3655 LNG(wxLANGUAGE_MOLDAVIAN
, "mo" , 0 , 0 , wxLayout_LeftToRight
, "Moldavian")
3656 LNG(wxLANGUAGE_MONGOLIAN
, "mn" , 0 , 0 , wxLayout_LeftToRight
, "Mongolian")
3657 LNG(wxLANGUAGE_NAURU
, "na" , 0 , 0 , wxLayout_LeftToRight
, "Nauru")
3658 LNG(wxLANGUAGE_NEPALI
, "ne" , LANG_NEPALI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Nepali")
3659 LNG(wxLANGUAGE_NEPALI_INDIA
, "ne_IN", LANG_NEPALI
, SUBLANG_NEPALI_INDIA
, wxLayout_LeftToRight
, "Nepali (India)")
3660 LNG(wxLANGUAGE_NORWEGIAN_BOKMAL
, "nb_NO", LANG_NORWEGIAN
, SUBLANG_NORWEGIAN_BOKMAL
, wxLayout_LeftToRight
, "Norwegian (Bokmal)")
3661 LNG(wxLANGUAGE_NORWEGIAN_NYNORSK
, "nn_NO", LANG_NORWEGIAN
, SUBLANG_NORWEGIAN_NYNORSK
, wxLayout_LeftToRight
, "Norwegian (Nynorsk)")
3662 LNG(wxLANGUAGE_OCCITAN
, "oc" , 0 , 0 , wxLayout_LeftToRight
, "Occitan")
3663 LNG(wxLANGUAGE_ORIYA
, "or" , LANG_ORIYA
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Oriya")
3664 LNG(wxLANGUAGE_OROMO
, "om" , 0 , 0 , wxLayout_LeftToRight
, "(Afan) Oromo")
3665 LNG(wxLANGUAGE_PASHTO
, "ps" , 0 , 0 , wxLayout_LeftToRight
, "Pashto, Pushto")
3666 LNG(wxLANGUAGE_POLISH
, "pl_PL", LANG_POLISH
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Polish")
3667 LNG(wxLANGUAGE_PORTUGUESE
, "pt_PT", LANG_PORTUGUESE
, SUBLANG_PORTUGUESE
, wxLayout_LeftToRight
, "Portuguese")
3668 LNG(wxLANGUAGE_PORTUGUESE_BRAZILIAN
, "pt_BR", LANG_PORTUGUESE
, SUBLANG_PORTUGUESE_BRAZILIAN
, wxLayout_LeftToRight
, "Portuguese (Brazilian)")
3669 LNG(wxLANGUAGE_PUNJABI
, "pa" , LANG_PUNJABI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Punjabi")
3670 LNG(wxLANGUAGE_QUECHUA
, "qu" , 0 , 0 , wxLayout_LeftToRight
, "Quechua")
3671 LNG(wxLANGUAGE_RHAETO_ROMANCE
, "rm" , 0 , 0 , wxLayout_LeftToRight
, "Rhaeto-Romance")
3672 LNG(wxLANGUAGE_ROMANIAN
, "ro_RO", LANG_ROMANIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Romanian")
3673 LNG(wxLANGUAGE_RUSSIAN
, "ru_RU", LANG_RUSSIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Russian")
3674 LNG(wxLANGUAGE_RUSSIAN_UKRAINE
, "ru_UA", 0 , 0 , wxLayout_LeftToRight
, "Russian (Ukraine)")
3675 LNG(wxLANGUAGE_SAMOAN
, "sm" , 0 , 0 , wxLayout_LeftToRight
, "Samoan")
3676 LNG(wxLANGUAGE_SANGHO
, "sg" , 0 , 0 , wxLayout_LeftToRight
, "Sangho")
3677 LNG(wxLANGUAGE_SANSKRIT
, "sa" , LANG_SANSKRIT
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Sanskrit")
3678 LNG(wxLANGUAGE_SCOTS_GAELIC
, "gd" , 0 , 0 , wxLayout_LeftToRight
, "Scots Gaelic")
3679 LNG(wxLANGUAGE_SERBIAN_CYRILLIC
, "sr_YU", LANG_SERBIAN
, SUBLANG_SERBIAN_CYRILLIC
, wxLayout_LeftToRight
, "Serbian (Cyrillic)")
3680 LNG(wxLANGUAGE_SERBIAN_LATIN
, "sr_YU", LANG_SERBIAN
, SUBLANG_SERBIAN_LATIN
, wxLayout_LeftToRight
, "Serbian (Latin)")
3681 LNG(wxLANGUAGE_SERBO_CROATIAN
, "sh" , 0 , 0 , wxLayout_LeftToRight
, "Serbo-Croatian")
3682 LNG(wxLANGUAGE_SESOTHO
, "st" , 0 , 0 , wxLayout_LeftToRight
, "Sesotho")
3683 LNG(wxLANGUAGE_SETSWANA
, "tn" , 0 , 0 , wxLayout_LeftToRight
, "Setswana")
3684 LNG(wxLANGUAGE_SHONA
, "sn" , 0 , 0 , wxLayout_LeftToRight
, "Shona")
3685 LNG(wxLANGUAGE_SINDHI
, "sd" , LANG_SINDHI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Sindhi")
3686 LNG(wxLANGUAGE_SINHALESE
, "si" , 0 , 0 , wxLayout_LeftToRight
, "Sinhalese")
3687 LNG(wxLANGUAGE_SISWATI
, "ss" , 0 , 0 , wxLayout_LeftToRight
, "Siswati")
3688 LNG(wxLANGUAGE_SLOVAK
, "sk_SK", LANG_SLOVAK
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Slovak")
3689 LNG(wxLANGUAGE_SLOVENIAN
, "sl_SI", LANG_SLOVENIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Slovenian")
3690 LNG(wxLANGUAGE_SOMALI
, "so" , 0 , 0 , wxLayout_LeftToRight
, "Somali")
3691 LNG(wxLANGUAGE_SPANISH
, "es_ES", LANG_SPANISH
, SUBLANG_SPANISH
, wxLayout_LeftToRight
, "Spanish")
3692 LNG(wxLANGUAGE_SPANISH_ARGENTINA
, "es_AR", LANG_SPANISH
, SUBLANG_SPANISH_ARGENTINA
, wxLayout_LeftToRight
, "Spanish (Argentina)")
3693 LNG(wxLANGUAGE_SPANISH_BOLIVIA
, "es_BO", LANG_SPANISH
, SUBLANG_SPANISH_BOLIVIA
, wxLayout_LeftToRight
, "Spanish (Bolivia)")
3694 LNG(wxLANGUAGE_SPANISH_CHILE
, "es_CL", LANG_SPANISH
, SUBLANG_SPANISH_CHILE
, wxLayout_LeftToRight
, "Spanish (Chile)")
3695 LNG(wxLANGUAGE_SPANISH_COLOMBIA
, "es_CO", LANG_SPANISH
, SUBLANG_SPANISH_COLOMBIA
, wxLayout_LeftToRight
, "Spanish (Colombia)")
3696 LNG(wxLANGUAGE_SPANISH_COSTA_RICA
, "es_CR", LANG_SPANISH
, SUBLANG_SPANISH_COSTA_RICA
, wxLayout_LeftToRight
, "Spanish (Costa Rica)")
3697 LNG(wxLANGUAGE_SPANISH_DOMINICAN_REPUBLIC
, "es_DO", LANG_SPANISH
, SUBLANG_SPANISH_DOMINICAN_REPUBLIC
, wxLayout_LeftToRight
, "Spanish (Dominican republic)")
3698 LNG(wxLANGUAGE_SPANISH_ECUADOR
, "es_EC", LANG_SPANISH
, SUBLANG_SPANISH_ECUADOR
, wxLayout_LeftToRight
, "Spanish (Ecuador)")
3699 LNG(wxLANGUAGE_SPANISH_EL_SALVADOR
, "es_SV", LANG_SPANISH
, SUBLANG_SPANISH_EL_SALVADOR
, wxLayout_LeftToRight
, "Spanish (El Salvador)")
3700 LNG(wxLANGUAGE_SPANISH_GUATEMALA
, "es_GT", LANG_SPANISH
, SUBLANG_SPANISH_GUATEMALA
, wxLayout_LeftToRight
, "Spanish (Guatemala)")
3701 LNG(wxLANGUAGE_SPANISH_HONDURAS
, "es_HN", LANG_SPANISH
, SUBLANG_SPANISH_HONDURAS
, wxLayout_LeftToRight
, "Spanish (Honduras)")
3702 LNG(wxLANGUAGE_SPANISH_MEXICAN
, "es_MX", LANG_SPANISH
, SUBLANG_SPANISH_MEXICAN
, wxLayout_LeftToRight
, "Spanish (Mexican)")
3703 LNG(wxLANGUAGE_SPANISH_MODERN
, "es_ES", LANG_SPANISH
, SUBLANG_SPANISH_MODERN
, wxLayout_LeftToRight
, "Spanish (Modern)")
3704 LNG(wxLANGUAGE_SPANISH_NICARAGUA
, "es_NI", LANG_SPANISH
, SUBLANG_SPANISH_NICARAGUA
, wxLayout_LeftToRight
, "Spanish (Nicaragua)")
3705 LNG(wxLANGUAGE_SPANISH_PANAMA
, "es_PA", LANG_SPANISH
, SUBLANG_SPANISH_PANAMA
, wxLayout_LeftToRight
, "Spanish (Panama)")
3706 LNG(wxLANGUAGE_SPANISH_PARAGUAY
, "es_PY", LANG_SPANISH
, SUBLANG_SPANISH_PARAGUAY
, wxLayout_LeftToRight
, "Spanish (Paraguay)")
3707 LNG(wxLANGUAGE_SPANISH_PERU
, "es_PE", LANG_SPANISH
, SUBLANG_SPANISH_PERU
, wxLayout_LeftToRight
, "Spanish (Peru)")
3708 LNG(wxLANGUAGE_SPANISH_PUERTO_RICO
, "es_PR", LANG_SPANISH
, SUBLANG_SPANISH_PUERTO_RICO
, wxLayout_LeftToRight
, "Spanish (Puerto Rico)")
3709 LNG(wxLANGUAGE_SPANISH_URUGUAY
, "es_UY", LANG_SPANISH
, SUBLANG_SPANISH_URUGUAY
, wxLayout_LeftToRight
, "Spanish (Uruguay)")
3710 LNG(wxLANGUAGE_SPANISH_US
, "es_US", 0 , 0 , wxLayout_LeftToRight
, "Spanish (U.S.)")
3711 LNG(wxLANGUAGE_SPANISH_VENEZUELA
, "es_VE", LANG_SPANISH
, SUBLANG_SPANISH_VENEZUELA
, wxLayout_LeftToRight
, "Spanish (Venezuela)")
3712 LNG(wxLANGUAGE_SUNDANESE
, "su" , 0 , 0 , wxLayout_LeftToRight
, "Sundanese")
3713 LNG(wxLANGUAGE_SWAHILI
, "sw_KE", LANG_SWAHILI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Swahili")
3714 LNG(wxLANGUAGE_SWEDISH
, "sv_SE", LANG_SWEDISH
, SUBLANG_SWEDISH
, wxLayout_LeftToRight
, "Swedish")
3715 LNG(wxLANGUAGE_SWEDISH_FINLAND
, "sv_FI", LANG_SWEDISH
, SUBLANG_SWEDISH_FINLAND
, wxLayout_LeftToRight
, "Swedish (Finland)")
3716 LNG(wxLANGUAGE_TAGALOG
, "tl_PH", 0 , 0 , wxLayout_LeftToRight
, "Tagalog")
3717 LNG(wxLANGUAGE_TAJIK
, "tg" , 0 , 0 , wxLayout_LeftToRight
, "Tajik")
3718 LNG(wxLANGUAGE_TAMIL
, "ta" , LANG_TAMIL
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Tamil")
3719 LNG(wxLANGUAGE_TATAR
, "tt" , LANG_TATAR
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Tatar")
3720 LNG(wxLANGUAGE_TELUGU
, "te" , LANG_TELUGU
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Telugu")
3721 LNG(wxLANGUAGE_THAI
, "th_TH", LANG_THAI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Thai")
3722 LNG(wxLANGUAGE_TIBETAN
, "bo" , 0 , 0 , wxLayout_LeftToRight
, "Tibetan")
3723 LNG(wxLANGUAGE_TIGRINYA
, "ti" , 0 , 0 , wxLayout_LeftToRight
, "Tigrinya")
3724 LNG(wxLANGUAGE_TONGA
, "to" , 0 , 0 , wxLayout_LeftToRight
, "Tonga")
3725 LNG(wxLANGUAGE_TSONGA
, "ts" , 0 , 0 , wxLayout_LeftToRight
, "Tsonga")
3726 LNG(wxLANGUAGE_TURKISH
, "tr_TR", LANG_TURKISH
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Turkish")
3727 LNG(wxLANGUAGE_TURKMEN
, "tk" , 0 , 0 , wxLayout_LeftToRight
, "Turkmen")
3728 LNG(wxLANGUAGE_TWI
, "tw" , 0 , 0 , wxLayout_LeftToRight
, "Twi")
3729 LNG(wxLANGUAGE_UIGHUR
, "ug" , 0 , 0 , wxLayout_LeftToRight
, "Uighur")
3730 LNG(wxLANGUAGE_UKRAINIAN
, "uk_UA", LANG_UKRAINIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Ukrainian")
3731 LNG(wxLANGUAGE_URDU
, "ur" , LANG_URDU
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Urdu")
3732 LNG(wxLANGUAGE_URDU_INDIA
, "ur_IN", LANG_URDU
, SUBLANG_URDU_INDIA
, wxLayout_LeftToRight
, "Urdu (India)")
3733 LNG(wxLANGUAGE_URDU_PAKISTAN
, "ur_PK", LANG_URDU
, SUBLANG_URDU_PAKISTAN
, wxLayout_LeftToRight
, "Urdu (Pakistan)")
3734 LNG(wxLANGUAGE_UZBEK
, "uz" , LANG_UZBEK
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Uzbek")
3735 LNG(wxLANGUAGE_UZBEK_CYRILLIC
, "uz" , LANG_UZBEK
, SUBLANG_UZBEK_CYRILLIC
, wxLayout_LeftToRight
, "Uzbek (Cyrillic)")
3736 LNG(wxLANGUAGE_UZBEK_LATIN
, "uz" , LANG_UZBEK
, SUBLANG_UZBEK_LATIN
, wxLayout_LeftToRight
, "Uzbek (Latin)")
3737 LNG(wxLANGUAGE_VIETNAMESE
, "vi_VN", LANG_VIETNAMESE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Vietnamese")
3738 LNG(wxLANGUAGE_VOLAPUK
, "vo" , 0 , 0 , wxLayout_LeftToRight
, "Volapuk")
3739 LNG(wxLANGUAGE_WELSH
, "cy" , 0 , 0 , wxLayout_LeftToRight
, "Welsh")
3740 LNG(wxLANGUAGE_WOLOF
, "wo" , 0 , 0 , wxLayout_LeftToRight
, "Wolof")
3741 LNG(wxLANGUAGE_XHOSA
, "xh" , 0 , 0 , wxLayout_LeftToRight
, "Xhosa")
3742 LNG(wxLANGUAGE_YIDDISH
, "yi" , 0 , 0 , wxLayout_LeftToRight
, "Yiddish")
3743 LNG(wxLANGUAGE_YORUBA
, "yo" , 0 , 0 , wxLayout_LeftToRight
, "Yoruba")
3744 LNG(wxLANGUAGE_ZHUANG
, "za" , 0 , 0 , wxLayout_LeftToRight
, "Zhuang")
3745 LNG(wxLANGUAGE_ZULU
, "zu" , 0 , 0 , wxLayout_LeftToRight
, "Zulu")
3749 // --- --- --- generated code ends here --- --- ---
3751 #endif // wxUSE_INTL