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 ;
2476 encoding
= CFStringGetSystemEncoding() ;
2478 UpgradeScriptInfoToTextEncoding ( smSystemScript
, kTextLanguageDontCare
, kTextRegionDontCare
, NULL
, &encoding
) ;
2480 return wxMacGetFontEncFromSystemEnc( encoding
) ;
2481 #elif defined(__UNIX_LIKE__) && wxUSE_FONTMAP
2482 const wxString encname
= GetSystemEncodingName();
2483 if ( !encname
.empty() )
2485 wxFontEncoding enc
= wxFontMapperBase::GetEncodingFromName(encname
);
2487 // on some modern Linux systems (RedHat 8) the default system locale
2488 // is UTF8 -- but it isn't supported by wxGTK1 in ANSI build at all so
2489 // don't even try to use it in this case
2490 #if !wxUSE_UNICODE && \
2491 ((defined(__WXGTK__) && !defined(__WXGTK20__)) || defined(__WXMOTIF__))
2492 if ( enc
== wxFONTENCODING_UTF8
)
2494 // the most similar supported encoding...
2495 enc
= wxFONTENCODING_ISO8859_1
;
2497 #endif // !wxUSE_UNICODE
2499 // GetEncodingFromName() returns wxFONTENCODING_DEFAULT for C locale
2500 // (a.k.a. US-ASCII) which is arguably a bug but keep it like this for
2501 // backwards compatibility and just take care to not return
2502 // wxFONTENCODING_DEFAULT from here as this surely doesn't make sense
2503 if ( enc
== wxFONTENCODING_DEFAULT
)
2505 // we don't have wxFONTENCODING_ASCII, so use the closest one
2506 return wxFONTENCODING_ISO8859_1
;
2509 if ( enc
!= wxFONTENCODING_MAX
)
2513 //else: return wxFONTENCODING_SYSTEM below
2515 #endif // Win32/Unix
2517 return wxFONTENCODING_SYSTEM
;
2521 void wxLocale::AddLanguage(const wxLanguageInfo
& info
)
2523 CreateLanguagesDB();
2524 ms_languagesDB
->Add(info
);
2528 const wxLanguageInfo
*wxLocale::GetLanguageInfo(int lang
)
2530 CreateLanguagesDB();
2532 // calling GetLanguageInfo(wxLANGUAGE_DEFAULT) is a natural thing to do, so
2534 if ( lang
== wxLANGUAGE_DEFAULT
)
2535 lang
= GetSystemLanguage();
2537 const size_t count
= ms_languagesDB
->GetCount();
2538 for ( size_t i
= 0; i
< count
; i
++ )
2540 if ( ms_languagesDB
->Item(i
).Language
== lang
)
2542 // We need to create a temporary here in order to make this work with BCC in final build mode
2543 wxLanguageInfo
*ptr
= &ms_languagesDB
->Item(i
);
2552 wxString
wxLocale::GetLanguageName(int lang
)
2554 const wxLanguageInfo
*info
= GetLanguageInfo(lang
);
2556 return wxEmptyString
;
2558 return info
->Description
;
2562 const wxLanguageInfo
*wxLocale::FindLanguageInfo(const wxString
& locale
)
2564 CreateLanguagesDB();
2566 const wxLanguageInfo
*infoRet
= NULL
;
2568 const size_t count
= ms_languagesDB
->GetCount();
2569 for ( size_t i
= 0; i
< count
; i
++ )
2571 const wxLanguageInfo
*info
= &ms_languagesDB
->Item(i
);
2573 if ( wxStricmp(locale
, info
->CanonicalName
) == 0 ||
2574 wxStricmp(locale
, info
->Description
) == 0 )
2576 // exact match, stop searching
2581 if ( wxStricmp(locale
, info
->CanonicalName
.BeforeFirst(_T('_'))) == 0 )
2583 // a match -- but maybe we'll find an exact one later, so continue
2586 // OTOH, maybe we had already found a language match and in this
2587 // case don't overwrite it because the entry for the default
2588 // country always appears first in ms_languagesDB
2597 wxString
wxLocale::GetSysName() const
2601 return wxSetlocale(LC_ALL
, NULL
);
2603 return wxEmptyString
;
2608 wxLocale::~wxLocale()
2611 wxMsgCatalog
*pTmpCat
;
2612 while ( m_pMsgCat
!= NULL
) {
2613 pTmpCat
= m_pMsgCat
;
2614 m_pMsgCat
= m_pMsgCat
->m_pNext
;
2618 // restore old locale pointer
2619 wxSetLocale(m_pOldLocale
);
2623 wxSetlocale(LC_ALL
, m_pszOldLocale
);
2625 free((wxChar
*)m_pszOldLocale
); // const_cast
2628 // get the translation of given string in current locale
2629 const wxString
& wxLocale::GetString(const wxString
& origString
,
2630 const wxString
& domain
) const
2632 return GetString(origString
, origString
, size_t(-1), domain
);
2635 const wxString
& wxLocale::GetString(const wxString
& origString
,
2636 const wxString
& origString2
,
2638 const wxString
& domain
) const
2640 if ( origString
.empty() )
2641 return GetUntranslatedString(origString
);
2643 const wxString
*trans
= NULL
;
2644 wxMsgCatalog
*pMsgCat
;
2646 if ( !domain
.empty() )
2648 pMsgCat
= FindCatalog(domain
);
2650 // does the catalog exist?
2651 if ( pMsgCat
!= NULL
)
2652 trans
= pMsgCat
->GetString(origString
, n
);
2656 // search in all domains
2657 for ( pMsgCat
= m_pMsgCat
; pMsgCat
!= NULL
; pMsgCat
= pMsgCat
->m_pNext
)
2659 trans
= pMsgCat
->GetString(origString
, n
);
2660 if ( trans
!= NULL
) // take the first found
2665 if ( trans
== NULL
)
2668 if ( !NoTransErr::Suppress() )
2670 NoTransErr noTransErr
;
2672 wxLogTrace(TRACE_I18N
,
2673 _T("string \"%s\"[%ld] not found in %slocale '%s'."),
2674 origString
, (long)n
,
2676 ? (const wxChar
*)wxString::Format(_T("domain '%s' "), domain
).c_str()
2678 m_strLocale
.c_str());
2680 #endif // __WXDEBUG__
2682 if (n
== size_t(-1))
2683 return GetUntranslatedString(origString
);
2685 return GetUntranslatedString(n
== 1 ? origString
: origString2
);
2691 WX_DECLARE_HASH_SET(wxString
, wxStringHash
, wxStringEqual
,
2692 wxLocaleUntranslatedStrings
);
2695 const wxString
& wxLocale::GetUntranslatedString(const wxString
& str
)
2697 static wxLocaleUntranslatedStrings s_strings
;
2699 wxLocaleUntranslatedStrings::iterator i
= s_strings
.find(str
);
2700 if ( i
== s_strings
.end() )
2701 return *s_strings
.insert(str
).first
;
2706 wxString
wxLocale::GetHeaderValue(const wxString
& header
,
2707 const wxString
& domain
) const
2709 if ( header
.empty() )
2710 return wxEmptyString
;
2712 const wxString
*trans
= NULL
;
2713 wxMsgCatalog
*pMsgCat
;
2715 if ( !domain
.empty() )
2717 pMsgCat
= FindCatalog(domain
);
2719 // does the catalog exist?
2720 if ( pMsgCat
== NULL
)
2721 return wxEmptyString
;
2723 trans
= pMsgCat
->GetString(wxEmptyString
, (size_t)-1);
2727 // search in all domains
2728 for ( pMsgCat
= m_pMsgCat
; pMsgCat
!= NULL
; pMsgCat
= pMsgCat
->m_pNext
)
2730 trans
= pMsgCat
->GetString(wxEmptyString
, (size_t)-1);
2731 if ( trans
!= NULL
) // take the first found
2736 if ( !trans
|| trans
->empty() )
2737 return wxEmptyString
;
2739 size_t found
= trans
->find(header
);
2740 if ( found
== wxString::npos
)
2741 return wxEmptyString
;
2743 found
+= header
.length() + 2 /* ': ' */;
2745 // Every header is separated by \n
2747 size_t endLine
= trans
->find(wxT('\n'), found
);
2748 size_t len
= (endLine
== wxString::npos
) ?
2749 wxString::npos
: (endLine
- found
);
2751 return trans
->substr(found
, len
);
2755 // find catalog by name in a linked list, return NULL if !found
2756 wxMsgCatalog
*wxLocale::FindCatalog(const wxString
& domain
) const
2758 // linear search in the linked list
2759 wxMsgCatalog
*pMsgCat
;
2760 for ( pMsgCat
= m_pMsgCat
; pMsgCat
!= NULL
; pMsgCat
= pMsgCat
->m_pNext
)
2762 if ( pMsgCat
->GetName() == domain
)
2769 // check if the given locale is provided by OS and C run time
2771 bool wxLocale::IsAvailable(int lang
)
2773 const wxLanguageInfo
*info
= wxLocale::GetLanguageInfo(lang
);
2774 wxCHECK_MSG( info
, false, _T("invalid language") );
2776 #if defined(__WIN32__)
2777 if ( !info
->WinLang
)
2780 if ( !::IsValidLocale
2782 MAKELCID(MAKELANGID(info
->WinLang
, info
->WinSublang
),
2788 #elif defined(__UNIX__)
2790 // Test if setting the locale works, then set it back.
2791 const char *oldLocale
= wxSetlocale(LC_ALL
, "");
2792 const char *tmp
= wxSetlocaleTryUTF8(LC_ALL
, info
->CanonicalName
);
2795 // Some C libraries don't like xx_YY form and require xx only
2796 tmp
= wxSetlocaleTryUTF8(LC_ALL
, info
->CanonicalName
.Left(2));
2800 // restore the original locale
2801 wxSetlocale(LC_ALL
, oldLocale
);
2807 // check if the given catalog is loaded
2808 bool wxLocale::IsLoaded(const wxString
& szDomain
) const
2810 return FindCatalog(szDomain
) != NULL
;
2813 // add a catalog to our linked list
2814 bool wxLocale::AddCatalog(const wxString
& szDomain
)
2816 return AddCatalog(szDomain
, wxLANGUAGE_ENGLISH_US
, wxEmptyString
);
2819 // add a catalog to our linked list
2820 bool wxLocale::AddCatalog(const wxString
& szDomain
,
2821 wxLanguage msgIdLanguage
,
2822 const wxString
& msgIdCharset
)
2825 wxMsgCatalog
*pMsgCat
= new wxMsgCatalog
;
2827 if ( pMsgCat
->Load(m_strShort
, szDomain
, msgIdCharset
, m_bConvertEncoding
) ) {
2828 // add it to the head of the list so that in GetString it will
2829 // be searched before the catalogs added earlier
2830 pMsgCat
->m_pNext
= m_pMsgCat
;
2831 m_pMsgCat
= pMsgCat
;
2836 // don't add it because it couldn't be loaded anyway
2839 // It is OK to not load catalog if the msgid language and m_language match,
2840 // in which case we can directly display the texts embedded in program's
2842 if (m_language
== msgIdLanguage
)
2845 // If there's no exact match, we may still get partial match where the
2846 // (basic) language is same, but the country differs. For example, it's
2847 // permitted to use en_US strings from sources even if m_language is en_GB:
2848 const wxLanguageInfo
*msgIdLangInfo
= GetLanguageInfo(msgIdLanguage
);
2849 if ( msgIdLangInfo
&&
2850 msgIdLangInfo
->CanonicalName
.Mid(0, 2) == m_strShort
.Mid(0, 2) )
2859 // ----------------------------------------------------------------------------
2860 // accessors for locale-dependent data
2861 // ----------------------------------------------------------------------------
2866 wxString
wxLocale::GetInfo(wxLocaleInfo index
, wxLocaleCategory
WXUNUSED(cat
))
2871 buffer
[0] = wxT('\0');
2874 case wxLOCALE_DECIMAL_POINT
:
2875 count
= ::GetLocaleInfo(LOCALE_USER_DEFAULT
, LOCALE_SDECIMAL
, buffer
, 256);
2882 case wxSYS_LIST_SEPARATOR
:
2883 count
= ::GetLocaleInfo(LOCALE_USER_DEFAULT
, LOCALE_SLIST
, buffer
, 256);
2889 case wxSYS_LEADING_ZERO
: // 0 means no leading zero, 1 means leading zero
2890 count
= ::GetLocaleInfo(LOCALE_USER_DEFAULT
, LOCALE_ILZERO
, buffer
, 256);
2898 wxFAIL_MSG(wxT("Unknown System String !"));
2906 wxString
wxLocale::GetInfo(wxLocaleInfo index
, wxLocaleCategory cat
)
2908 struct lconv
*locale_info
= localeconv();
2911 case wxLOCALE_CAT_NUMBER
:
2914 case wxLOCALE_THOUSANDS_SEP
:
2915 return wxString(locale_info
->thousands_sep
,
2917 case wxLOCALE_DECIMAL_POINT
:
2918 return wxString(locale_info
->decimal_point
,
2921 return wxEmptyString
;
2923 case wxLOCALE_CAT_MONEY
:
2926 case wxLOCALE_THOUSANDS_SEP
:
2927 return wxString(locale_info
->mon_thousands_sep
,
2929 case wxLOCALE_DECIMAL_POINT
:
2930 return wxString(locale_info
->mon_decimal_point
,
2933 return wxEmptyString
;
2936 return wxEmptyString
;
2940 #endif // __WXMSW__/!__WXMSW__
2942 // ----------------------------------------------------------------------------
2943 // global functions and variables
2944 // ----------------------------------------------------------------------------
2946 // retrieve/change current locale
2947 // ------------------------------
2949 // the current locale object
2950 static wxLocale
*g_pLocale
= NULL
;
2952 wxLocale
*wxGetLocale()
2957 wxLocale
*wxSetLocale(wxLocale
*pLocale
)
2959 wxLocale
*pOld
= g_pLocale
;
2960 g_pLocale
= pLocale
;
2966 // ----------------------------------------------------------------------------
2967 // wxLocale module (for lazy destruction of languagesDB)
2968 // ----------------------------------------------------------------------------
2970 class wxLocaleModule
: public wxModule
2972 DECLARE_DYNAMIC_CLASS(wxLocaleModule
)
2975 bool OnInit() { return true; }
2976 void OnExit() { wxLocale::DestroyLanguagesDB(); }
2979 IMPLEMENT_DYNAMIC_CLASS(wxLocaleModule
, wxModule
)
2983 // ----------------------------------------------------------------------------
2984 // default languages table & initialization
2985 // ----------------------------------------------------------------------------
2989 // --- --- --- generated code begins here --- --- ---
2991 // This table is generated by misc/languages/genlang.py
2992 // When making changes, please put them into misc/languages/langtabl.txt
2994 #if !defined(__WIN32__) || defined(__WXMICROWIN__)
2996 #define SETWINLANG(info,lang,sublang)
3000 #define SETWINLANG(info,lang,sublang) \
3001 info.WinLang = lang, info.WinSublang = sublang;
3003 #ifndef LANG_AFRIKAANS
3004 #define LANG_AFRIKAANS (0)
3006 #ifndef LANG_ALBANIAN
3007 #define LANG_ALBANIAN (0)
3010 #define LANG_ARABIC (0)
3012 #ifndef LANG_ARMENIAN
3013 #define LANG_ARMENIAN (0)
3015 #ifndef LANG_ASSAMESE
3016 #define LANG_ASSAMESE (0)
3019 #define LANG_AZERI (0)
3022 #define LANG_BASQUE (0)
3024 #ifndef LANG_BELARUSIAN
3025 #define LANG_BELARUSIAN (0)
3027 #ifndef LANG_BENGALI
3028 #define LANG_BENGALI (0)
3030 #ifndef LANG_BULGARIAN
3031 #define LANG_BULGARIAN (0)
3033 #ifndef LANG_CATALAN
3034 #define LANG_CATALAN (0)
3036 #ifndef LANG_CHINESE
3037 #define LANG_CHINESE (0)
3039 #ifndef LANG_CROATIAN
3040 #define LANG_CROATIAN (0)
3043 #define LANG_CZECH (0)
3046 #define LANG_DANISH (0)
3049 #define LANG_DUTCH (0)
3051 #ifndef LANG_ENGLISH
3052 #define LANG_ENGLISH (0)
3054 #ifndef LANG_ESTONIAN
3055 #define LANG_ESTONIAN (0)
3057 #ifndef LANG_FAEROESE
3058 #define LANG_FAEROESE (0)
3061 #define LANG_FARSI (0)
3063 #ifndef LANG_FINNISH
3064 #define LANG_FINNISH (0)
3067 #define LANG_FRENCH (0)
3069 #ifndef LANG_GEORGIAN
3070 #define LANG_GEORGIAN (0)
3073 #define LANG_GERMAN (0)
3076 #define LANG_GREEK (0)
3078 #ifndef LANG_GUJARATI
3079 #define LANG_GUJARATI (0)
3082 #define LANG_HEBREW (0)
3085 #define LANG_HINDI (0)
3087 #ifndef LANG_HUNGARIAN
3088 #define LANG_HUNGARIAN (0)
3090 #ifndef LANG_ICELANDIC
3091 #define LANG_ICELANDIC (0)
3093 #ifndef LANG_INDONESIAN
3094 #define LANG_INDONESIAN (0)
3096 #ifndef LANG_ITALIAN
3097 #define LANG_ITALIAN (0)
3099 #ifndef LANG_JAPANESE
3100 #define LANG_JAPANESE (0)
3102 #ifndef LANG_KANNADA
3103 #define LANG_KANNADA (0)
3105 #ifndef LANG_KASHMIRI
3106 #define LANG_KASHMIRI (0)
3109 #define LANG_KAZAK (0)
3111 #ifndef LANG_KONKANI
3112 #define LANG_KONKANI (0)
3115 #define LANG_KOREAN (0)
3117 #ifndef LANG_LATVIAN
3118 #define LANG_LATVIAN (0)
3120 #ifndef LANG_LITHUANIAN
3121 #define LANG_LITHUANIAN (0)
3123 #ifndef LANG_MACEDONIAN
3124 #define LANG_MACEDONIAN (0)
3127 #define LANG_MALAY (0)
3129 #ifndef LANG_MALAYALAM
3130 #define LANG_MALAYALAM (0)
3132 #ifndef LANG_MANIPURI
3133 #define LANG_MANIPURI (0)
3135 #ifndef LANG_MARATHI
3136 #define LANG_MARATHI (0)
3139 #define LANG_NEPALI (0)
3141 #ifndef LANG_NORWEGIAN
3142 #define LANG_NORWEGIAN (0)
3145 #define LANG_ORIYA (0)
3148 #define LANG_POLISH (0)
3150 #ifndef LANG_PORTUGUESE
3151 #define LANG_PORTUGUESE (0)
3153 #ifndef LANG_PUNJABI
3154 #define LANG_PUNJABI (0)
3156 #ifndef LANG_ROMANIAN
3157 #define LANG_ROMANIAN (0)
3159 #ifndef LANG_RUSSIAN
3160 #define LANG_RUSSIAN (0)
3162 #ifndef LANG_SANSKRIT
3163 #define LANG_SANSKRIT (0)
3165 #ifndef LANG_SERBIAN
3166 #define LANG_SERBIAN (0)
3169 #define LANG_SINDHI (0)
3172 #define LANG_SLOVAK (0)
3174 #ifndef LANG_SLOVENIAN
3175 #define LANG_SLOVENIAN (0)
3177 #ifndef LANG_SPANISH
3178 #define LANG_SPANISH (0)
3180 #ifndef LANG_SWAHILI
3181 #define LANG_SWAHILI (0)
3183 #ifndef LANG_SWEDISH
3184 #define LANG_SWEDISH (0)
3187 #define LANG_TAMIL (0)
3190 #define LANG_TATAR (0)
3193 #define LANG_TELUGU (0)
3196 #define LANG_THAI (0)
3198 #ifndef LANG_TURKISH
3199 #define LANG_TURKISH (0)
3201 #ifndef LANG_UKRAINIAN
3202 #define LANG_UKRAINIAN (0)
3205 #define LANG_URDU (0)
3208 #define LANG_UZBEK (0)
3210 #ifndef LANG_VIETNAMESE
3211 #define LANG_VIETNAMESE (0)
3213 #ifndef SUBLANG_ARABIC_ALGERIA
3214 #define SUBLANG_ARABIC_ALGERIA SUBLANG_DEFAULT
3216 #ifndef SUBLANG_ARABIC_BAHRAIN
3217 #define SUBLANG_ARABIC_BAHRAIN SUBLANG_DEFAULT
3219 #ifndef SUBLANG_ARABIC_EGYPT
3220 #define SUBLANG_ARABIC_EGYPT SUBLANG_DEFAULT
3222 #ifndef SUBLANG_ARABIC_IRAQ
3223 #define SUBLANG_ARABIC_IRAQ SUBLANG_DEFAULT
3225 #ifndef SUBLANG_ARABIC_JORDAN
3226 #define SUBLANG_ARABIC_JORDAN SUBLANG_DEFAULT
3228 #ifndef SUBLANG_ARABIC_KUWAIT
3229 #define SUBLANG_ARABIC_KUWAIT SUBLANG_DEFAULT
3231 #ifndef SUBLANG_ARABIC_LEBANON
3232 #define SUBLANG_ARABIC_LEBANON SUBLANG_DEFAULT
3234 #ifndef SUBLANG_ARABIC_LIBYA
3235 #define SUBLANG_ARABIC_LIBYA SUBLANG_DEFAULT
3237 #ifndef SUBLANG_ARABIC_MOROCCO
3238 #define SUBLANG_ARABIC_MOROCCO SUBLANG_DEFAULT
3240 #ifndef SUBLANG_ARABIC_OMAN
3241 #define SUBLANG_ARABIC_OMAN SUBLANG_DEFAULT
3243 #ifndef SUBLANG_ARABIC_QATAR
3244 #define SUBLANG_ARABIC_QATAR SUBLANG_DEFAULT
3246 #ifndef SUBLANG_ARABIC_SAUDI_ARABIA
3247 #define SUBLANG_ARABIC_SAUDI_ARABIA SUBLANG_DEFAULT
3249 #ifndef SUBLANG_ARABIC_SYRIA
3250 #define SUBLANG_ARABIC_SYRIA SUBLANG_DEFAULT
3252 #ifndef SUBLANG_ARABIC_TUNISIA
3253 #define SUBLANG_ARABIC_TUNISIA SUBLANG_DEFAULT
3255 #ifndef SUBLANG_ARABIC_UAE
3256 #define SUBLANG_ARABIC_UAE SUBLANG_DEFAULT
3258 #ifndef SUBLANG_ARABIC_YEMEN
3259 #define SUBLANG_ARABIC_YEMEN SUBLANG_DEFAULT
3261 #ifndef SUBLANG_AZERI_CYRILLIC
3262 #define SUBLANG_AZERI_CYRILLIC SUBLANG_DEFAULT
3264 #ifndef SUBLANG_AZERI_LATIN
3265 #define SUBLANG_AZERI_LATIN SUBLANG_DEFAULT
3267 #ifndef SUBLANG_CHINESE_SIMPLIFIED
3268 #define SUBLANG_CHINESE_SIMPLIFIED SUBLANG_DEFAULT
3270 #ifndef SUBLANG_CHINESE_TRADITIONAL
3271 #define SUBLANG_CHINESE_TRADITIONAL SUBLANG_DEFAULT
3273 #ifndef SUBLANG_CHINESE_HONGKONG
3274 #define SUBLANG_CHINESE_HONGKONG SUBLANG_DEFAULT
3276 #ifndef SUBLANG_CHINESE_MACAU
3277 #define SUBLANG_CHINESE_MACAU SUBLANG_DEFAULT
3279 #ifndef SUBLANG_CHINESE_SINGAPORE
3280 #define SUBLANG_CHINESE_SINGAPORE SUBLANG_DEFAULT
3282 #ifndef SUBLANG_DUTCH
3283 #define SUBLANG_DUTCH SUBLANG_DEFAULT
3285 #ifndef SUBLANG_DUTCH_BELGIAN
3286 #define SUBLANG_DUTCH_BELGIAN SUBLANG_DEFAULT
3288 #ifndef SUBLANG_ENGLISH_UK
3289 #define SUBLANG_ENGLISH_UK SUBLANG_DEFAULT
3291 #ifndef SUBLANG_ENGLISH_US
3292 #define SUBLANG_ENGLISH_US SUBLANG_DEFAULT
3294 #ifndef SUBLANG_ENGLISH_AUS
3295 #define SUBLANG_ENGLISH_AUS SUBLANG_DEFAULT
3297 #ifndef SUBLANG_ENGLISH_BELIZE
3298 #define SUBLANG_ENGLISH_BELIZE SUBLANG_DEFAULT
3300 #ifndef SUBLANG_ENGLISH_CAN
3301 #define SUBLANG_ENGLISH_CAN SUBLANG_DEFAULT
3303 #ifndef SUBLANG_ENGLISH_CARIBBEAN
3304 #define SUBLANG_ENGLISH_CARIBBEAN SUBLANG_DEFAULT
3306 #ifndef SUBLANG_ENGLISH_EIRE
3307 #define SUBLANG_ENGLISH_EIRE SUBLANG_DEFAULT
3309 #ifndef SUBLANG_ENGLISH_JAMAICA
3310 #define SUBLANG_ENGLISH_JAMAICA SUBLANG_DEFAULT
3312 #ifndef SUBLANG_ENGLISH_NZ
3313 #define SUBLANG_ENGLISH_NZ SUBLANG_DEFAULT
3315 #ifndef SUBLANG_ENGLISH_PHILIPPINES
3316 #define SUBLANG_ENGLISH_PHILIPPINES SUBLANG_DEFAULT
3318 #ifndef SUBLANG_ENGLISH_SOUTH_AFRICA
3319 #define SUBLANG_ENGLISH_SOUTH_AFRICA SUBLANG_DEFAULT
3321 #ifndef SUBLANG_ENGLISH_TRINIDAD
3322 #define SUBLANG_ENGLISH_TRINIDAD SUBLANG_DEFAULT
3324 #ifndef SUBLANG_ENGLISH_ZIMBABWE
3325 #define SUBLANG_ENGLISH_ZIMBABWE SUBLANG_DEFAULT
3327 #ifndef SUBLANG_FRENCH
3328 #define SUBLANG_FRENCH SUBLANG_DEFAULT
3330 #ifndef SUBLANG_FRENCH_BELGIAN
3331 #define SUBLANG_FRENCH_BELGIAN SUBLANG_DEFAULT
3333 #ifndef SUBLANG_FRENCH_CANADIAN
3334 #define SUBLANG_FRENCH_CANADIAN SUBLANG_DEFAULT
3336 #ifndef SUBLANG_FRENCH_LUXEMBOURG
3337 #define SUBLANG_FRENCH_LUXEMBOURG SUBLANG_DEFAULT
3339 #ifndef SUBLANG_FRENCH_MONACO
3340 #define SUBLANG_FRENCH_MONACO SUBLANG_DEFAULT
3342 #ifndef SUBLANG_FRENCH_SWISS
3343 #define SUBLANG_FRENCH_SWISS SUBLANG_DEFAULT
3345 #ifndef SUBLANG_GERMAN
3346 #define SUBLANG_GERMAN SUBLANG_DEFAULT
3348 #ifndef SUBLANG_GERMAN_AUSTRIAN
3349 #define SUBLANG_GERMAN_AUSTRIAN SUBLANG_DEFAULT
3351 #ifndef SUBLANG_GERMAN_LIECHTENSTEIN
3352 #define SUBLANG_GERMAN_LIECHTENSTEIN SUBLANG_DEFAULT
3354 #ifndef SUBLANG_GERMAN_LUXEMBOURG
3355 #define SUBLANG_GERMAN_LUXEMBOURG SUBLANG_DEFAULT
3357 #ifndef SUBLANG_GERMAN_SWISS
3358 #define SUBLANG_GERMAN_SWISS SUBLANG_DEFAULT
3360 #ifndef SUBLANG_ITALIAN
3361 #define SUBLANG_ITALIAN SUBLANG_DEFAULT
3363 #ifndef SUBLANG_ITALIAN_SWISS
3364 #define SUBLANG_ITALIAN_SWISS SUBLANG_DEFAULT
3366 #ifndef SUBLANG_KASHMIRI_INDIA
3367 #define SUBLANG_KASHMIRI_INDIA SUBLANG_DEFAULT
3369 #ifndef SUBLANG_KOREAN
3370 #define SUBLANG_KOREAN SUBLANG_DEFAULT
3372 #ifndef SUBLANG_LITHUANIAN
3373 #define SUBLANG_LITHUANIAN SUBLANG_DEFAULT
3375 #ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM
3376 #define SUBLANG_MALAY_BRUNEI_DARUSSALAM SUBLANG_DEFAULT
3378 #ifndef SUBLANG_MALAY_MALAYSIA
3379 #define SUBLANG_MALAY_MALAYSIA SUBLANG_DEFAULT
3381 #ifndef SUBLANG_NEPALI_INDIA
3382 #define SUBLANG_NEPALI_INDIA SUBLANG_DEFAULT
3384 #ifndef SUBLANG_NORWEGIAN_BOKMAL
3385 #define SUBLANG_NORWEGIAN_BOKMAL SUBLANG_DEFAULT
3387 #ifndef SUBLANG_NORWEGIAN_NYNORSK
3388 #define SUBLANG_NORWEGIAN_NYNORSK SUBLANG_DEFAULT
3390 #ifndef SUBLANG_PORTUGUESE
3391 #define SUBLANG_PORTUGUESE SUBLANG_DEFAULT
3393 #ifndef SUBLANG_PORTUGUESE_BRAZILIAN
3394 #define SUBLANG_PORTUGUESE_BRAZILIAN SUBLANG_DEFAULT
3396 #ifndef SUBLANG_SERBIAN_CYRILLIC
3397 #define SUBLANG_SERBIAN_CYRILLIC SUBLANG_DEFAULT
3399 #ifndef SUBLANG_SERBIAN_LATIN
3400 #define SUBLANG_SERBIAN_LATIN SUBLANG_DEFAULT
3402 #ifndef SUBLANG_SPANISH
3403 #define SUBLANG_SPANISH SUBLANG_DEFAULT
3405 #ifndef SUBLANG_SPANISH_ARGENTINA
3406 #define SUBLANG_SPANISH_ARGENTINA SUBLANG_DEFAULT
3408 #ifndef SUBLANG_SPANISH_BOLIVIA
3409 #define SUBLANG_SPANISH_BOLIVIA SUBLANG_DEFAULT
3411 #ifndef SUBLANG_SPANISH_CHILE
3412 #define SUBLANG_SPANISH_CHILE SUBLANG_DEFAULT
3414 #ifndef SUBLANG_SPANISH_COLOMBIA
3415 #define SUBLANG_SPANISH_COLOMBIA SUBLANG_DEFAULT
3417 #ifndef SUBLANG_SPANISH_COSTA_RICA
3418 #define SUBLANG_SPANISH_COSTA_RICA SUBLANG_DEFAULT
3420 #ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC
3421 #define SUBLANG_SPANISH_DOMINICAN_REPUBLIC SUBLANG_DEFAULT
3423 #ifndef SUBLANG_SPANISH_ECUADOR
3424 #define SUBLANG_SPANISH_ECUADOR SUBLANG_DEFAULT
3426 #ifndef SUBLANG_SPANISH_EL_SALVADOR
3427 #define SUBLANG_SPANISH_EL_SALVADOR SUBLANG_DEFAULT
3429 #ifndef SUBLANG_SPANISH_GUATEMALA
3430 #define SUBLANG_SPANISH_GUATEMALA SUBLANG_DEFAULT
3432 #ifndef SUBLANG_SPANISH_HONDURAS
3433 #define SUBLANG_SPANISH_HONDURAS SUBLANG_DEFAULT
3435 #ifndef SUBLANG_SPANISH_MEXICAN
3436 #define SUBLANG_SPANISH_MEXICAN SUBLANG_DEFAULT
3438 #ifndef SUBLANG_SPANISH_MODERN
3439 #define SUBLANG_SPANISH_MODERN SUBLANG_DEFAULT
3441 #ifndef SUBLANG_SPANISH_NICARAGUA
3442 #define SUBLANG_SPANISH_NICARAGUA SUBLANG_DEFAULT
3444 #ifndef SUBLANG_SPANISH_PANAMA
3445 #define SUBLANG_SPANISH_PANAMA SUBLANG_DEFAULT
3447 #ifndef SUBLANG_SPANISH_PARAGUAY
3448 #define SUBLANG_SPANISH_PARAGUAY SUBLANG_DEFAULT
3450 #ifndef SUBLANG_SPANISH_PERU
3451 #define SUBLANG_SPANISH_PERU SUBLANG_DEFAULT
3453 #ifndef SUBLANG_SPANISH_PUERTO_RICO
3454 #define SUBLANG_SPANISH_PUERTO_RICO SUBLANG_DEFAULT
3456 #ifndef SUBLANG_SPANISH_URUGUAY
3457 #define SUBLANG_SPANISH_URUGUAY SUBLANG_DEFAULT
3459 #ifndef SUBLANG_SPANISH_VENEZUELA
3460 #define SUBLANG_SPANISH_VENEZUELA SUBLANG_DEFAULT
3462 #ifndef SUBLANG_SWEDISH
3463 #define SUBLANG_SWEDISH SUBLANG_DEFAULT
3465 #ifndef SUBLANG_SWEDISH_FINLAND
3466 #define SUBLANG_SWEDISH_FINLAND SUBLANG_DEFAULT
3468 #ifndef SUBLANG_URDU_INDIA
3469 #define SUBLANG_URDU_INDIA SUBLANG_DEFAULT
3471 #ifndef SUBLANG_URDU_PAKISTAN
3472 #define SUBLANG_URDU_PAKISTAN SUBLANG_DEFAULT
3474 #ifndef SUBLANG_UZBEK_CYRILLIC
3475 #define SUBLANG_UZBEK_CYRILLIC SUBLANG_DEFAULT
3477 #ifndef SUBLANG_UZBEK_LATIN
3478 #define SUBLANG_UZBEK_LATIN SUBLANG_DEFAULT
3484 #define LNG(wxlang, canonical, winlang, winsublang, layout, desc) \
3485 info.Language = wxlang; \
3486 info.CanonicalName = wxT(canonical); \
3487 info.LayoutDirection = layout; \
3488 info.Description = wxT(desc); \
3489 SETWINLANG(info, winlang, winsublang) \
3492 void wxLocale::InitLanguagesDB()
3494 wxLanguageInfo info
;
3495 wxStringTokenizer tkn
;
3497 LNG(wxLANGUAGE_ABKHAZIAN
, "ab" , 0 , 0 , wxLayout_LeftToRight
, "Abkhazian")
3498 LNG(wxLANGUAGE_AFAR
, "aa" , 0 , 0 , wxLayout_LeftToRight
, "Afar")
3499 LNG(wxLANGUAGE_AFRIKAANS
, "af_ZA", LANG_AFRIKAANS
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Afrikaans")
3500 LNG(wxLANGUAGE_ALBANIAN
, "sq_AL", LANG_ALBANIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Albanian")
3501 LNG(wxLANGUAGE_AMHARIC
, "am" , 0 , 0 , wxLayout_LeftToRight
, "Amharic")
3502 LNG(wxLANGUAGE_ARABIC
, "ar" , LANG_ARABIC
, SUBLANG_DEFAULT
, wxLayout_RightToLeft
, "Arabic")
3503 LNG(wxLANGUAGE_ARABIC_ALGERIA
, "ar_DZ", LANG_ARABIC
, SUBLANG_ARABIC_ALGERIA
, wxLayout_RightToLeft
, "Arabic (Algeria)")
3504 LNG(wxLANGUAGE_ARABIC_BAHRAIN
, "ar_BH", LANG_ARABIC
, SUBLANG_ARABIC_BAHRAIN
, wxLayout_RightToLeft
, "Arabic (Bahrain)")
3505 LNG(wxLANGUAGE_ARABIC_EGYPT
, "ar_EG", LANG_ARABIC
, SUBLANG_ARABIC_EGYPT
, wxLayout_RightToLeft
, "Arabic (Egypt)")
3506 LNG(wxLANGUAGE_ARABIC_IRAQ
, "ar_IQ", LANG_ARABIC
, SUBLANG_ARABIC_IRAQ
, wxLayout_RightToLeft
, "Arabic (Iraq)")
3507 LNG(wxLANGUAGE_ARABIC_JORDAN
, "ar_JO", LANG_ARABIC
, SUBLANG_ARABIC_JORDAN
, wxLayout_RightToLeft
, "Arabic (Jordan)")
3508 LNG(wxLANGUAGE_ARABIC_KUWAIT
, "ar_KW", LANG_ARABIC
, SUBLANG_ARABIC_KUWAIT
, wxLayout_RightToLeft
, "Arabic (Kuwait)")
3509 LNG(wxLANGUAGE_ARABIC_LEBANON
, "ar_LB", LANG_ARABIC
, SUBLANG_ARABIC_LEBANON
, wxLayout_RightToLeft
, "Arabic (Lebanon)")
3510 LNG(wxLANGUAGE_ARABIC_LIBYA
, "ar_LY", LANG_ARABIC
, SUBLANG_ARABIC_LIBYA
, wxLayout_RightToLeft
, "Arabic (Libya)")
3511 LNG(wxLANGUAGE_ARABIC_MOROCCO
, "ar_MA", LANG_ARABIC
, SUBLANG_ARABIC_MOROCCO
, wxLayout_RightToLeft
, "Arabic (Morocco)")
3512 LNG(wxLANGUAGE_ARABIC_OMAN
, "ar_OM", LANG_ARABIC
, SUBLANG_ARABIC_OMAN
, wxLayout_RightToLeft
, "Arabic (Oman)")
3513 LNG(wxLANGUAGE_ARABIC_QATAR
, "ar_QA", LANG_ARABIC
, SUBLANG_ARABIC_QATAR
, wxLayout_RightToLeft
, "Arabic (Qatar)")
3514 LNG(wxLANGUAGE_ARABIC_SAUDI_ARABIA
, "ar_SA", LANG_ARABIC
, SUBLANG_ARABIC_SAUDI_ARABIA
, wxLayout_RightToLeft
, "Arabic (Saudi Arabia)")
3515 LNG(wxLANGUAGE_ARABIC_SUDAN
, "ar_SD", 0 , 0 , wxLayout_RightToLeft
, "Arabic (Sudan)")
3516 LNG(wxLANGUAGE_ARABIC_SYRIA
, "ar_SY", LANG_ARABIC
, SUBLANG_ARABIC_SYRIA
, wxLayout_RightToLeft
, "Arabic (Syria)")
3517 LNG(wxLANGUAGE_ARABIC_TUNISIA
, "ar_TN", LANG_ARABIC
, SUBLANG_ARABIC_TUNISIA
, wxLayout_RightToLeft
, "Arabic (Tunisia)")
3518 LNG(wxLANGUAGE_ARABIC_UAE
, "ar_AE", LANG_ARABIC
, SUBLANG_ARABIC_UAE
, wxLayout_RightToLeft
, "Arabic (Uae)")
3519 LNG(wxLANGUAGE_ARABIC_YEMEN
, "ar_YE", LANG_ARABIC
, SUBLANG_ARABIC_YEMEN
, wxLayout_RightToLeft
, "Arabic (Yemen)")
3520 LNG(wxLANGUAGE_ARMENIAN
, "hy" , LANG_ARMENIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Armenian")
3521 LNG(wxLANGUAGE_ASSAMESE
, "as" , LANG_ASSAMESE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Assamese")
3522 LNG(wxLANGUAGE_AYMARA
, "ay" , 0 , 0 , wxLayout_LeftToRight
, "Aymara")
3523 LNG(wxLANGUAGE_AZERI
, "az" , LANG_AZERI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Azeri")
3524 LNG(wxLANGUAGE_AZERI_CYRILLIC
, "az" , LANG_AZERI
, SUBLANG_AZERI_CYRILLIC
, wxLayout_LeftToRight
, "Azeri (Cyrillic)")
3525 LNG(wxLANGUAGE_AZERI_LATIN
, "az" , LANG_AZERI
, SUBLANG_AZERI_LATIN
, wxLayout_LeftToRight
, "Azeri (Latin)")
3526 LNG(wxLANGUAGE_BASHKIR
, "ba" , 0 , 0 , wxLayout_LeftToRight
, "Bashkir")
3527 LNG(wxLANGUAGE_BASQUE
, "eu_ES", LANG_BASQUE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Basque")
3528 LNG(wxLANGUAGE_BELARUSIAN
, "be_BY", LANG_BELARUSIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Belarusian")
3529 LNG(wxLANGUAGE_BENGALI
, "bn" , LANG_BENGALI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Bengali")
3530 LNG(wxLANGUAGE_BHUTANI
, "dz" , 0 , 0 , wxLayout_LeftToRight
, "Bhutani")
3531 LNG(wxLANGUAGE_BIHARI
, "bh" , 0 , 0 , wxLayout_LeftToRight
, "Bihari")
3532 LNG(wxLANGUAGE_BISLAMA
, "bi" , 0 , 0 , wxLayout_LeftToRight
, "Bislama")
3533 LNG(wxLANGUAGE_BRETON
, "br" , 0 , 0 , wxLayout_LeftToRight
, "Breton")
3534 LNG(wxLANGUAGE_BULGARIAN
, "bg_BG", LANG_BULGARIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Bulgarian")
3535 LNG(wxLANGUAGE_BURMESE
, "my" , 0 , 0 , wxLayout_LeftToRight
, "Burmese")
3536 LNG(wxLANGUAGE_CAMBODIAN
, "km" , 0 , 0 , wxLayout_LeftToRight
, "Cambodian")
3537 LNG(wxLANGUAGE_CATALAN
, "ca_ES", LANG_CATALAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Catalan")
3538 LNG(wxLANGUAGE_CHINESE
, "zh_TW", LANG_CHINESE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Chinese")
3539 LNG(wxLANGUAGE_CHINESE_SIMPLIFIED
, "zh_CN", LANG_CHINESE
, SUBLANG_CHINESE_SIMPLIFIED
, wxLayout_LeftToRight
, "Chinese (Simplified)")
3540 LNG(wxLANGUAGE_CHINESE_TRADITIONAL
, "zh_TW", LANG_CHINESE
, SUBLANG_CHINESE_TRADITIONAL
, wxLayout_LeftToRight
, "Chinese (Traditional)")
3541 LNG(wxLANGUAGE_CHINESE_HONGKONG
, "zh_HK", LANG_CHINESE
, SUBLANG_CHINESE_HONGKONG
, wxLayout_LeftToRight
, "Chinese (Hongkong)")
3542 LNG(wxLANGUAGE_CHINESE_MACAU
, "zh_MO", LANG_CHINESE
, SUBLANG_CHINESE_MACAU
, wxLayout_LeftToRight
, "Chinese (Macau)")
3543 LNG(wxLANGUAGE_CHINESE_SINGAPORE
, "zh_SG", LANG_CHINESE
, SUBLANG_CHINESE_SINGAPORE
, wxLayout_LeftToRight
, "Chinese (Singapore)")
3544 LNG(wxLANGUAGE_CHINESE_TAIWAN
, "zh_TW", LANG_CHINESE
, SUBLANG_CHINESE_TRADITIONAL
, wxLayout_LeftToRight
, "Chinese (Taiwan)")
3545 LNG(wxLANGUAGE_CORSICAN
, "co" , 0 , 0 , wxLayout_LeftToRight
, "Corsican")
3546 LNG(wxLANGUAGE_CROATIAN
, "hr_HR", LANG_CROATIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Croatian")
3547 LNG(wxLANGUAGE_CZECH
, "cs_CZ", LANG_CZECH
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Czech")
3548 LNG(wxLANGUAGE_DANISH
, "da_DK", LANG_DANISH
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Danish")
3549 LNG(wxLANGUAGE_DUTCH
, "nl_NL", LANG_DUTCH
, SUBLANG_DUTCH
, wxLayout_LeftToRight
, "Dutch")
3550 LNG(wxLANGUAGE_DUTCH_BELGIAN
, "nl_BE", LANG_DUTCH
, SUBLANG_DUTCH_BELGIAN
, wxLayout_LeftToRight
, "Dutch (Belgian)")
3551 LNG(wxLANGUAGE_ENGLISH
, "en_GB", LANG_ENGLISH
, SUBLANG_ENGLISH_UK
, wxLayout_LeftToRight
, "English")
3552 LNG(wxLANGUAGE_ENGLISH_UK
, "en_GB", LANG_ENGLISH
, SUBLANG_ENGLISH_UK
, wxLayout_LeftToRight
, "English (U.K.)")
3553 LNG(wxLANGUAGE_ENGLISH_US
, "en_US", LANG_ENGLISH
, SUBLANG_ENGLISH_US
, wxLayout_LeftToRight
, "English (U.S.)")
3554 LNG(wxLANGUAGE_ENGLISH_AUSTRALIA
, "en_AU", LANG_ENGLISH
, SUBLANG_ENGLISH_AUS
, wxLayout_LeftToRight
, "English (Australia)")
3555 LNG(wxLANGUAGE_ENGLISH_BELIZE
, "en_BZ", LANG_ENGLISH
, SUBLANG_ENGLISH_BELIZE
, wxLayout_LeftToRight
, "English (Belize)")
3556 LNG(wxLANGUAGE_ENGLISH_BOTSWANA
, "en_BW", 0 , 0 , wxLayout_LeftToRight
, "English (Botswana)")
3557 LNG(wxLANGUAGE_ENGLISH_CANADA
, "en_CA", LANG_ENGLISH
, SUBLANG_ENGLISH_CAN
, wxLayout_LeftToRight
, "English (Canada)")
3558 LNG(wxLANGUAGE_ENGLISH_CARIBBEAN
, "en_CB", LANG_ENGLISH
, SUBLANG_ENGLISH_CARIBBEAN
, wxLayout_LeftToRight
, "English (Caribbean)")
3559 LNG(wxLANGUAGE_ENGLISH_DENMARK
, "en_DK", 0 , 0 , wxLayout_LeftToRight
, "English (Denmark)")
3560 LNG(wxLANGUAGE_ENGLISH_EIRE
, "en_IE", LANG_ENGLISH
, SUBLANG_ENGLISH_EIRE
, wxLayout_LeftToRight
, "English (Eire)")
3561 LNG(wxLANGUAGE_ENGLISH_JAMAICA
, "en_JM", LANG_ENGLISH
, SUBLANG_ENGLISH_JAMAICA
, wxLayout_LeftToRight
, "English (Jamaica)")
3562 LNG(wxLANGUAGE_ENGLISH_NEW_ZEALAND
, "en_NZ", LANG_ENGLISH
, SUBLANG_ENGLISH_NZ
, wxLayout_LeftToRight
, "English (New Zealand)")
3563 LNG(wxLANGUAGE_ENGLISH_PHILIPPINES
, "en_PH", LANG_ENGLISH
, SUBLANG_ENGLISH_PHILIPPINES
, wxLayout_LeftToRight
, "English (Philippines)")
3564 LNG(wxLANGUAGE_ENGLISH_SOUTH_AFRICA
, "en_ZA", LANG_ENGLISH
, SUBLANG_ENGLISH_SOUTH_AFRICA
, wxLayout_LeftToRight
, "English (South Africa)")
3565 LNG(wxLANGUAGE_ENGLISH_TRINIDAD
, "en_TT", LANG_ENGLISH
, SUBLANG_ENGLISH_TRINIDAD
, wxLayout_LeftToRight
, "English (Trinidad)")
3566 LNG(wxLANGUAGE_ENGLISH_ZIMBABWE
, "en_ZW", LANG_ENGLISH
, SUBLANG_ENGLISH_ZIMBABWE
, wxLayout_LeftToRight
, "English (Zimbabwe)")
3567 LNG(wxLANGUAGE_ESPERANTO
, "eo" , 0 , 0 , wxLayout_LeftToRight
, "Esperanto")
3568 LNG(wxLANGUAGE_ESTONIAN
, "et_EE", LANG_ESTONIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Estonian")
3569 LNG(wxLANGUAGE_FAEROESE
, "fo_FO", LANG_FAEROESE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Faeroese")
3570 LNG(wxLANGUAGE_FARSI
, "fa_IR", LANG_FARSI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Farsi")
3571 LNG(wxLANGUAGE_FIJI
, "fj" , 0 , 0 , wxLayout_LeftToRight
, "Fiji")
3572 LNG(wxLANGUAGE_FINNISH
, "fi_FI", LANG_FINNISH
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Finnish")
3573 LNG(wxLANGUAGE_FRENCH
, "fr_FR", LANG_FRENCH
, SUBLANG_FRENCH
, wxLayout_LeftToRight
, "French")
3574 LNG(wxLANGUAGE_FRENCH_BELGIAN
, "fr_BE", LANG_FRENCH
, SUBLANG_FRENCH_BELGIAN
, wxLayout_LeftToRight
, "French (Belgian)")
3575 LNG(wxLANGUAGE_FRENCH_CANADIAN
, "fr_CA", LANG_FRENCH
, SUBLANG_FRENCH_CANADIAN
, wxLayout_LeftToRight
, "French (Canadian)")
3576 LNG(wxLANGUAGE_FRENCH_LUXEMBOURG
, "fr_LU", LANG_FRENCH
, SUBLANG_FRENCH_LUXEMBOURG
, wxLayout_LeftToRight
, "French (Luxembourg)")
3577 LNG(wxLANGUAGE_FRENCH_MONACO
, "fr_MC", LANG_FRENCH
, SUBLANG_FRENCH_MONACO
, wxLayout_LeftToRight
, "French (Monaco)")
3578 LNG(wxLANGUAGE_FRENCH_SWISS
, "fr_CH", LANG_FRENCH
, SUBLANG_FRENCH_SWISS
, wxLayout_LeftToRight
, "French (Swiss)")
3579 LNG(wxLANGUAGE_FRISIAN
, "fy" , 0 , 0 , wxLayout_LeftToRight
, "Frisian")
3580 LNG(wxLANGUAGE_GALICIAN
, "gl_ES", 0 , 0 , wxLayout_LeftToRight
, "Galician")
3581 LNG(wxLANGUAGE_GEORGIAN
, "ka" , LANG_GEORGIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Georgian")
3582 LNG(wxLANGUAGE_GERMAN
, "de_DE", LANG_GERMAN
, SUBLANG_GERMAN
, wxLayout_LeftToRight
, "German")
3583 LNG(wxLANGUAGE_GERMAN_AUSTRIAN
, "de_AT", LANG_GERMAN
, SUBLANG_GERMAN_AUSTRIAN
, wxLayout_LeftToRight
, "German (Austrian)")
3584 LNG(wxLANGUAGE_GERMAN_BELGIUM
, "de_BE", 0 , 0 , wxLayout_LeftToRight
, "German (Belgium)")
3585 LNG(wxLANGUAGE_GERMAN_LIECHTENSTEIN
, "de_LI", LANG_GERMAN
, SUBLANG_GERMAN_LIECHTENSTEIN
, wxLayout_LeftToRight
, "German (Liechtenstein)")
3586 LNG(wxLANGUAGE_GERMAN_LUXEMBOURG
, "de_LU", LANG_GERMAN
, SUBLANG_GERMAN_LUXEMBOURG
, wxLayout_LeftToRight
, "German (Luxembourg)")
3587 LNG(wxLANGUAGE_GERMAN_SWISS
, "de_CH", LANG_GERMAN
, SUBLANG_GERMAN_SWISS
, wxLayout_LeftToRight
, "German (Swiss)")
3588 LNG(wxLANGUAGE_GREEK
, "el_GR", LANG_GREEK
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Greek")
3589 LNG(wxLANGUAGE_GREENLANDIC
, "kl_GL", 0 , 0 , wxLayout_LeftToRight
, "Greenlandic")
3590 LNG(wxLANGUAGE_GUARANI
, "gn" , 0 , 0 , wxLayout_LeftToRight
, "Guarani")
3591 LNG(wxLANGUAGE_GUJARATI
, "gu" , LANG_GUJARATI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Gujarati")
3592 LNG(wxLANGUAGE_HAUSA
, "ha" , 0 , 0 , wxLayout_LeftToRight
, "Hausa")
3593 LNG(wxLANGUAGE_HEBREW
, "he_IL", LANG_HEBREW
, SUBLANG_DEFAULT
, wxLayout_RightToLeft
, "Hebrew")
3594 LNG(wxLANGUAGE_HINDI
, "hi_IN", LANG_HINDI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Hindi")
3595 LNG(wxLANGUAGE_HUNGARIAN
, "hu_HU", LANG_HUNGARIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Hungarian")
3596 LNG(wxLANGUAGE_ICELANDIC
, "is_IS", LANG_ICELANDIC
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Icelandic")
3597 LNG(wxLANGUAGE_INDONESIAN
, "id_ID", LANG_INDONESIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Indonesian")
3598 LNG(wxLANGUAGE_INTERLINGUA
, "ia" , 0 , 0 , wxLayout_LeftToRight
, "Interlingua")
3599 LNG(wxLANGUAGE_INTERLINGUE
, "ie" , 0 , 0 , wxLayout_LeftToRight
, "Interlingue")
3600 LNG(wxLANGUAGE_INUKTITUT
, "iu" , 0 , 0 , wxLayout_LeftToRight
, "Inuktitut")
3601 LNG(wxLANGUAGE_INUPIAK
, "ik" , 0 , 0 , wxLayout_LeftToRight
, "Inupiak")
3602 LNG(wxLANGUAGE_IRISH
, "ga_IE", 0 , 0 , wxLayout_LeftToRight
, "Irish")
3603 LNG(wxLANGUAGE_ITALIAN
, "it_IT", LANG_ITALIAN
, SUBLANG_ITALIAN
, wxLayout_LeftToRight
, "Italian")
3604 LNG(wxLANGUAGE_ITALIAN_SWISS
, "it_CH", LANG_ITALIAN
, SUBLANG_ITALIAN_SWISS
, wxLayout_LeftToRight
, "Italian (Swiss)")
3605 LNG(wxLANGUAGE_JAPANESE
, "ja_JP", LANG_JAPANESE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Japanese")
3606 LNG(wxLANGUAGE_JAVANESE
, "jw" , 0 , 0 , wxLayout_LeftToRight
, "Javanese")
3607 LNG(wxLANGUAGE_KANNADA
, "kn" , LANG_KANNADA
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Kannada")
3608 LNG(wxLANGUAGE_KASHMIRI
, "ks" , LANG_KASHMIRI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Kashmiri")
3609 LNG(wxLANGUAGE_KASHMIRI_INDIA
, "ks_IN", LANG_KASHMIRI
, SUBLANG_KASHMIRI_INDIA
, wxLayout_LeftToRight
, "Kashmiri (India)")
3610 LNG(wxLANGUAGE_KAZAKH
, "kk" , LANG_KAZAK
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Kazakh")
3611 LNG(wxLANGUAGE_KERNEWEK
, "kw_GB", 0 , 0 , wxLayout_LeftToRight
, "Kernewek")
3612 LNG(wxLANGUAGE_KINYARWANDA
, "rw" , 0 , 0 , wxLayout_LeftToRight
, "Kinyarwanda")
3613 LNG(wxLANGUAGE_KIRGHIZ
, "ky" , 0 , 0 , wxLayout_LeftToRight
, "Kirghiz")
3614 LNG(wxLANGUAGE_KIRUNDI
, "rn" , 0 , 0 , wxLayout_LeftToRight
, "Kirundi")
3615 LNG(wxLANGUAGE_KONKANI
, "" , LANG_KONKANI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Konkani")
3616 LNG(wxLANGUAGE_KOREAN
, "ko_KR", LANG_KOREAN
, SUBLANG_KOREAN
, wxLayout_LeftToRight
, "Korean")
3617 LNG(wxLANGUAGE_KURDISH
, "ku" , 0 , 0 , wxLayout_LeftToRight
, "Kurdish")
3618 LNG(wxLANGUAGE_LAOTHIAN
, "lo" , 0 , 0 , wxLayout_LeftToRight
, "Laothian")
3619 LNG(wxLANGUAGE_LATIN
, "la" , 0 , 0 , wxLayout_LeftToRight
, "Latin")
3620 LNG(wxLANGUAGE_LATVIAN
, "lv_LV", LANG_LATVIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Latvian")
3621 LNG(wxLANGUAGE_LINGALA
, "ln" , 0 , 0 , wxLayout_LeftToRight
, "Lingala")
3622 LNG(wxLANGUAGE_LITHUANIAN
, "lt_LT", LANG_LITHUANIAN
, SUBLANG_LITHUANIAN
, wxLayout_LeftToRight
, "Lithuanian")
3623 LNG(wxLANGUAGE_MACEDONIAN
, "mk_MK", LANG_MACEDONIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Macedonian")
3624 LNG(wxLANGUAGE_MALAGASY
, "mg" , 0 , 0 , wxLayout_LeftToRight
, "Malagasy")
3625 LNG(wxLANGUAGE_MALAY
, "ms_MY", LANG_MALAY
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Malay")
3626 LNG(wxLANGUAGE_MALAYALAM
, "ml" , LANG_MALAYALAM
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Malayalam")
3627 LNG(wxLANGUAGE_MALAY_BRUNEI_DARUSSALAM
, "ms_BN", LANG_MALAY
, SUBLANG_MALAY_BRUNEI_DARUSSALAM
, wxLayout_LeftToRight
, "Malay (Brunei Darussalam)")
3628 LNG(wxLANGUAGE_MALAY_MALAYSIA
, "ms_MY", LANG_MALAY
, SUBLANG_MALAY_MALAYSIA
, wxLayout_LeftToRight
, "Malay (Malaysia)")
3629 LNG(wxLANGUAGE_MALTESE
, "mt_MT", 0 , 0 , wxLayout_LeftToRight
, "Maltese")
3630 LNG(wxLANGUAGE_MANIPURI
, "" , LANG_MANIPURI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Manipuri")
3631 LNG(wxLANGUAGE_MAORI
, "mi" , 0 , 0 , wxLayout_LeftToRight
, "Maori")
3632 LNG(wxLANGUAGE_MARATHI
, "mr_IN", LANG_MARATHI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Marathi")
3633 LNG(wxLANGUAGE_MOLDAVIAN
, "mo" , 0 , 0 , wxLayout_LeftToRight
, "Moldavian")
3634 LNG(wxLANGUAGE_MONGOLIAN
, "mn" , 0 , 0 , wxLayout_LeftToRight
, "Mongolian")
3635 LNG(wxLANGUAGE_NAURU
, "na" , 0 , 0 , wxLayout_LeftToRight
, "Nauru")
3636 LNG(wxLANGUAGE_NEPALI
, "ne" , LANG_NEPALI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Nepali")
3637 LNG(wxLANGUAGE_NEPALI_INDIA
, "ne_IN", LANG_NEPALI
, SUBLANG_NEPALI_INDIA
, wxLayout_LeftToRight
, "Nepali (India)")
3638 LNG(wxLANGUAGE_NORWEGIAN_BOKMAL
, "nb_NO", LANG_NORWEGIAN
, SUBLANG_NORWEGIAN_BOKMAL
, wxLayout_LeftToRight
, "Norwegian (Bokmal)")
3639 LNG(wxLANGUAGE_NORWEGIAN_NYNORSK
, "nn_NO", LANG_NORWEGIAN
, SUBLANG_NORWEGIAN_NYNORSK
, wxLayout_LeftToRight
, "Norwegian (Nynorsk)")
3640 LNG(wxLANGUAGE_OCCITAN
, "oc" , 0 , 0 , wxLayout_LeftToRight
, "Occitan")
3641 LNG(wxLANGUAGE_ORIYA
, "or" , LANG_ORIYA
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Oriya")
3642 LNG(wxLANGUAGE_OROMO
, "om" , 0 , 0 , wxLayout_LeftToRight
, "(Afan) Oromo")
3643 LNG(wxLANGUAGE_PASHTO
, "ps" , 0 , 0 , wxLayout_LeftToRight
, "Pashto, Pushto")
3644 LNG(wxLANGUAGE_POLISH
, "pl_PL", LANG_POLISH
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Polish")
3645 LNG(wxLANGUAGE_PORTUGUESE
, "pt_PT", LANG_PORTUGUESE
, SUBLANG_PORTUGUESE
, wxLayout_LeftToRight
, "Portuguese")
3646 LNG(wxLANGUAGE_PORTUGUESE_BRAZILIAN
, "pt_BR", LANG_PORTUGUESE
, SUBLANG_PORTUGUESE_BRAZILIAN
, wxLayout_LeftToRight
, "Portuguese (Brazilian)")
3647 LNG(wxLANGUAGE_PUNJABI
, "pa" , LANG_PUNJABI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Punjabi")
3648 LNG(wxLANGUAGE_QUECHUA
, "qu" , 0 , 0 , wxLayout_LeftToRight
, "Quechua")
3649 LNG(wxLANGUAGE_RHAETO_ROMANCE
, "rm" , 0 , 0 , wxLayout_LeftToRight
, "Rhaeto-Romance")
3650 LNG(wxLANGUAGE_ROMANIAN
, "ro_RO", LANG_ROMANIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Romanian")
3651 LNG(wxLANGUAGE_RUSSIAN
, "ru_RU", LANG_RUSSIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Russian")
3652 LNG(wxLANGUAGE_RUSSIAN_UKRAINE
, "ru_UA", 0 , 0 , wxLayout_LeftToRight
, "Russian (Ukraine)")
3653 LNG(wxLANGUAGE_SAMOAN
, "sm" , 0 , 0 , wxLayout_LeftToRight
, "Samoan")
3654 LNG(wxLANGUAGE_SANGHO
, "sg" , 0 , 0 , wxLayout_LeftToRight
, "Sangho")
3655 LNG(wxLANGUAGE_SANSKRIT
, "sa" , LANG_SANSKRIT
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Sanskrit")
3656 LNG(wxLANGUAGE_SCOTS_GAELIC
, "gd" , 0 , 0 , wxLayout_LeftToRight
, "Scots Gaelic")
3657 LNG(wxLANGUAGE_SERBIAN_CYRILLIC
, "sr_YU", LANG_SERBIAN
, SUBLANG_SERBIAN_CYRILLIC
, wxLayout_LeftToRight
, "Serbian (Cyrillic)")
3658 LNG(wxLANGUAGE_SERBIAN_LATIN
, "sr_YU", LANG_SERBIAN
, SUBLANG_SERBIAN_LATIN
, wxLayout_LeftToRight
, "Serbian (Latin)")
3659 LNG(wxLANGUAGE_SERBO_CROATIAN
, "sh" , 0 , 0 , wxLayout_LeftToRight
, "Serbo-Croatian")
3660 LNG(wxLANGUAGE_SESOTHO
, "st" , 0 , 0 , wxLayout_LeftToRight
, "Sesotho")
3661 LNG(wxLANGUAGE_SETSWANA
, "tn" , 0 , 0 , wxLayout_LeftToRight
, "Setswana")
3662 LNG(wxLANGUAGE_SHONA
, "sn" , 0 , 0 , wxLayout_LeftToRight
, "Shona")
3663 LNG(wxLANGUAGE_SINDHI
, "sd" , LANG_SINDHI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Sindhi")
3664 LNG(wxLANGUAGE_SINHALESE
, "si" , 0 , 0 , wxLayout_LeftToRight
, "Sinhalese")
3665 LNG(wxLANGUAGE_SISWATI
, "ss" , 0 , 0 , wxLayout_LeftToRight
, "Siswati")
3666 LNG(wxLANGUAGE_SLOVAK
, "sk_SK", LANG_SLOVAK
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Slovak")
3667 LNG(wxLANGUAGE_SLOVENIAN
, "sl_SI", LANG_SLOVENIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Slovenian")
3668 LNG(wxLANGUAGE_SOMALI
, "so" , 0 , 0 , wxLayout_LeftToRight
, "Somali")
3669 LNG(wxLANGUAGE_SPANISH
, "es_ES", LANG_SPANISH
, SUBLANG_SPANISH
, wxLayout_LeftToRight
, "Spanish")
3670 LNG(wxLANGUAGE_SPANISH_ARGENTINA
, "es_AR", LANG_SPANISH
, SUBLANG_SPANISH_ARGENTINA
, wxLayout_LeftToRight
, "Spanish (Argentina)")
3671 LNG(wxLANGUAGE_SPANISH_BOLIVIA
, "es_BO", LANG_SPANISH
, SUBLANG_SPANISH_BOLIVIA
, wxLayout_LeftToRight
, "Spanish (Bolivia)")
3672 LNG(wxLANGUAGE_SPANISH_CHILE
, "es_CL", LANG_SPANISH
, SUBLANG_SPANISH_CHILE
, wxLayout_LeftToRight
, "Spanish (Chile)")
3673 LNG(wxLANGUAGE_SPANISH_COLOMBIA
, "es_CO", LANG_SPANISH
, SUBLANG_SPANISH_COLOMBIA
, wxLayout_LeftToRight
, "Spanish (Colombia)")
3674 LNG(wxLANGUAGE_SPANISH_COSTA_RICA
, "es_CR", LANG_SPANISH
, SUBLANG_SPANISH_COSTA_RICA
, wxLayout_LeftToRight
, "Spanish (Costa Rica)")
3675 LNG(wxLANGUAGE_SPANISH_DOMINICAN_REPUBLIC
, "es_DO", LANG_SPANISH
, SUBLANG_SPANISH_DOMINICAN_REPUBLIC
, wxLayout_LeftToRight
, "Spanish (Dominican republic)")
3676 LNG(wxLANGUAGE_SPANISH_ECUADOR
, "es_EC", LANG_SPANISH
, SUBLANG_SPANISH_ECUADOR
, wxLayout_LeftToRight
, "Spanish (Ecuador)")
3677 LNG(wxLANGUAGE_SPANISH_EL_SALVADOR
, "es_SV", LANG_SPANISH
, SUBLANG_SPANISH_EL_SALVADOR
, wxLayout_LeftToRight
, "Spanish (El Salvador)")
3678 LNG(wxLANGUAGE_SPANISH_GUATEMALA
, "es_GT", LANG_SPANISH
, SUBLANG_SPANISH_GUATEMALA
, wxLayout_LeftToRight
, "Spanish (Guatemala)")
3679 LNG(wxLANGUAGE_SPANISH_HONDURAS
, "es_HN", LANG_SPANISH
, SUBLANG_SPANISH_HONDURAS
, wxLayout_LeftToRight
, "Spanish (Honduras)")
3680 LNG(wxLANGUAGE_SPANISH_MEXICAN
, "es_MX", LANG_SPANISH
, SUBLANG_SPANISH_MEXICAN
, wxLayout_LeftToRight
, "Spanish (Mexican)")
3681 LNG(wxLANGUAGE_SPANISH_MODERN
, "es_ES", LANG_SPANISH
, SUBLANG_SPANISH_MODERN
, wxLayout_LeftToRight
, "Spanish (Modern)")
3682 LNG(wxLANGUAGE_SPANISH_NICARAGUA
, "es_NI", LANG_SPANISH
, SUBLANG_SPANISH_NICARAGUA
, wxLayout_LeftToRight
, "Spanish (Nicaragua)")
3683 LNG(wxLANGUAGE_SPANISH_PANAMA
, "es_PA", LANG_SPANISH
, SUBLANG_SPANISH_PANAMA
, wxLayout_LeftToRight
, "Spanish (Panama)")
3684 LNG(wxLANGUAGE_SPANISH_PARAGUAY
, "es_PY", LANG_SPANISH
, SUBLANG_SPANISH_PARAGUAY
, wxLayout_LeftToRight
, "Spanish (Paraguay)")
3685 LNG(wxLANGUAGE_SPANISH_PERU
, "es_PE", LANG_SPANISH
, SUBLANG_SPANISH_PERU
, wxLayout_LeftToRight
, "Spanish (Peru)")
3686 LNG(wxLANGUAGE_SPANISH_PUERTO_RICO
, "es_PR", LANG_SPANISH
, SUBLANG_SPANISH_PUERTO_RICO
, wxLayout_LeftToRight
, "Spanish (Puerto Rico)")
3687 LNG(wxLANGUAGE_SPANISH_URUGUAY
, "es_UY", LANG_SPANISH
, SUBLANG_SPANISH_URUGUAY
, wxLayout_LeftToRight
, "Spanish (Uruguay)")
3688 LNG(wxLANGUAGE_SPANISH_US
, "es_US", 0 , 0 , wxLayout_LeftToRight
, "Spanish (U.S.)")
3689 LNG(wxLANGUAGE_SPANISH_VENEZUELA
, "es_VE", LANG_SPANISH
, SUBLANG_SPANISH_VENEZUELA
, wxLayout_LeftToRight
, "Spanish (Venezuela)")
3690 LNG(wxLANGUAGE_SUNDANESE
, "su" , 0 , 0 , wxLayout_LeftToRight
, "Sundanese")
3691 LNG(wxLANGUAGE_SWAHILI
, "sw_KE", LANG_SWAHILI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Swahili")
3692 LNG(wxLANGUAGE_SWEDISH
, "sv_SE", LANG_SWEDISH
, SUBLANG_SWEDISH
, wxLayout_LeftToRight
, "Swedish")
3693 LNG(wxLANGUAGE_SWEDISH_FINLAND
, "sv_FI", LANG_SWEDISH
, SUBLANG_SWEDISH_FINLAND
, wxLayout_LeftToRight
, "Swedish (Finland)")
3694 LNG(wxLANGUAGE_TAGALOG
, "tl_PH", 0 , 0 , wxLayout_LeftToRight
, "Tagalog")
3695 LNG(wxLANGUAGE_TAJIK
, "tg" , 0 , 0 , wxLayout_LeftToRight
, "Tajik")
3696 LNG(wxLANGUAGE_TAMIL
, "ta" , LANG_TAMIL
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Tamil")
3697 LNG(wxLANGUAGE_TATAR
, "tt" , LANG_TATAR
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Tatar")
3698 LNG(wxLANGUAGE_TELUGU
, "te" , LANG_TELUGU
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Telugu")
3699 LNG(wxLANGUAGE_THAI
, "th_TH", LANG_THAI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Thai")
3700 LNG(wxLANGUAGE_TIBETAN
, "bo" , 0 , 0 , wxLayout_LeftToRight
, "Tibetan")
3701 LNG(wxLANGUAGE_TIGRINYA
, "ti" , 0 , 0 , wxLayout_LeftToRight
, "Tigrinya")
3702 LNG(wxLANGUAGE_TONGA
, "to" , 0 , 0 , wxLayout_LeftToRight
, "Tonga")
3703 LNG(wxLANGUAGE_TSONGA
, "ts" , 0 , 0 , wxLayout_LeftToRight
, "Tsonga")
3704 LNG(wxLANGUAGE_TURKISH
, "tr_TR", LANG_TURKISH
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Turkish")
3705 LNG(wxLANGUAGE_TURKMEN
, "tk" , 0 , 0 , wxLayout_LeftToRight
, "Turkmen")
3706 LNG(wxLANGUAGE_TWI
, "tw" , 0 , 0 , wxLayout_LeftToRight
, "Twi")
3707 LNG(wxLANGUAGE_UIGHUR
, "ug" , 0 , 0 , wxLayout_LeftToRight
, "Uighur")
3708 LNG(wxLANGUAGE_UKRAINIAN
, "uk_UA", LANG_UKRAINIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Ukrainian")
3709 LNG(wxLANGUAGE_URDU
, "ur" , LANG_URDU
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Urdu")
3710 LNG(wxLANGUAGE_URDU_INDIA
, "ur_IN", LANG_URDU
, SUBLANG_URDU_INDIA
, wxLayout_LeftToRight
, "Urdu (India)")
3711 LNG(wxLANGUAGE_URDU_PAKISTAN
, "ur_PK", LANG_URDU
, SUBLANG_URDU_PAKISTAN
, wxLayout_LeftToRight
, "Urdu (Pakistan)")
3712 LNG(wxLANGUAGE_UZBEK
, "uz" , LANG_UZBEK
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Uzbek")
3713 LNG(wxLANGUAGE_UZBEK_CYRILLIC
, "uz" , LANG_UZBEK
, SUBLANG_UZBEK_CYRILLIC
, wxLayout_LeftToRight
, "Uzbek (Cyrillic)")
3714 LNG(wxLANGUAGE_UZBEK_LATIN
, "uz" , LANG_UZBEK
, SUBLANG_UZBEK_LATIN
, wxLayout_LeftToRight
, "Uzbek (Latin)")
3715 LNG(wxLANGUAGE_VIETNAMESE
, "vi_VN", LANG_VIETNAMESE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Vietnamese")
3716 LNG(wxLANGUAGE_VOLAPUK
, "vo" , 0 , 0 , wxLayout_LeftToRight
, "Volapuk")
3717 LNG(wxLANGUAGE_WELSH
, "cy" , 0 , 0 , wxLayout_LeftToRight
, "Welsh")
3718 LNG(wxLANGUAGE_WOLOF
, "wo" , 0 , 0 , wxLayout_LeftToRight
, "Wolof")
3719 LNG(wxLANGUAGE_XHOSA
, "xh" , 0 , 0 , wxLayout_LeftToRight
, "Xhosa")
3720 LNG(wxLANGUAGE_YIDDISH
, "yi" , 0 , 0 , wxLayout_LeftToRight
, "Yiddish")
3721 LNG(wxLANGUAGE_YORUBA
, "yo" , 0 , 0 , wxLayout_LeftToRight
, "Yoruba")
3722 LNG(wxLANGUAGE_ZHUANG
, "za" , 0 , 0 , wxLayout_LeftToRight
, "Zhuang")
3723 LNG(wxLANGUAGE_ZULU
, "zu" , 0 , 0 , wxLayout_LeftToRight
, "Zulu")
3727 // --- --- --- generated code ends here --- --- ---
3729 #endif // wxUSE_INTL