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"
74 #if defined(__WXMAC__)
75 #include "wx/mac/private.h" // includes mac headers
78 // ----------------------------------------------------------------------------
80 // ----------------------------------------------------------------------------
82 // this should *not* be wxChar, this type must have exactly 8 bits!
83 typedef wxUint8 size_t8
;
84 typedef wxUint32 size_t32
;
86 // ----------------------------------------------------------------------------
88 // ----------------------------------------------------------------------------
90 // magic number identifying the .mo format file
91 const size_t32 MSGCATALOG_MAGIC
= 0x950412de;
92 const size_t32 MSGCATALOG_MAGIC_SW
= 0xde120495;
94 // the constants describing the format of lang_LANG locale string
95 static const size_t LEN_LANG
= 2;
96 static const size_t LEN_SUBLANG
= 2;
97 static const size_t LEN_FULL
= LEN_LANG
+ 1 + LEN_SUBLANG
; // 1 for '_'
99 #define TRACE_I18N _T("i18n")
101 // ----------------------------------------------------------------------------
103 // ----------------------------------------------------------------------------
107 // small class to suppress the translation erros until exit from current scope
111 NoTransErr() { ms_suppressCount
++; }
112 ~NoTransErr() { ms_suppressCount
--; }
114 static bool Suppress() { return ms_suppressCount
> 0; }
117 static size_t ms_suppressCount
;
120 size_t NoTransErr::ms_suppressCount
= 0;
131 #endif // Debug/!Debug
133 static wxLocale
*wxSetLocale(wxLocale
*pLocale
);
135 // helper functions of GetSystemLanguage()
138 // get just the language part
139 static inline wxString
ExtractLang(const wxString
& langFull
)
141 return langFull
.Left(LEN_LANG
);
144 // get everything else (including the leading '_')
145 static inline wxString
ExtractNotLang(const wxString
& langFull
)
147 return langFull
.Mid(LEN_LANG
);
153 // ----------------------------------------------------------------------------
154 // Plural forms parser
155 // ----------------------------------------------------------------------------
161 LogicalOrExpression '?' Expression ':' Expression
165 LogicalAndExpression "||" LogicalOrExpression // to (a || b) || c
168 LogicalAndExpression:
169 EqualityExpression "&&" LogicalAndExpression // to (a && b) && c
173 RelationalExpression "==" RelationalExperession
174 RelationalExpression "!=" RelationalExperession
177 RelationalExpression:
178 MultiplicativeExpression '>' MultiplicativeExpression
179 MultiplicativeExpression '<' MultiplicativeExpression
180 MultiplicativeExpression ">=" MultiplicativeExpression
181 MultiplicativeExpression "<=" MultiplicativeExpression
182 MultiplicativeExpression
184 MultiplicativeExpression:
185 PmExpression '%' PmExpression
194 class wxPluralFormsToken
199 T_ERROR
, T_EOF
, T_NUMBER
, T_N
, T_PLURAL
, T_NPLURALS
, T_EQUAL
, T_ASSIGN
,
200 T_GREATER
, T_GREATER_OR_EQUAL
, T_LESS
, T_LESS_OR_EQUAL
,
201 T_REMINDER
, T_NOT_EQUAL
,
202 T_LOGICAL_AND
, T_LOGICAL_OR
, T_QUESTION
, T_COLON
, T_SEMICOLON
,
203 T_LEFT_BRACKET
, T_RIGHT_BRACKET
205 Type
type() const { return m_type
; }
206 void setType(Type type
) { m_type
= type
; }
209 Number
number() const { return m_number
; }
210 void setNumber(Number num
) { m_number
= num
; }
217 class wxPluralFormsScanner
220 wxPluralFormsScanner(const char* s
);
221 const wxPluralFormsToken
& token() const { return m_token
; }
222 bool nextToken(); // returns false if error
225 wxPluralFormsToken m_token
;
228 wxPluralFormsScanner::wxPluralFormsScanner(const char* s
) : m_s(s
)
233 bool wxPluralFormsScanner::nextToken()
235 wxPluralFormsToken::Type type
= wxPluralFormsToken::T_ERROR
;
236 while (isspace(*m_s
))
242 type
= wxPluralFormsToken::T_EOF
;
244 else if (isdigit(*m_s
))
246 wxPluralFormsToken::Number number
= *m_s
++ - '0';
247 while (isdigit(*m_s
))
249 number
= number
* 10 + (*m_s
++ - '0');
251 m_token
.setNumber(number
);
252 type
= wxPluralFormsToken::T_NUMBER
;
254 else if (isalpha(*m_s
))
256 const char* begin
= m_s
++;
257 while (isalnum(*m_s
))
261 size_t size
= m_s
- begin
;
262 if (size
== 1 && memcmp(begin
, "n", size
) == 0)
264 type
= wxPluralFormsToken::T_N
;
266 else if (size
== 6 && memcmp(begin
, "plural", size
) == 0)
268 type
= wxPluralFormsToken::T_PLURAL
;
270 else if (size
== 8 && memcmp(begin
, "nplurals", size
) == 0)
272 type
= wxPluralFormsToken::T_NPLURALS
;
275 else if (*m_s
== '=')
281 type
= wxPluralFormsToken::T_EQUAL
;
285 type
= wxPluralFormsToken::T_ASSIGN
;
288 else if (*m_s
== '>')
294 type
= wxPluralFormsToken::T_GREATER_OR_EQUAL
;
298 type
= wxPluralFormsToken::T_GREATER
;
301 else if (*m_s
== '<')
307 type
= wxPluralFormsToken::T_LESS_OR_EQUAL
;
311 type
= wxPluralFormsToken::T_LESS
;
314 else if (*m_s
== '%')
317 type
= wxPluralFormsToken::T_REMINDER
;
319 else if (*m_s
== '!' && m_s
[1] == '=')
322 type
= wxPluralFormsToken::T_NOT_EQUAL
;
324 else if (*m_s
== '&' && m_s
[1] == '&')
327 type
= wxPluralFormsToken::T_LOGICAL_AND
;
329 else if (*m_s
== '|' && m_s
[1] == '|')
332 type
= wxPluralFormsToken::T_LOGICAL_OR
;
334 else if (*m_s
== '?')
337 type
= wxPluralFormsToken::T_QUESTION
;
339 else if (*m_s
== ':')
342 type
= wxPluralFormsToken::T_COLON
;
343 } else if (*m_s
== ';') {
345 type
= wxPluralFormsToken::T_SEMICOLON
;
347 else if (*m_s
== '(')
350 type
= wxPluralFormsToken::T_LEFT_BRACKET
;
352 else if (*m_s
== ')')
355 type
= wxPluralFormsToken::T_RIGHT_BRACKET
;
357 m_token
.setType(type
);
358 return type
!= wxPluralFormsToken::T_ERROR
;
361 class wxPluralFormsNode
;
363 // NB: Can't use wxDEFINE_SCOPED_PTR_TYPE because wxPluralFormsNode is not
364 // fully defined yet:
365 class wxPluralFormsNodePtr
368 wxPluralFormsNodePtr(wxPluralFormsNode
*p
= NULL
) : m_p(p
) {}
369 ~wxPluralFormsNodePtr();
370 wxPluralFormsNode
& operator*() const { return *m_p
; }
371 wxPluralFormsNode
* operator->() const { return m_p
; }
372 wxPluralFormsNode
* get() const { return m_p
; }
373 wxPluralFormsNode
* release();
374 void reset(wxPluralFormsNode
*p
);
377 wxPluralFormsNode
*m_p
;
380 class wxPluralFormsNode
383 wxPluralFormsNode(const wxPluralFormsToken
& token
) : m_token(token
) {}
384 const wxPluralFormsToken
& token() const { return m_token
; }
385 const wxPluralFormsNode
* node(size_t i
) const
386 { return m_nodes
[i
].get(); }
387 void setNode(size_t i
, wxPluralFormsNode
* n
);
388 wxPluralFormsNode
* releaseNode(size_t i
);
389 wxPluralFormsToken::Number
evaluate(wxPluralFormsToken::Number n
) const;
392 wxPluralFormsToken m_token
;
393 wxPluralFormsNodePtr m_nodes
[3];
396 wxPluralFormsNodePtr::~wxPluralFormsNodePtr()
400 wxPluralFormsNode
* wxPluralFormsNodePtr::release()
402 wxPluralFormsNode
*p
= m_p
;
406 void wxPluralFormsNodePtr::reset(wxPluralFormsNode
*p
)
416 void wxPluralFormsNode::setNode(size_t i
, wxPluralFormsNode
* n
)
421 wxPluralFormsNode
* wxPluralFormsNode::releaseNode(size_t i
)
423 return m_nodes
[i
].release();
426 wxPluralFormsToken::Number
427 wxPluralFormsNode::evaluate(wxPluralFormsToken::Number n
) const
429 switch (token().type())
432 case wxPluralFormsToken::T_NUMBER
:
433 return token().number();
434 case wxPluralFormsToken::T_N
:
437 case wxPluralFormsToken::T_EQUAL
:
438 return node(0)->evaluate(n
) == node(1)->evaluate(n
);
439 case wxPluralFormsToken::T_NOT_EQUAL
:
440 return node(0)->evaluate(n
) != node(1)->evaluate(n
);
441 case wxPluralFormsToken::T_GREATER
:
442 return node(0)->evaluate(n
) > node(1)->evaluate(n
);
443 case wxPluralFormsToken::T_GREATER_OR_EQUAL
:
444 return node(0)->evaluate(n
) >= node(1)->evaluate(n
);
445 case wxPluralFormsToken::T_LESS
:
446 return node(0)->evaluate(n
) < node(1)->evaluate(n
);
447 case wxPluralFormsToken::T_LESS_OR_EQUAL
:
448 return node(0)->evaluate(n
) <= node(1)->evaluate(n
);
449 case wxPluralFormsToken::T_REMINDER
:
451 wxPluralFormsToken::Number number
= node(1)->evaluate(n
);
454 return node(0)->evaluate(n
) % number
;
461 case wxPluralFormsToken::T_LOGICAL_AND
:
462 return node(0)->evaluate(n
) && node(1)->evaluate(n
);
463 case wxPluralFormsToken::T_LOGICAL_OR
:
464 return node(0)->evaluate(n
) || node(1)->evaluate(n
);
466 case wxPluralFormsToken::T_QUESTION
:
467 return node(0)->evaluate(n
)
468 ? node(1)->evaluate(n
)
469 : node(2)->evaluate(n
);
476 class wxPluralFormsCalculator
479 wxPluralFormsCalculator() : m_nplurals(0), m_plural(0) {}
481 // input: number, returns msgstr index
482 int evaluate(int n
) const;
484 // input: text after "Plural-Forms:" (e.g. "nplurals=2; plural=(n != 1);"),
485 // if s == 0, creates default handler
486 // returns 0 if error
487 static wxPluralFormsCalculator
* make(const char* s
= 0);
489 ~wxPluralFormsCalculator() {}
491 void init(wxPluralFormsToken::Number nplurals
, wxPluralFormsNode
* plural
);
494 wxPluralFormsToken::Number m_nplurals
;
495 wxPluralFormsNodePtr m_plural
;
498 wxDEFINE_SCOPED_PTR_TYPE(wxPluralFormsCalculator
)
500 void wxPluralFormsCalculator::init(wxPluralFormsToken::Number nplurals
,
501 wxPluralFormsNode
* plural
)
503 m_nplurals
= nplurals
;
504 m_plural
.reset(plural
);
507 int wxPluralFormsCalculator::evaluate(int n
) const
509 if (m_plural
.get() == 0)
513 wxPluralFormsToken::Number number
= m_plural
->evaluate(n
);
514 if (number
< 0 || number
> m_nplurals
)
522 class wxPluralFormsParser
525 wxPluralFormsParser(wxPluralFormsScanner
& scanner
) : m_scanner(scanner
) {}
526 bool parse(wxPluralFormsCalculator
& rCalculator
);
529 wxPluralFormsNode
* parsePlural();
530 // stops at T_SEMICOLON, returns 0 if error
531 wxPluralFormsScanner
& m_scanner
;
532 const wxPluralFormsToken
& token() const;
535 wxPluralFormsNode
* expression();
536 wxPluralFormsNode
* logicalOrExpression();
537 wxPluralFormsNode
* logicalAndExpression();
538 wxPluralFormsNode
* equalityExpression();
539 wxPluralFormsNode
* multiplicativeExpression();
540 wxPluralFormsNode
* relationalExpression();
541 wxPluralFormsNode
* pmExpression();
544 bool wxPluralFormsParser::parse(wxPluralFormsCalculator
& rCalculator
)
546 if (token().type() != wxPluralFormsToken::T_NPLURALS
)
550 if (token().type() != wxPluralFormsToken::T_ASSIGN
)
554 if (token().type() != wxPluralFormsToken::T_NUMBER
)
556 wxPluralFormsToken::Number nplurals
= token().number();
559 if (token().type() != wxPluralFormsToken::T_SEMICOLON
)
563 if (token().type() != wxPluralFormsToken::T_PLURAL
)
567 if (token().type() != wxPluralFormsToken::T_ASSIGN
)
571 wxPluralFormsNode
* plural
= parsePlural();
574 if (token().type() != wxPluralFormsToken::T_SEMICOLON
)
578 if (token().type() != wxPluralFormsToken::T_EOF
)
580 rCalculator
.init(nplurals
, plural
);
584 wxPluralFormsNode
* wxPluralFormsParser::parsePlural()
586 wxPluralFormsNode
* p
= expression();
591 wxPluralFormsNodePtr
n(p
);
592 if (token().type() != wxPluralFormsToken::T_SEMICOLON
)
599 const wxPluralFormsToken
& wxPluralFormsParser::token() const
601 return m_scanner
.token();
604 bool wxPluralFormsParser::nextToken()
606 if (!m_scanner
.nextToken())
611 wxPluralFormsNode
* wxPluralFormsParser::expression()
613 wxPluralFormsNode
* p
= logicalOrExpression();
616 wxPluralFormsNodePtr
n(p
);
617 if (token().type() == wxPluralFormsToken::T_QUESTION
)
619 wxPluralFormsNodePtr
qn(new wxPluralFormsNode(token()));
630 if (token().type() != wxPluralFormsToken::T_COLON
)
644 qn
->setNode(0, n
.release());
650 wxPluralFormsNode
*wxPluralFormsParser::logicalOrExpression()
652 wxPluralFormsNode
* p
= logicalAndExpression();
655 wxPluralFormsNodePtr
ln(p
);
656 if (token().type() == wxPluralFormsToken::T_LOGICAL_OR
)
658 wxPluralFormsNodePtr
un(new wxPluralFormsNode(token()));
663 p
= logicalOrExpression();
668 wxPluralFormsNodePtr
rn(p
); // right
669 if (rn
->token().type() == wxPluralFormsToken::T_LOGICAL_OR
)
671 // see logicalAndExpression comment
672 un
->setNode(0, ln
.release());
673 un
->setNode(1, rn
->releaseNode(0));
674 rn
->setNode(0, un
.release());
679 un
->setNode(0, ln
.release());
680 un
->setNode(1, rn
.release());
686 wxPluralFormsNode
* wxPluralFormsParser::logicalAndExpression()
688 wxPluralFormsNode
* p
= equalityExpression();
691 wxPluralFormsNodePtr
ln(p
); // left
692 if (token().type() == wxPluralFormsToken::T_LOGICAL_AND
)
694 wxPluralFormsNodePtr
un(new wxPluralFormsNode(token())); // up
699 p
= logicalAndExpression();
704 wxPluralFormsNodePtr
rn(p
); // right
705 if (rn
->token().type() == wxPluralFormsToken::T_LOGICAL_AND
)
707 // transform 1 && (2 && 3) -> (1 && 2) && 3
711 un
->setNode(0, ln
.release());
712 un
->setNode(1, rn
->releaseNode(0));
713 rn
->setNode(0, un
.release());
717 un
->setNode(0, ln
.release());
718 un
->setNode(1, rn
.release());
724 wxPluralFormsNode
* wxPluralFormsParser::equalityExpression()
726 wxPluralFormsNode
* p
= relationalExpression();
729 wxPluralFormsNodePtr
n(p
);
730 if (token().type() == wxPluralFormsToken::T_EQUAL
731 || token().type() == wxPluralFormsToken::T_NOT_EQUAL
)
733 wxPluralFormsNodePtr
qn(new wxPluralFormsNode(token()));
738 p
= relationalExpression();
744 qn
->setNode(0, n
.release());
750 wxPluralFormsNode
* wxPluralFormsParser::relationalExpression()
752 wxPluralFormsNode
* p
= multiplicativeExpression();
755 wxPluralFormsNodePtr
n(p
);
756 if (token().type() == wxPluralFormsToken::T_GREATER
757 || token().type() == wxPluralFormsToken::T_LESS
758 || token().type() == wxPluralFormsToken::T_GREATER_OR_EQUAL
759 || token().type() == wxPluralFormsToken::T_LESS_OR_EQUAL
)
761 wxPluralFormsNodePtr
qn(new wxPluralFormsNode(token()));
766 p
= multiplicativeExpression();
772 qn
->setNode(0, n
.release());
778 wxPluralFormsNode
* wxPluralFormsParser::multiplicativeExpression()
780 wxPluralFormsNode
* p
= pmExpression();
783 wxPluralFormsNodePtr
n(p
);
784 if (token().type() == wxPluralFormsToken::T_REMINDER
)
786 wxPluralFormsNodePtr
qn(new wxPluralFormsNode(token()));
797 qn
->setNode(0, n
.release());
803 wxPluralFormsNode
* wxPluralFormsParser::pmExpression()
805 wxPluralFormsNodePtr n
;
806 if (token().type() == wxPluralFormsToken::T_N
807 || token().type() == wxPluralFormsToken::T_NUMBER
)
809 n
.reset(new wxPluralFormsNode(token()));
815 else if (token().type() == wxPluralFormsToken::T_LEFT_BRACKET
) {
820 wxPluralFormsNode
* p
= expression();
826 if (token().type() != wxPluralFormsToken::T_RIGHT_BRACKET
)
842 wxPluralFormsCalculator
* wxPluralFormsCalculator::make(const char* s
)
844 wxPluralFormsCalculatorPtr
calculator(new wxPluralFormsCalculator
);
847 wxPluralFormsScanner
scanner(s
);
848 wxPluralFormsParser
p(scanner
);
849 if (!p
.parse(*calculator
))
854 return calculator
.release();
860 // ----------------------------------------------------------------------------
861 // wxMsgCatalogFile corresponds to one disk-file message catalog.
863 // This is a "low-level" class and is used only by wxMsgCatalog
864 // ----------------------------------------------------------------------------
866 WX_DECLARE_EXPORTED_STRING_HASH_MAP(wxString
, wxMessagesHash
);
868 class wxMsgCatalogFile
875 // load the catalog from disk (szDirPrefix corresponds to language)
876 bool Load(const wxString
& szDirPrefix
, const wxString
& szName
,
877 wxPluralFormsCalculatorPtr
& rPluralFormsCalculator
);
879 // fills the hash with string-translation pairs
880 void FillHash(wxMessagesHash
& hash
,
881 const wxString
& msgIdCharset
,
882 bool convertEncoding
) const;
884 // return the charset of the strings in this catalog or empty string if
886 wxString
GetCharset() const { return m_charset
; }
889 // this implementation is binary compatible with GNU gettext() version 0.10
891 // an entry in the string table
892 struct wxMsgTableEntry
894 size_t32 nLen
; // length of the string
895 size_t32 ofsString
; // pointer to the string
898 // header of a .mo file
899 struct wxMsgCatalogHeader
901 size_t32 magic
, // offset +00: magic id
902 revision
, // +04: revision
903 numStrings
; // +08: number of strings in the file
904 size_t32 ofsOrigTable
, // +0C: start of original string table
905 ofsTransTable
; // +10: start of translated string table
906 size_t32 nHashSize
, // +14: hash table size
907 ofsHashTable
; // +18: offset of hash table start
910 // all data is stored here, NULL if no data loaded
913 // amount of memory pointed to by m_pData.
917 size_t32 m_numStrings
; // number of strings in this domain
918 wxMsgTableEntry
*m_pOrigTable
, // pointer to original strings
919 *m_pTransTable
; // translated
921 wxString m_charset
; // from the message catalog header
924 // swap the 2 halves of 32 bit integer if needed
925 size_t32
Swap(size_t32 ui
) const
927 return m_bSwapped
? (ui
<< 24) | ((ui
& 0xff00) << 8) |
928 ((ui
>> 8) & 0xff00) | (ui
>> 24)
932 const char *StringAtOfs(wxMsgTableEntry
*pTable
, size_t32 n
) const
934 const wxMsgTableEntry
* const ent
= pTable
+ n
;
936 // this check could fail for a corrupt message catalog
937 size_t32 ofsString
= Swap(ent
->ofsString
);
938 if ( ofsString
+ Swap(ent
->nLen
) > m_nSize
)
943 return (const char *)(m_pData
+ ofsString
);
946 bool m_bSwapped
; // wrong endianness?
948 DECLARE_NO_COPY_CLASS(wxMsgCatalogFile
)
952 // ----------------------------------------------------------------------------
953 // wxMsgCatalog corresponds to one loaded message catalog.
955 // This is a "low-level" class and is used only by wxLocale (that's why
956 // it's designed to be stored in a linked list)
957 // ----------------------------------------------------------------------------
962 wxMsgCatalog() { m_conv
= NULL
; }
965 // load the catalog from disk (szDirPrefix corresponds to language)
966 bool Load(const wxString
& dirPrefix
, const wxString
& name
,
967 const wxString
& msgIdCharset
, bool bConvertEncoding
= false);
969 // get name of the catalog
970 wxString
GetName() const { return m_name
; }
972 // get the translated string: returns NULL if not found
973 const wxString
*GetString(const wxString
& sz
, size_t n
= size_t(-1)) const;
975 // public variable pointing to the next element in a linked list (or NULL)
976 wxMsgCatalog
*m_pNext
;
979 wxMessagesHash m_messages
; // all messages in the catalog
980 wxString m_name
; // name of the domain
982 // the conversion corresponding to this catalog charset if we installed it
986 wxPluralFormsCalculatorPtr m_pluralFormsCalculator
;
989 // ----------------------------------------------------------------------------
991 // ----------------------------------------------------------------------------
993 // the list of the directories to search for message catalog files
994 static wxArrayString gs_searchPrefixes
;
996 // ============================================================================
998 // ============================================================================
1000 // ----------------------------------------------------------------------------
1001 // wxMsgCatalogFile class
1002 // ----------------------------------------------------------------------------
1004 wxMsgCatalogFile::wxMsgCatalogFile()
1010 wxMsgCatalogFile::~wxMsgCatalogFile()
1015 // return the directories to search for message catalogs under the given
1016 // prefix, separated by wxPATH_SEP
1018 wxString
GetMsgCatalogSubdirs(const wxString
& prefix
, const wxString
& lang
)
1020 // Search first in Unix-standard prefix/lang/LC_MESSAGES, then in
1021 // prefix/lang and finally in just prefix.
1023 // Note that we use LC_MESSAGES on all platforms and not just Unix, because
1024 // it doesn't cost much to look into one more directory and doing it this
1025 // way has two important benefits:
1026 // a) we don't break compatibility with wx-2.6 and older by stopping to
1027 // look in a directory where the catalogs used to be and thus silently
1028 // breaking apps after they are recompiled against the latest wx
1029 // b) it makes it possible to package app's support files in the same
1030 // way on all target platforms
1031 wxString pathPrefix
;
1032 pathPrefix
<< prefix
<< wxFILE_SEP_PATH
<< lang
;
1034 wxString searchPath
;
1035 searchPath
.reserve(4*pathPrefix
.length());
1036 searchPath
<< pathPrefix
<< wxFILE_SEP_PATH
<< "LC_MESSAGES" << wxPATH_SEP
1037 << prefix
<< wxFILE_SEP_PATH
<< wxPATH_SEP
1043 // construct the search path for the given language
1044 static wxString
GetFullSearchPath(const wxString
& lang
)
1046 // first take the entries explicitly added by the program
1047 wxArrayString paths
;
1048 paths
.reserve(gs_searchPrefixes
.size() + 1);
1050 count
= gs_searchPrefixes
.size();
1051 for ( n
= 0; n
< count
; n
++ )
1053 paths
.Add(GetMsgCatalogSubdirs(gs_searchPrefixes
[n
], lang
));
1058 // then look in the standard location
1059 const wxString stdp
= wxStandardPaths::Get().
1060 GetLocalizedResourcesDir(lang
, wxStandardPaths::ResourceCat_Messages
);
1062 if ( paths
.Index(stdp
) == wxNOT_FOUND
)
1064 #endif // wxUSE_STDPATHS
1066 // last look in default locations
1068 // LC_PATH is a standard env var containing the search path for the .mo
1070 const wxChar
*pszLcPath
= wxGetenv(wxT("LC_PATH"));
1073 const wxString lcp
= GetMsgCatalogSubdirs(pszLcPath
, lang
);
1074 if ( paths
.Index(lcp
) == wxNOT_FOUND
)
1078 // also add the one from where wxWin was installed:
1079 wxString wxp
= wxGetInstallPrefix();
1082 wxp
= GetMsgCatalogSubdirs(wxp
+ _T("/share/locale"), lang
);
1083 if ( paths
.Index(wxp
) == wxNOT_FOUND
)
1089 // finally construct the full search path
1090 wxString searchPath
;
1091 searchPath
.reserve(500);
1092 count
= paths
.size();
1093 for ( n
= 0; n
< count
; n
++ )
1095 searchPath
+= paths
[n
];
1096 if ( n
!= count
- 1 )
1097 searchPath
+= wxPATH_SEP
;
1103 // open disk file and read in it's contents
1104 bool wxMsgCatalogFile::Load(const wxString
& szDirPrefix
, const wxString
& szName
,
1105 wxPluralFormsCalculatorPtr
& rPluralFormsCalculator
)
1107 wxString searchPath
;
1110 // first look for the catalog for this language and the current locale:
1111 // notice that we don't use the system name for the locale as this would
1112 // force us to install catalogs in different locations depending on the
1113 // system but always use the canonical name
1114 wxFontEncoding encSys
= wxLocale::GetSystemEncoding();
1115 if ( encSys
!= wxFONTENCODING_SYSTEM
)
1117 wxString
fullname(szDirPrefix
);
1118 fullname
<< _T('.') << wxFontMapperBase::GetEncodingName(encSys
);
1119 searchPath
<< GetFullSearchPath(fullname
) << wxPATH_SEP
;
1121 #endif // wxUSE_FONTMAP
1124 searchPath
+= GetFullSearchPath(szDirPrefix
);
1125 size_t sublocaleIndex
= szDirPrefix
.find(wxT('_'));
1126 if ( sublocaleIndex
!= wxString::npos
)
1128 // also add just base locale name: for things like "fr_BE" (belgium
1129 // french) we should use "fr" if no belgium specific message catalogs
1131 searchPath
<< wxPATH_SEP
1132 << GetFullSearchPath(szDirPrefix
.Left(sublocaleIndex
));
1135 // don't give translation errors here because the wxstd catalog might
1136 // not yet be loaded (and it's normal)
1138 // (we're using an object because we have several return paths)
1140 NoTransErr noTransErr
;
1141 wxLogVerbose(_("looking for catalog '%s' in path '%s'."),
1142 szName
, searchPath
.c_str());
1143 wxLogTrace(TRACE_I18N
, _T("Looking for \"%s.mo\" in \"%s\""),
1144 szName
, searchPath
.c_str());
1146 wxFileName
fn(szName
);
1147 fn
.SetExt(_T("mo"));
1148 wxString strFullName
;
1149 if ( !wxFindFileInPath(&strFullName
, searchPath
, fn
.GetFullPath()) ) {
1150 wxLogVerbose(_("catalog file for domain '%s' not found."), szName
);
1151 wxLogTrace(TRACE_I18N
, _T("Catalog \"%s.mo\" not found"), szName
);
1156 wxLogVerbose(_("using catalog '%s' from '%s'."), szName
, strFullName
.c_str());
1157 wxLogTrace(TRACE_I18N
, _T("Using catalog \"%s\"."), strFullName
.c_str());
1159 wxFile
fileMsg(strFullName
);
1160 if ( !fileMsg
.IsOpened() )
1163 // get the file size (assume it is less than 4Gb...)
1164 wxFileOffset lenFile
= fileMsg
.Length();
1165 if ( lenFile
== wxInvalidOffset
)
1168 size_t nSize
= wx_truncate_cast(size_t, lenFile
);
1169 wxASSERT_MSG( nSize
== lenFile
+ size_t(0), _T("message catalog bigger than 4GB?") );
1171 // read the whole file in memory
1172 m_pData
= new size_t8
[nSize
];
1173 if ( fileMsg
.Read(m_pData
, nSize
) != lenFile
) {
1179 bool bValid
= nSize
+ (size_t)0 > sizeof(wxMsgCatalogHeader
);
1181 wxMsgCatalogHeader
*pHeader
= (wxMsgCatalogHeader
*)m_pData
;
1183 // we'll have to swap all the integers if it's true
1184 m_bSwapped
= pHeader
->magic
== MSGCATALOG_MAGIC_SW
;
1186 // check the magic number
1187 bValid
= m_bSwapped
|| pHeader
->magic
== MSGCATALOG_MAGIC
;
1191 // it's either too short or has incorrect magic number
1192 wxLogWarning(_("'%s' is not a valid message catalog."), strFullName
.c_str());
1199 m_numStrings
= Swap(pHeader
->numStrings
);
1200 m_pOrigTable
= (wxMsgTableEntry
*)(m_pData
+
1201 Swap(pHeader
->ofsOrigTable
));
1202 m_pTransTable
= (wxMsgTableEntry
*)(m_pData
+
1203 Swap(pHeader
->ofsTransTable
));
1204 m_nSize
= (size_t32
)nSize
;
1206 // now parse catalog's header and try to extract catalog charset and
1207 // plural forms formula from it:
1209 const char* headerData
= StringAtOfs(m_pOrigTable
, 0);
1210 if (headerData
&& headerData
[0] == 0)
1212 // Extract the charset:
1213 wxString header
= wxString::FromAscii(StringAtOfs(m_pTransTable
, 0));
1214 int begin
= header
.Find(wxT("Content-Type: text/plain; charset="));
1215 if (begin
!= wxNOT_FOUND
)
1217 begin
+= 34; //strlen("Content-Type: text/plain; charset=")
1218 size_t end
= header
.find('\n', begin
);
1219 if (end
!= size_t(-1))
1221 m_charset
.assign(header
, begin
, end
- begin
);
1222 if (m_charset
== wxT("CHARSET"))
1224 // "CHARSET" is not valid charset, but lazy translator
1229 // else: incorrectly filled Content-Type header
1231 // Extract plural forms:
1232 begin
= header
.Find(wxT("Plural-Forms:"));
1233 if (begin
!= wxNOT_FOUND
)
1236 size_t end
= header
.find('\n', begin
);
1237 if (end
!= size_t(-1))
1239 wxString
pfs(header
, begin
, end
- begin
);
1240 wxPluralFormsCalculator
* pCalculator
= wxPluralFormsCalculator
1241 ::make(pfs
.ToAscii());
1242 if (pCalculator
!= 0)
1244 rPluralFormsCalculator
.reset(pCalculator
);
1248 wxLogVerbose(_("Cannot parse Plural-Forms:'%s'"), pfs
.c_str());
1252 if (rPluralFormsCalculator
.get() == NULL
)
1254 rPluralFormsCalculator
.reset(wxPluralFormsCalculator::make());
1258 // everything is fine
1262 void wxMsgCatalogFile::FillHash(wxMessagesHash
& hash
,
1263 const wxString
& msgIdCharset
,
1264 bool convertEncoding
) const
1267 // this parameter doesn't make sense, we always must convert encoding in
1269 convertEncoding
= true;
1271 if ( convertEncoding
)
1273 // determine if we need any conversion at all
1274 wxFontEncoding encCat
= wxFontMapperBase::GetEncodingFromName(m_charset
);
1275 if ( encCat
== wxLocale::GetSystemEncoding() )
1277 // no need to convert
1278 convertEncoding
= false;
1281 #endif // wxUSE_UNICODE/wxUSE_FONTMAP
1284 // conversion to use to convert catalog strings to the GUI encoding
1285 wxMBConv
*inputConv
,
1286 *inputConvPtr
= NULL
; // same as inputConv but safely deleteable
1287 if ( convertEncoding
&& !m_charset
.empty() )
1290 inputConv
= new wxCSConv(m_charset
);
1292 else // no need or not possible to convert the encoding
1295 // we must somehow convert the narrow strings in the message catalog to
1296 // wide strings, so use the default conversion if we have no charset
1297 inputConv
= wxConvCurrent
;
1298 #else // !wxUSE_UNICODE
1300 #endif // wxUSE_UNICODE/!wxUSE_UNICODE
1303 // conversion to apply to msgid strings before looking them up: we only
1304 // need it if the msgids are neither in 7 bit ASCII nor in the same
1305 // encoding as the catalog
1306 wxCSConv
*sourceConv
= msgIdCharset
.empty() || (msgIdCharset
== m_charset
)
1308 : new wxCSConv(msgIdCharset
);
1311 wxASSERT_MSG( msgIdCharset
.empty(),
1312 _T("non-ASCII msgid languages only supported if wxUSE_WCHAR_T=1") );
1314 wxEncodingConverter converter
;
1315 if ( convertEncoding
)
1317 wxFontEncoding targetEnc
= wxFONTENCODING_SYSTEM
;
1318 wxFontEncoding enc
= wxFontMapperBase::Get()->CharsetToEncoding(m_charset
, false);
1319 if ( enc
== wxFONTENCODING_SYSTEM
)
1321 convertEncoding
= false; // unknown encoding
1325 targetEnc
= wxLocale::GetSystemEncoding();
1326 if (targetEnc
== wxFONTENCODING_SYSTEM
)
1328 wxFontEncodingArray a
= wxEncodingConverter::GetPlatformEquivalents(enc
);
1330 // no conversion needed, locale uses native encoding
1331 convertEncoding
= false;
1332 if (a
.GetCount() == 0)
1333 // we don't know common equiv. under this platform
1334 convertEncoding
= false;
1339 if ( convertEncoding
)
1341 converter
.Init(enc
, targetEnc
);
1344 #endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T
1345 (void)convertEncoding
; // get rid of warnings about unused parameter
1347 for (size_t32 i
= 0; i
< m_numStrings
; i
++)
1349 const char *data
= StringAtOfs(m_pOrigTable
, i
);
1353 msgid
= wxString(data
, *inputConv
);
1356 if ( inputConv
&& sourceConv
)
1357 msgid
= wxString(inputConv
->cMB2WC(data
), *sourceConv
);
1361 #endif // wxUSE_UNICODE
1363 data
= StringAtOfs(m_pTransTable
, i
);
1364 size_t length
= Swap(m_pTransTable
[i
].nLen
);
1367 while (offset
< length
)
1369 const char * const str
= data
+ offset
;
1373 msgstr
= wxString(str
, *inputConv
);
1376 msgstr
= wxString(inputConv
->cMB2WC(str
), *wxConvUI
);
1379 #else // !wxUSE_WCHAR_T
1381 if ( bConvertEncoding
)
1382 msgstr
= wxString(converter
.Convert(str
));
1386 #endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T
1388 if ( !msgstr
.empty() )
1390 hash
[index
== 0 ? msgid
: msgid
+ wxChar(index
)] = msgstr
;
1394 offset
+= strlen(str
) + 1;
1401 delete inputConvPtr
;
1402 #endif // wxUSE_WCHAR_T
1406 // ----------------------------------------------------------------------------
1407 // wxMsgCatalog class
1408 // ----------------------------------------------------------------------------
1410 wxMsgCatalog::~wxMsgCatalog()
1414 if ( wxConvUI
== m_conv
)
1416 // we only change wxConvUI if it points to wxConvLocal so we reset
1417 // it back to it too
1418 wxConvUI
= &wxConvLocal
;
1425 bool wxMsgCatalog::Load(const wxString
& dirPrefix
, const wxString
& name
,
1426 const wxString
& msgIdCharset
, bool bConvertEncoding
)
1428 wxMsgCatalogFile file
;
1432 if ( !file
.Load(dirPrefix
, name
, m_pluralFormsCalculator
) )
1435 file
.FillHash(m_messages
, msgIdCharset
, bConvertEncoding
);
1437 // we should use a conversion compatible with the message catalog encoding
1438 // in the GUI if we don't convert the strings to the current conversion but
1439 // as the encoding is global, only change it once, otherwise we could get
1440 // into trouble if we use several message catalogs with different encodings
1442 // this is, of course, a hack but it at least allows the program to use
1443 // message catalogs in any encodings without asking the user to change his
1445 if ( !bConvertEncoding
&&
1446 !file
.GetCharset().empty() &&
1447 wxConvUI
== &wxConvLocal
)
1450 m_conv
= new wxCSConv(file
.GetCharset());
1456 const wxString
*wxMsgCatalog::GetString(const wxString
& str
, size_t n
) const
1459 if (n
!= size_t(-1))
1461 index
= m_pluralFormsCalculator
->evaluate(n
);
1463 wxMessagesHash::const_iterator i
;
1466 i
= m_messages
.find(wxString(str
) + wxChar(index
)); // plural
1470 i
= m_messages
.find(str
);
1473 if ( i
!= m_messages
.end() )
1481 // ----------------------------------------------------------------------------
1483 // ----------------------------------------------------------------------------
1485 #include "wx/arrimpl.cpp"
1486 WX_DECLARE_EXPORTED_OBJARRAY(wxLanguageInfo
, wxLanguageInfoArray
);
1487 WX_DEFINE_OBJARRAY(wxLanguageInfoArray
)
1489 wxLanguageInfoArray
*wxLocale::ms_languagesDB
= NULL
;
1491 /*static*/ void wxLocale::CreateLanguagesDB()
1493 if (ms_languagesDB
== NULL
)
1495 ms_languagesDB
= new wxLanguageInfoArray
;
1500 /*static*/ void wxLocale::DestroyLanguagesDB()
1502 delete ms_languagesDB
;
1503 ms_languagesDB
= NULL
;
1507 void wxLocale::DoCommonInit()
1509 m_pszOldLocale
= NULL
;
1511 m_pOldLocale
= wxSetLocale(this);
1514 m_language
= wxLANGUAGE_UNKNOWN
;
1515 m_initialized
= false;
1518 // NB: this function has (desired) side effect of changing current locale
1519 bool wxLocale::Init(const wxString
& name
,
1520 const wxString
& shortName
,
1521 const wxString
& locale
,
1523 bool bConvertEncoding
)
1525 wxASSERT_MSG( !m_initialized
,
1526 _T("you can't call wxLocale::Init more than once") );
1528 m_initialized
= true;
1530 m_strShort
= shortName
;
1531 m_bConvertEncoding
= bConvertEncoding
;
1532 m_language
= wxLANGUAGE_UNKNOWN
;
1534 // change current locale (default: same as long name)
1535 wxString
szLocale(locale
);
1536 if ( szLocale
.empty() )
1538 // the argument to setlocale()
1539 szLocale
= shortName
;
1541 wxCHECK_MSG( !szLocale
.empty(), false,
1542 _T("no locale to set in wxLocale::Init()") );
1546 // FIXME: I'm guessing here
1547 wxChar localeName
[256];
1548 int ret
= GetLocaleInfo(LOCALE_USER_DEFAULT
, LOCALE_SLANGUAGE
, localeName
,
1552 m_pszOldLocale
= wxStrdup(wxConvLibc
.cWC2MB(localeName
));
1555 m_pszOldLocale
= NULL
;
1557 // TODO: how to find languageId
1558 // SetLocaleInfo(languageId, SORT_DEFAULT, localeName);
1560 const char *oldLocale
= wxSetlocale(LC_ALL
, szLocale
);
1562 m_pszOldLocale
= wxStrdup(oldLocale
);
1564 m_pszOldLocale
= NULL
;
1567 if ( m_pszOldLocale
== NULL
)
1568 wxLogError(_("locale '%s' can not be set."), szLocale
);
1570 // the short name will be used to look for catalog files as well,
1571 // so we need something here
1572 if ( m_strShort
.empty() ) {
1573 // FIXME I don't know how these 2 letter abbreviations are formed,
1574 // this wild guess is surely wrong
1575 if ( !szLocale
.empty() )
1577 m_strShort
+= (wxChar
)wxTolower(szLocale
[0]);
1578 if ( szLocale
.length() > 1 )
1579 m_strShort
+= (wxChar
)wxTolower(szLocale
[1]);
1583 // load the default catalog with wxWidgets standard messages
1588 bOk
= AddCatalog(wxT("wxstd"));
1590 // there may be a catalog with toolkit specific overrides, it is not
1591 // an error if this does not exist
1594 wxString
port(wxPlatformInfo::Get().GetPortIdName());
1595 if ( !port
.empty() )
1597 AddCatalog(port
.BeforeFirst(wxT('/')).MakeLower());
1606 #if defined(__UNIX__) && wxUSE_UNICODE && !defined(__WXMAC__)
1607 static const char *wxSetlocaleTryUTF8(int c
, const wxString
& lc
)
1609 const char *l
= NULL
;
1611 // NB: We prefer to set UTF-8 locale if it's possible and only fall back to
1612 // non-UTF-8 locale if it fails
1618 buf2
= buf
+ wxT(".UTF-8");
1619 l
= wxSetlocale(c
, buf2
);
1622 buf2
= buf
+ wxT(".utf-8");
1623 l
= wxSetlocale(c
, buf2
);
1627 buf2
= buf
+ wxT(".UTF8");
1628 l
= wxSetlocale(c
, buf2
);
1632 buf2
= buf
+ wxT(".utf8");
1633 l
= wxSetlocale(c
, buf2
);
1637 // if we can't set UTF-8 locale, try non-UTF-8 one:
1639 l
= wxSetlocale(c
, lc
);
1644 #define wxSetlocaleTryUTF8(c, lc) wxSetlocale(c, lc)
1647 bool wxLocale::Init(int language
, int flags
)
1651 int lang
= language
;
1652 if (lang
== wxLANGUAGE_DEFAULT
)
1654 // auto detect the language
1655 lang
= GetSystemLanguage();
1658 // We failed to detect system language, so we will use English:
1659 if (lang
== wxLANGUAGE_UNKNOWN
)
1664 const wxLanguageInfo
*info
= GetLanguageInfo(lang
);
1666 // Unknown language:
1669 wxLogError(wxT("Unknown language %i."), lang
);
1673 wxString name
= info
->Description
;
1674 wxString canonical
= info
->CanonicalName
;
1678 #if defined(__OS2__)
1679 const char *retloc
= wxSetlocale(LC_ALL
, wxEmptyString
);
1680 #elif defined(__UNIX__) && !defined(__WXMAC__)
1681 if (language
!= wxLANGUAGE_DEFAULT
)
1682 locale
= info
->CanonicalName
;
1684 const char *retloc
= wxSetlocaleTryUTF8(LC_ALL
, locale
);
1686 const wxString langOnly
= locale
.Left(2);
1689 // Some C libraries don't like xx_YY form and require xx only
1690 retloc
= wxSetlocaleTryUTF8(LC_ALL
, langOnly
);
1694 // some systems (e.g. FreeBSD and HP-UX) don't have xx_YY aliases but
1695 // require the full xx_YY.encoding form, so try using UTF-8 because this is
1696 // the only thing we can do generically
1698 // TODO: add encodings applicable to each language to the lang DB and try
1699 // them all in turn here
1702 const wxChar
**names
=
1703 wxFontMapperBase::GetAllEncodingNames(wxFONTENCODING_UTF8
);
1706 retloc
= wxSetlocale(LC_ALL
, locale
+ _T('.') + *names
++);
1711 #endif // wxUSE_FONTMAP
1715 // Some C libraries (namely glibc) still use old ISO 639,
1716 // so will translate the abbrev for them
1718 if ( langOnly
== wxT("he") )
1719 localeAlt
= wxT("iw") + locale
.Mid(3);
1720 else if ( langOnly
== wxT("id") )
1721 localeAlt
= wxT("in") + locale
.Mid(3);
1722 else if ( langOnly
== wxT("yi") )
1723 localeAlt
= wxT("ji") + locale
.Mid(3);
1724 else if ( langOnly
== wxT("nb") )
1725 localeAlt
= wxT("no_NO");
1726 else if ( langOnly
== wxT("nn") )
1727 localeAlt
= wxT("no_NY");
1729 if ( !localeAlt
.empty() )
1731 retloc
= wxSetlocaleTryUTF8(LC_ALL
, localeAlt
);
1733 retloc
= wxSetlocaleTryUTF8(LC_ALL
, localeAlt
.Left(2));
1741 // at least in AIX 5.2 libc is buggy and the string returned from
1742 // setlocale(LC_ALL) can't be passed back to it because it returns 6
1743 // strings (one for each locale category), i.e. for C locale we get back
1746 // this contradicts IBM own docs but this is not of much help, so just work
1747 // around it in the crudest possible manner
1748 char* p
= const_cast<char*>(wxStrchr(retloc
, ' '));
1753 #elif defined(__WIN32__)
1755 #if wxUSE_UNICODE && (defined(__VISUALC__) || defined(__MINGW32__))
1756 // NB: setlocale() from msvcrt.dll (used by VC++ and Mingw)
1757 // can't set locale to language that can only be written using
1758 // Unicode. Therefore wxSetlocale call failed, but we don't want
1759 // to report it as an error -- so that at least message catalogs
1760 // can be used. Watch for code marked with
1761 // #ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS bellow.
1762 #define SETLOCALE_FAILS_ON_UNICODE_LANGS
1765 const char *retloc
= "C";
1766 if (language
!= wxLANGUAGE_DEFAULT
)
1768 if (info
->WinLang
== 0)
1770 wxLogWarning(wxT("Locale '%s' not supported by OS."), name
.c_str());
1771 // retloc already set to "C"
1776 #ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS
1780 wxUint32 lcid
= MAKELCID(MAKELANGID(info
->WinLang
, info
->WinSublang
),
1784 SetThreadLocale(lcid
);
1786 // NB: we must translate LCID to CRT's setlocale string ourselves,
1787 // because SetThreadLocale does not modify change the
1788 // interpretation of setlocale(LC_ALL, "") call:
1790 buffer
[0] = wxT('\0');
1791 GetLocaleInfo(lcid
, LOCALE_SENGLANGUAGE
, buffer
, 256);
1793 if (GetLocaleInfo(lcid
, LOCALE_SENGCOUNTRY
, buffer
, 256) > 0)
1794 locale
<< wxT("_") << buffer
;
1795 if (GetLocaleInfo(lcid
, LOCALE_IDEFAULTANSICODEPAGE
, buffer
, 256) > 0)
1797 codepage
= wxAtoi(buffer
);
1799 locale
<< wxT(".") << buffer
;
1803 wxLogLastError(wxT("SetThreadLocale"));
1810 retloc
= wxSetlocale(LC_ALL
, locale
);
1812 #ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS
1813 if (codepage
== 0 && retloc
== NULL
)
1825 retloc
= wxSetlocale(LC_ALL
, wxEmptyString
);
1829 #ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS
1833 if (GetLocaleInfo(LOCALE_USER_DEFAULT
,
1834 LOCALE_IDEFAULTANSICODEPAGE
, buffer
, 16) > 0 &&
1835 wxStrcmp(buffer
, wxT("0")) == 0)
1845 #elif defined(__WXMAC__)
1846 if (lang
== wxLANGUAGE_DEFAULT
)
1847 locale
= wxEmptyString
;
1849 locale
= info
->CanonicalName
;
1851 const char *retloc
= wxSetlocale(LC_ALL
, locale
);
1855 // Some C libraries don't like xx_YY form and require xx only
1856 retloc
= wxSetlocale(LC_ALL
, locale
.Mid(0,2));
1861 #define WX_NO_LOCALE_SUPPORT
1864 #ifndef WX_NO_LOCALE_SUPPORT
1867 wxLogWarning(_("Cannot set locale to language \"%s\"."), name
.c_str());
1869 // continue nevertheless and try to load at least the translations for
1873 if ( !Init(name
, canonical
, retloc
,
1874 (flags
& wxLOCALE_LOAD_DEFAULT
) != 0,
1875 (flags
& wxLOCALE_CONV_ENCODING
) != 0) )
1880 if (IsOk()) // setlocale() succeeded
1884 #endif // !WX_NO_LOCALE_SUPPORT
1889 void wxLocale::AddCatalogLookupPathPrefix(const wxString
& prefix
)
1891 if ( gs_searchPrefixes
.Index(prefix
) == wxNOT_FOUND
)
1893 gs_searchPrefixes
.Add(prefix
);
1895 //else: already have it
1898 /*static*/ int wxLocale::GetSystemLanguage()
1900 CreateLanguagesDB();
1902 // init i to avoid compiler warning
1904 count
= ms_languagesDB
->GetCount();
1906 #if defined(__UNIX__) && !defined(__WXMAC__)
1907 // first get the string identifying the language from the environment
1909 if (!wxGetEnv(wxT("LC_ALL"), &langFull
) &&
1910 !wxGetEnv(wxT("LC_MESSAGES"), &langFull
) &&
1911 !wxGetEnv(wxT("LANG"), &langFull
))
1913 // no language specified, treat it as English
1914 return wxLANGUAGE_ENGLISH_US
;
1917 if ( langFull
== _T("C") || langFull
== _T("POSIX") )
1919 // default C locale is English too
1920 return wxLANGUAGE_ENGLISH_US
;
1923 // the language string has the following form
1925 // lang[_LANG][.encoding][@modifier]
1927 // (see environ(5) in the Open Unix specification)
1929 // where lang is the primary language, LANG is a sublang/territory,
1930 // encoding is the charset to use and modifier "allows the user to select
1931 // a specific instance of localization data within a single category"
1933 // for example, the following strings are valid:
1938 // de_DE.iso88591@euro
1940 // for now we don't use the encoding, although we probably should (doing
1941 // translations of the msg catalogs on the fly as required) (TODO)
1943 // we don't use the modifiers neither but we probably should translate
1944 // "euro" into iso885915
1945 size_t posEndLang
= langFull
.find_first_of(_T("@."));
1946 if ( posEndLang
!= wxString::npos
)
1948 langFull
.Truncate(posEndLang
);
1951 // in addition to the format above, we also can have full language names
1952 // in LANG env var - for example, SuSE is known to use LANG="german" - so
1955 // do we have just the language (or sublang too)?
1956 bool justLang
= langFull
.length() == LEN_LANG
;
1958 (langFull
.length() == LEN_FULL
&& langFull
[LEN_LANG
] == wxT('_')) )
1960 // 0. Make sure the lang is according to latest ISO 639
1961 // (this is necessary because glibc uses iw and in instead
1962 // of he and id respectively).
1964 // the language itself (second part is the dialect/sublang)
1965 wxString langOrig
= ExtractLang(langFull
);
1968 if ( langOrig
== wxT("iw"))
1970 else if (langOrig
== wxT("in"))
1972 else if (langOrig
== wxT("ji"))
1974 else if (langOrig
== wxT("no_NO"))
1975 lang
= wxT("nb_NO");
1976 else if (langOrig
== wxT("no_NY"))
1977 lang
= wxT("nn_NO");
1978 else if (langOrig
== wxT("no"))
1979 lang
= wxT("nb_NO");
1983 // did we change it?
1984 if ( lang
!= langOrig
)
1986 langFull
= lang
+ ExtractNotLang(langFull
);
1989 // 1. Try to find the language either as is:
1990 for ( i
= 0; i
< count
; i
++ )
1992 if ( ms_languagesDB
->Item(i
).CanonicalName
== langFull
)
1998 // 2. If langFull is of the form xx_YY, try to find xx:
1999 if ( i
== count
&& !justLang
)
2001 for ( i
= 0; i
< count
; i
++ )
2003 if ( ms_languagesDB
->Item(i
).CanonicalName
== lang
)
2010 // 3. If langFull is of the form xx, try to find any xx_YY record:
2011 if ( i
== count
&& justLang
)
2013 for ( i
= 0; i
< count
; i
++ )
2015 if ( ExtractLang(ms_languagesDB
->Item(i
).CanonicalName
)
2023 else // not standard format
2025 // try to find the name in verbose description
2026 for ( i
= 0; i
< count
; i
++ )
2028 if (ms_languagesDB
->Item(i
).Description
.CmpNoCase(langFull
) == 0)
2034 #elif defined(__WXMAC__)
2035 const wxChar
* lc
= NULL
;
2036 long lang
= GetScriptVariable( smSystemScript
, smScriptLang
) ;
2037 switch( GetScriptManagerVariable( smRegionCode
) ) {
2053 case verNetherlands
:
2108 // _CY is not part of wx, so we have to translate according to the system language
2109 if ( lang
== langGreek
) {
2112 else if ( lang
== langTurkish
) {
2119 case verYugoCroatian
:
2125 case verPakistanUrdu
:
2128 case verTurkishModified
:
2131 case verItalianSwiss
:
2134 case verInternational
:
2195 case verByeloRussian
:
2217 lc
= wxT("pt_BR ") ;
2225 case verScottishGaelic
:
2240 case verIrishGaelicScript
:
2255 case verSpLatinAmerica
:
2261 case verFrenchUniversal
:
2312 for ( i
= 0; i
< count
; i
++ )
2314 if ( ms_languagesDB
->Item(i
).CanonicalName
== lc
)
2320 #elif defined(__WIN32__)
2321 LCID lcid
= GetUserDefaultLCID();
2324 wxUint32 lang
= PRIMARYLANGID(LANGIDFROMLCID(lcid
));
2325 wxUint32 sublang
= SUBLANGID(LANGIDFROMLCID(lcid
));
2327 for ( i
= 0; i
< count
; i
++ )
2329 if (ms_languagesDB
->Item(i
).WinLang
== lang
&&
2330 ms_languagesDB
->Item(i
).WinSublang
== sublang
)
2336 //else: leave wxlang == wxLANGUAGE_UNKNOWN
2337 #endif // Unix/Win32
2341 // we did find a matching entry, use it
2342 return ms_languagesDB
->Item(i
).Language
;
2345 // no info about this language in the database
2346 return wxLANGUAGE_UNKNOWN
;
2349 // ----------------------------------------------------------------------------
2351 // ----------------------------------------------------------------------------
2353 // this is a bit strange as under Windows we get the encoding name using its
2354 // numeric value and under Unix we do it the other way round, but this just
2355 // reflects the way different systems provide the encoding info
2358 wxString
wxLocale::GetSystemEncodingName()
2362 #if defined(__WIN32__) && !defined(__WXMICROWIN__)
2363 // FIXME: what is the error return value for GetACP()?
2364 UINT codepage
= ::GetACP();
2365 encname
.Printf(_T("windows-%u"), codepage
);
2366 #elif defined(__WXMAC__)
2367 // default is just empty string, this resolves to the default system
2369 #elif defined(__UNIX_LIKE__)
2371 #if defined(HAVE_LANGINFO_H) && defined(CODESET)
2372 // GNU libc provides current character set this way (this conforms
2374 char *oldLocale
= strdup(setlocale(LC_CTYPE
, NULL
));
2375 setlocale(LC_CTYPE
, "");
2376 const char *alang
= nl_langinfo(CODESET
);
2377 setlocale(LC_CTYPE
, oldLocale
);
2382 encname
= wxString::FromAscii( alang
);
2384 else // nl_langinfo() failed
2385 #endif // HAVE_LANGINFO_H
2387 // if we can't get at the character set directly, try to see if it's in
2388 // the environment variables (in most cases this won't work, but I was
2390 char *lang
= getenv( "LC_ALL");
2391 char *dot
= lang
? strchr(lang
, '.') : (char *)NULL
;
2394 lang
= getenv( "LC_CTYPE" );
2396 dot
= strchr(lang
, '.' );
2400 lang
= getenv( "LANG");
2402 dot
= strchr(lang
, '.');
2407 encname
= wxString::FromAscii( dot
+1 );
2410 #endif // Win32/Unix
2416 wxFontEncoding
wxLocale::GetSystemEncoding()
2418 #if defined(__WIN32__) && !defined(__WXMICROWIN__)
2419 UINT codepage
= ::GetACP();
2421 // wxWidgets only knows about CP1250-1257, 874, 932, 936, 949, 950
2422 if ( codepage
>= 1250 && codepage
<= 1257 )
2424 return (wxFontEncoding
)(wxFONTENCODING_CP1250
+ codepage
- 1250);
2427 if ( codepage
== 874 )
2429 return wxFONTENCODING_CP874
;
2432 if ( codepage
== 932 )
2434 return wxFONTENCODING_CP932
;
2437 if ( codepage
== 936 )
2439 return wxFONTENCODING_CP936
;
2442 if ( codepage
== 949 )
2444 return wxFONTENCODING_CP949
;
2447 if ( codepage
== 950 )
2449 return wxFONTENCODING_CP950
;
2451 #elif defined(__WXMAC__)
2452 TextEncoding encoding
= 0 ;
2454 encoding
= CFStringGetSystemEncoding() ;
2456 UpgradeScriptInfoToTextEncoding ( smSystemScript
, kTextLanguageDontCare
, kTextRegionDontCare
, NULL
, &encoding
) ;
2458 return wxMacGetFontEncFromSystemEnc( encoding
) ;
2459 #elif defined(__UNIX_LIKE__) && wxUSE_FONTMAP
2460 const wxString encname
= GetSystemEncodingName();
2461 if ( !encname
.empty() )
2463 wxFontEncoding enc
= wxFontMapperBase::GetEncodingFromName(encname
);
2465 // on some modern Linux systems (RedHat 8) the default system locale
2466 // is UTF8 -- but it isn't supported by wxGTK1 in ANSI build at all so
2467 // don't even try to use it in this case
2468 #if !wxUSE_UNICODE && \
2469 ((defined(__WXGTK__) && !defined(__WXGTK20__)) || defined(__WXMOTIF__))
2470 if ( enc
== wxFONTENCODING_UTF8
)
2472 // the most similar supported encoding...
2473 enc
= wxFONTENCODING_ISO8859_1
;
2475 #endif // !wxUSE_UNICODE
2477 // GetEncodingFromName() returns wxFONTENCODING_DEFAULT for C locale
2478 // (a.k.a. US-ASCII) which is arguably a bug but keep it like this for
2479 // backwards compatibility and just take care to not return
2480 // wxFONTENCODING_DEFAULT from here as this surely doesn't make sense
2481 if ( enc
== wxFONTENCODING_DEFAULT
)
2483 // we don't have wxFONTENCODING_ASCII, so use the closest one
2484 return wxFONTENCODING_ISO8859_1
;
2487 if ( enc
!= wxFONTENCODING_MAX
)
2491 //else: return wxFONTENCODING_SYSTEM below
2493 #endif // Win32/Unix
2495 return wxFONTENCODING_SYSTEM
;
2499 void wxLocale::AddLanguage(const wxLanguageInfo
& info
)
2501 CreateLanguagesDB();
2502 ms_languagesDB
->Add(info
);
2506 const wxLanguageInfo
*wxLocale::GetLanguageInfo(int lang
)
2508 CreateLanguagesDB();
2510 // calling GetLanguageInfo(wxLANGUAGE_DEFAULT) is a natural thing to do, so
2512 if ( lang
== wxLANGUAGE_DEFAULT
)
2513 lang
= GetSystemLanguage();
2515 const size_t count
= ms_languagesDB
->GetCount();
2516 for ( size_t i
= 0; i
< count
; i
++ )
2518 if ( ms_languagesDB
->Item(i
).Language
== lang
)
2520 // We need to create a temporary here in order to make this work with BCC in final build mode
2521 wxLanguageInfo
*ptr
= &ms_languagesDB
->Item(i
);
2530 wxString
wxLocale::GetLanguageName(int lang
)
2532 const wxLanguageInfo
*info
= GetLanguageInfo(lang
);
2534 return wxEmptyString
;
2536 return info
->Description
;
2540 const wxLanguageInfo
*wxLocale::FindLanguageInfo(const wxString
& locale
)
2542 CreateLanguagesDB();
2544 const wxLanguageInfo
*infoRet
= NULL
;
2546 const size_t count
= ms_languagesDB
->GetCount();
2547 for ( size_t i
= 0; i
< count
; i
++ )
2549 const wxLanguageInfo
*info
= &ms_languagesDB
->Item(i
);
2551 if ( wxStricmp(locale
, info
->CanonicalName
) == 0 ||
2552 wxStricmp(locale
, info
->Description
) == 0 )
2554 // exact match, stop searching
2559 if ( wxStricmp(locale
, info
->CanonicalName
.BeforeFirst(_T('_'))) == 0 )
2561 // a match -- but maybe we'll find an exact one later, so continue
2564 // OTOH, maybe we had already found a language match and in this
2565 // case don't overwrite it because the entry for the default
2566 // country always appears first in ms_languagesDB
2575 wxString
wxLocale::GetSysName() const
2579 return wxSetlocale(LC_ALL
, NULL
);
2581 return wxEmptyString
;
2586 wxLocale::~wxLocale()
2589 wxMsgCatalog
*pTmpCat
;
2590 while ( m_pMsgCat
!= NULL
) {
2591 pTmpCat
= m_pMsgCat
;
2592 m_pMsgCat
= m_pMsgCat
->m_pNext
;
2596 // restore old locale pointer
2597 wxSetLocale(m_pOldLocale
);
2601 wxSetlocale(LC_ALL
, m_pszOldLocale
);
2603 free((wxChar
*)m_pszOldLocale
); // const_cast
2606 // get the translation of given string in current locale
2607 const wxString
& wxLocale::GetString(const wxString
& origString
,
2608 const wxString
& domain
) const
2610 return GetString(origString
, origString
, size_t(-1), domain
);
2613 const wxString
& wxLocale::GetString(const wxString
& origString
,
2614 const wxString
& origString2
,
2616 const wxString
& domain
) const
2618 if ( origString
.empty() )
2619 return GetUntranslatedString(origString
);
2621 const wxString
*trans
= NULL
;
2622 wxMsgCatalog
*pMsgCat
;
2624 if ( !domain
.empty() )
2626 pMsgCat
= FindCatalog(domain
);
2628 // does the catalog exist?
2629 if ( pMsgCat
!= NULL
)
2630 trans
= pMsgCat
->GetString(origString
, n
);
2634 // search in all domains
2635 for ( pMsgCat
= m_pMsgCat
; pMsgCat
!= NULL
; pMsgCat
= pMsgCat
->m_pNext
)
2637 trans
= pMsgCat
->GetString(origString
, n
);
2638 if ( trans
!= NULL
) // take the first found
2643 if ( trans
== NULL
)
2646 if ( !NoTransErr::Suppress() )
2648 NoTransErr noTransErr
;
2650 wxLogTrace(TRACE_I18N
,
2651 _T("string \"%s\"[%ld] not found in %slocale '%s'."),
2652 origString
, (long)n
,
2654 ? (const wxChar
*)wxString::Format(_T("domain '%s' "), domain
).c_str()
2656 m_strLocale
.c_str());
2658 #endif // __WXDEBUG__
2660 if (n
== size_t(-1))
2661 return GetUntranslatedString(origString
);
2663 return GetUntranslatedString(n
== 1 ? origString
: origString2
);
2669 WX_DECLARE_HASH_SET(wxString
, wxStringHash
, wxStringEqual
,
2670 wxLocaleUntranslatedStrings
);
2673 const wxString
& wxLocale::GetUntranslatedString(const wxString
& str
)
2675 static wxLocaleUntranslatedStrings s_strings
;
2677 wxLocaleUntranslatedStrings::iterator i
= s_strings
.find(str
);
2678 if ( i
== s_strings
.end() )
2679 return *s_strings
.insert(str
).first
;
2684 wxString
wxLocale::GetHeaderValue(const wxString
& header
,
2685 const wxString
& domain
) const
2687 if ( header
.empty() )
2688 return wxEmptyString
;
2690 const wxString
*trans
= NULL
;
2691 wxMsgCatalog
*pMsgCat
;
2693 if ( !domain
.empty() )
2695 pMsgCat
= FindCatalog(domain
);
2697 // does the catalog exist?
2698 if ( pMsgCat
== NULL
)
2699 return wxEmptyString
;
2701 trans
= pMsgCat
->GetString(wxEmptyString
, (size_t)-1);
2705 // search in all domains
2706 for ( pMsgCat
= m_pMsgCat
; pMsgCat
!= NULL
; pMsgCat
= pMsgCat
->m_pNext
)
2708 trans
= pMsgCat
->GetString(wxEmptyString
, (size_t)-1);
2709 if ( trans
!= NULL
) // take the first found
2714 if ( !trans
|| trans
->empty() )
2715 return wxEmptyString
;
2717 size_t found
= trans
->find(header
);
2718 if ( found
== wxString::npos
)
2719 return wxEmptyString
;
2721 found
+= header
.length() + 2 /* ': ' */;
2723 // Every header is separated by \n
2725 size_t endLine
= trans
->find(wxT('\n'), found
);
2726 size_t len
= (endLine
== wxString::npos
) ?
2727 wxString::npos
: (endLine
- found
);
2729 return trans
->substr(found
, len
);
2733 // find catalog by name in a linked list, return NULL if !found
2734 wxMsgCatalog
*wxLocale::FindCatalog(const wxString
& domain
) const
2736 // linear search in the linked list
2737 wxMsgCatalog
*pMsgCat
;
2738 for ( pMsgCat
= m_pMsgCat
; pMsgCat
!= NULL
; pMsgCat
= pMsgCat
->m_pNext
)
2740 if ( pMsgCat
->GetName() == domain
)
2747 // check if the given locale is provided by OS and C run time
2749 bool wxLocale::IsAvailable(int lang
)
2751 const wxLanguageInfo
*info
= wxLocale::GetLanguageInfo(lang
);
2752 wxCHECK_MSG( info
, false, _T("invalid language") );
2754 #if defined(__WIN32__)
2755 if ( !info
->WinLang
)
2758 if ( !::IsValidLocale
2760 MAKELCID(MAKELANGID(info
->WinLang
, info
->WinSublang
),
2766 #elif defined(__UNIX__)
2768 // Test if setting the locale works, then set it back.
2769 const char *oldLocale
= wxSetlocale(LC_ALL
, "");
2770 const char *tmp
= wxSetlocaleTryUTF8(LC_ALL
, info
->CanonicalName
);
2773 // Some C libraries don't like xx_YY form and require xx only
2774 tmp
= wxSetlocaleTryUTF8(LC_ALL
, info
->CanonicalName
.Left(2));
2778 // restore the original locale
2779 wxSetlocale(LC_ALL
, oldLocale
);
2785 // check if the given catalog is loaded
2786 bool wxLocale::IsLoaded(const wxString
& szDomain
) const
2788 return FindCatalog(szDomain
) != NULL
;
2791 // add a catalog to our linked list
2792 bool wxLocale::AddCatalog(const wxString
& szDomain
)
2794 return AddCatalog(szDomain
, wxLANGUAGE_ENGLISH_US
, wxEmptyString
);
2797 // add a catalog to our linked list
2798 bool wxLocale::AddCatalog(const wxString
& szDomain
,
2799 wxLanguage msgIdLanguage
,
2800 const wxString
& msgIdCharset
)
2803 wxMsgCatalog
*pMsgCat
= new wxMsgCatalog
;
2805 if ( pMsgCat
->Load(m_strShort
, szDomain
, msgIdCharset
, m_bConvertEncoding
) ) {
2806 // add it to the head of the list so that in GetString it will
2807 // be searched before the catalogs added earlier
2808 pMsgCat
->m_pNext
= m_pMsgCat
;
2809 m_pMsgCat
= pMsgCat
;
2814 // don't add it because it couldn't be loaded anyway
2817 // It is OK to not load catalog if the msgid language and m_language match,
2818 // in which case we can directly display the texts embedded in program's
2820 if (m_language
== msgIdLanguage
)
2823 // If there's no exact match, we may still get partial match where the
2824 // (basic) language is same, but the country differs. For example, it's
2825 // permitted to use en_US strings from sources even if m_language is en_GB:
2826 const wxLanguageInfo
*msgIdLangInfo
= GetLanguageInfo(msgIdLanguage
);
2827 if ( msgIdLangInfo
&&
2828 msgIdLangInfo
->CanonicalName
.Mid(0, 2) == m_strShort
.Mid(0, 2) )
2837 // ----------------------------------------------------------------------------
2838 // accessors for locale-dependent data
2839 // ----------------------------------------------------------------------------
2844 wxString
wxLocale::GetInfo(wxLocaleInfo index
, wxLocaleCategory
WXUNUSED(cat
))
2849 buffer
[0] = wxT('\0');
2852 case wxLOCALE_DECIMAL_POINT
:
2853 count
= ::GetLocaleInfo(LOCALE_USER_DEFAULT
, LOCALE_SDECIMAL
, buffer
, 256);
2860 case wxSYS_LIST_SEPARATOR
:
2861 count
= ::GetLocaleInfo(LOCALE_USER_DEFAULT
, LOCALE_SLIST
, buffer
, 256);
2867 case wxSYS_LEADING_ZERO
: // 0 means no leading zero, 1 means leading zero
2868 count
= ::GetLocaleInfo(LOCALE_USER_DEFAULT
, LOCALE_ILZERO
, buffer
, 256);
2876 wxFAIL_MSG(wxT("Unknown System String !"));
2884 wxString
wxLocale::GetInfo(wxLocaleInfo index
, wxLocaleCategory cat
)
2886 struct lconv
*locale_info
= localeconv();
2889 case wxLOCALE_CAT_NUMBER
:
2892 case wxLOCALE_THOUSANDS_SEP
:
2893 return wxString(locale_info
->thousands_sep
,
2895 case wxLOCALE_DECIMAL_POINT
:
2896 return wxString(locale_info
->decimal_point
,
2899 return wxEmptyString
;
2901 case wxLOCALE_CAT_MONEY
:
2904 case wxLOCALE_THOUSANDS_SEP
:
2905 return wxString(locale_info
->mon_thousands_sep
,
2907 case wxLOCALE_DECIMAL_POINT
:
2908 return wxString(locale_info
->mon_decimal_point
,
2911 return wxEmptyString
;
2914 return wxEmptyString
;
2918 #endif // __WXMSW__/!__WXMSW__
2920 // ----------------------------------------------------------------------------
2921 // global functions and variables
2922 // ----------------------------------------------------------------------------
2924 // retrieve/change current locale
2925 // ------------------------------
2927 // the current locale object
2928 static wxLocale
*g_pLocale
= NULL
;
2930 wxLocale
*wxGetLocale()
2935 wxLocale
*wxSetLocale(wxLocale
*pLocale
)
2937 wxLocale
*pOld
= g_pLocale
;
2938 g_pLocale
= pLocale
;
2944 // ----------------------------------------------------------------------------
2945 // wxLocale module (for lazy destruction of languagesDB)
2946 // ----------------------------------------------------------------------------
2948 class wxLocaleModule
: public wxModule
2950 DECLARE_DYNAMIC_CLASS(wxLocaleModule
)
2953 bool OnInit() { return true; }
2954 void OnExit() { wxLocale::DestroyLanguagesDB(); }
2957 IMPLEMENT_DYNAMIC_CLASS(wxLocaleModule
, wxModule
)
2961 // ----------------------------------------------------------------------------
2962 // default languages table & initialization
2963 // ----------------------------------------------------------------------------
2967 // --- --- --- generated code begins here --- --- ---
2969 // This table is generated by misc/languages/genlang.py
2970 // When making changes, please put them into misc/languages/langtabl.txt
2972 #if !defined(__WIN32__) || defined(__WXMICROWIN__)
2974 #define SETWINLANG(info,lang,sublang)
2978 #define SETWINLANG(info,lang,sublang) \
2979 info.WinLang = lang, info.WinSublang = sublang;
2981 #ifndef LANG_AFRIKAANS
2982 #define LANG_AFRIKAANS (0)
2984 #ifndef LANG_ALBANIAN
2985 #define LANG_ALBANIAN (0)
2988 #define LANG_ARABIC (0)
2990 #ifndef LANG_ARMENIAN
2991 #define LANG_ARMENIAN (0)
2993 #ifndef LANG_ASSAMESE
2994 #define LANG_ASSAMESE (0)
2997 #define LANG_AZERI (0)
3000 #define LANG_BASQUE (0)
3002 #ifndef LANG_BELARUSIAN
3003 #define LANG_BELARUSIAN (0)
3005 #ifndef LANG_BENGALI
3006 #define LANG_BENGALI (0)
3008 #ifndef LANG_BULGARIAN
3009 #define LANG_BULGARIAN (0)
3011 #ifndef LANG_CATALAN
3012 #define LANG_CATALAN (0)
3014 #ifndef LANG_CHINESE
3015 #define LANG_CHINESE (0)
3017 #ifndef LANG_CROATIAN
3018 #define LANG_CROATIAN (0)
3021 #define LANG_CZECH (0)
3024 #define LANG_DANISH (0)
3027 #define LANG_DUTCH (0)
3029 #ifndef LANG_ENGLISH
3030 #define LANG_ENGLISH (0)
3032 #ifndef LANG_ESTONIAN
3033 #define LANG_ESTONIAN (0)
3035 #ifndef LANG_FAEROESE
3036 #define LANG_FAEROESE (0)
3039 #define LANG_FARSI (0)
3041 #ifndef LANG_FINNISH
3042 #define LANG_FINNISH (0)
3045 #define LANG_FRENCH (0)
3047 #ifndef LANG_GEORGIAN
3048 #define LANG_GEORGIAN (0)
3051 #define LANG_GERMAN (0)
3054 #define LANG_GREEK (0)
3056 #ifndef LANG_GUJARATI
3057 #define LANG_GUJARATI (0)
3060 #define LANG_HEBREW (0)
3063 #define LANG_HINDI (0)
3065 #ifndef LANG_HUNGARIAN
3066 #define LANG_HUNGARIAN (0)
3068 #ifndef LANG_ICELANDIC
3069 #define LANG_ICELANDIC (0)
3071 #ifndef LANG_INDONESIAN
3072 #define LANG_INDONESIAN (0)
3074 #ifndef LANG_ITALIAN
3075 #define LANG_ITALIAN (0)
3077 #ifndef LANG_JAPANESE
3078 #define LANG_JAPANESE (0)
3080 #ifndef LANG_KANNADA
3081 #define LANG_KANNADA (0)
3083 #ifndef LANG_KASHMIRI
3084 #define LANG_KASHMIRI (0)
3087 #define LANG_KAZAK (0)
3089 #ifndef LANG_KONKANI
3090 #define LANG_KONKANI (0)
3093 #define LANG_KOREAN (0)
3095 #ifndef LANG_LATVIAN
3096 #define LANG_LATVIAN (0)
3098 #ifndef LANG_LITHUANIAN
3099 #define LANG_LITHUANIAN (0)
3101 #ifndef LANG_MACEDONIAN
3102 #define LANG_MACEDONIAN (0)
3105 #define LANG_MALAY (0)
3107 #ifndef LANG_MALAYALAM
3108 #define LANG_MALAYALAM (0)
3110 #ifndef LANG_MANIPURI
3111 #define LANG_MANIPURI (0)
3113 #ifndef LANG_MARATHI
3114 #define LANG_MARATHI (0)
3117 #define LANG_NEPALI (0)
3119 #ifndef LANG_NORWEGIAN
3120 #define LANG_NORWEGIAN (0)
3123 #define LANG_ORIYA (0)
3126 #define LANG_POLISH (0)
3128 #ifndef LANG_PORTUGUESE
3129 #define LANG_PORTUGUESE (0)
3131 #ifndef LANG_PUNJABI
3132 #define LANG_PUNJABI (0)
3134 #ifndef LANG_ROMANIAN
3135 #define LANG_ROMANIAN (0)
3137 #ifndef LANG_RUSSIAN
3138 #define LANG_RUSSIAN (0)
3140 #ifndef LANG_SANSKRIT
3141 #define LANG_SANSKRIT (0)
3143 #ifndef LANG_SERBIAN
3144 #define LANG_SERBIAN (0)
3147 #define LANG_SINDHI (0)
3150 #define LANG_SLOVAK (0)
3152 #ifndef LANG_SLOVENIAN
3153 #define LANG_SLOVENIAN (0)
3155 #ifndef LANG_SPANISH
3156 #define LANG_SPANISH (0)
3158 #ifndef LANG_SWAHILI
3159 #define LANG_SWAHILI (0)
3161 #ifndef LANG_SWEDISH
3162 #define LANG_SWEDISH (0)
3165 #define LANG_TAMIL (0)
3168 #define LANG_TATAR (0)
3171 #define LANG_TELUGU (0)
3174 #define LANG_THAI (0)
3176 #ifndef LANG_TURKISH
3177 #define LANG_TURKISH (0)
3179 #ifndef LANG_UKRAINIAN
3180 #define LANG_UKRAINIAN (0)
3183 #define LANG_URDU (0)
3186 #define LANG_UZBEK (0)
3188 #ifndef LANG_VIETNAMESE
3189 #define LANG_VIETNAMESE (0)
3191 #ifndef SUBLANG_ARABIC_ALGERIA
3192 #define SUBLANG_ARABIC_ALGERIA SUBLANG_DEFAULT
3194 #ifndef SUBLANG_ARABIC_BAHRAIN
3195 #define SUBLANG_ARABIC_BAHRAIN SUBLANG_DEFAULT
3197 #ifndef SUBLANG_ARABIC_EGYPT
3198 #define SUBLANG_ARABIC_EGYPT SUBLANG_DEFAULT
3200 #ifndef SUBLANG_ARABIC_IRAQ
3201 #define SUBLANG_ARABIC_IRAQ SUBLANG_DEFAULT
3203 #ifndef SUBLANG_ARABIC_JORDAN
3204 #define SUBLANG_ARABIC_JORDAN SUBLANG_DEFAULT
3206 #ifndef SUBLANG_ARABIC_KUWAIT
3207 #define SUBLANG_ARABIC_KUWAIT SUBLANG_DEFAULT
3209 #ifndef SUBLANG_ARABIC_LEBANON
3210 #define SUBLANG_ARABIC_LEBANON SUBLANG_DEFAULT
3212 #ifndef SUBLANG_ARABIC_LIBYA
3213 #define SUBLANG_ARABIC_LIBYA SUBLANG_DEFAULT
3215 #ifndef SUBLANG_ARABIC_MOROCCO
3216 #define SUBLANG_ARABIC_MOROCCO SUBLANG_DEFAULT
3218 #ifndef SUBLANG_ARABIC_OMAN
3219 #define SUBLANG_ARABIC_OMAN SUBLANG_DEFAULT
3221 #ifndef SUBLANG_ARABIC_QATAR
3222 #define SUBLANG_ARABIC_QATAR SUBLANG_DEFAULT
3224 #ifndef SUBLANG_ARABIC_SAUDI_ARABIA
3225 #define SUBLANG_ARABIC_SAUDI_ARABIA SUBLANG_DEFAULT
3227 #ifndef SUBLANG_ARABIC_SYRIA
3228 #define SUBLANG_ARABIC_SYRIA SUBLANG_DEFAULT
3230 #ifndef SUBLANG_ARABIC_TUNISIA
3231 #define SUBLANG_ARABIC_TUNISIA SUBLANG_DEFAULT
3233 #ifndef SUBLANG_ARABIC_UAE
3234 #define SUBLANG_ARABIC_UAE SUBLANG_DEFAULT
3236 #ifndef SUBLANG_ARABIC_YEMEN
3237 #define SUBLANG_ARABIC_YEMEN SUBLANG_DEFAULT
3239 #ifndef SUBLANG_AZERI_CYRILLIC
3240 #define SUBLANG_AZERI_CYRILLIC SUBLANG_DEFAULT
3242 #ifndef SUBLANG_AZERI_LATIN
3243 #define SUBLANG_AZERI_LATIN SUBLANG_DEFAULT
3245 #ifndef SUBLANG_CHINESE_SIMPLIFIED
3246 #define SUBLANG_CHINESE_SIMPLIFIED SUBLANG_DEFAULT
3248 #ifndef SUBLANG_CHINESE_TRADITIONAL
3249 #define SUBLANG_CHINESE_TRADITIONAL SUBLANG_DEFAULT
3251 #ifndef SUBLANG_CHINESE_HONGKONG
3252 #define SUBLANG_CHINESE_HONGKONG SUBLANG_DEFAULT
3254 #ifndef SUBLANG_CHINESE_MACAU
3255 #define SUBLANG_CHINESE_MACAU SUBLANG_DEFAULT
3257 #ifndef SUBLANG_CHINESE_SINGAPORE
3258 #define SUBLANG_CHINESE_SINGAPORE SUBLANG_DEFAULT
3260 #ifndef SUBLANG_DUTCH
3261 #define SUBLANG_DUTCH SUBLANG_DEFAULT
3263 #ifndef SUBLANG_DUTCH_BELGIAN
3264 #define SUBLANG_DUTCH_BELGIAN SUBLANG_DEFAULT
3266 #ifndef SUBLANG_ENGLISH_UK
3267 #define SUBLANG_ENGLISH_UK SUBLANG_DEFAULT
3269 #ifndef SUBLANG_ENGLISH_US
3270 #define SUBLANG_ENGLISH_US SUBLANG_DEFAULT
3272 #ifndef SUBLANG_ENGLISH_AUS
3273 #define SUBLANG_ENGLISH_AUS SUBLANG_DEFAULT
3275 #ifndef SUBLANG_ENGLISH_BELIZE
3276 #define SUBLANG_ENGLISH_BELIZE SUBLANG_DEFAULT
3278 #ifndef SUBLANG_ENGLISH_CAN
3279 #define SUBLANG_ENGLISH_CAN SUBLANG_DEFAULT
3281 #ifndef SUBLANG_ENGLISH_CARIBBEAN
3282 #define SUBLANG_ENGLISH_CARIBBEAN SUBLANG_DEFAULT
3284 #ifndef SUBLANG_ENGLISH_EIRE
3285 #define SUBLANG_ENGLISH_EIRE SUBLANG_DEFAULT
3287 #ifndef SUBLANG_ENGLISH_JAMAICA
3288 #define SUBLANG_ENGLISH_JAMAICA SUBLANG_DEFAULT
3290 #ifndef SUBLANG_ENGLISH_NZ
3291 #define SUBLANG_ENGLISH_NZ SUBLANG_DEFAULT
3293 #ifndef SUBLANG_ENGLISH_PHILIPPINES
3294 #define SUBLANG_ENGLISH_PHILIPPINES SUBLANG_DEFAULT
3296 #ifndef SUBLANG_ENGLISH_SOUTH_AFRICA
3297 #define SUBLANG_ENGLISH_SOUTH_AFRICA SUBLANG_DEFAULT
3299 #ifndef SUBLANG_ENGLISH_TRINIDAD
3300 #define SUBLANG_ENGLISH_TRINIDAD SUBLANG_DEFAULT
3302 #ifndef SUBLANG_ENGLISH_ZIMBABWE
3303 #define SUBLANG_ENGLISH_ZIMBABWE SUBLANG_DEFAULT
3305 #ifndef SUBLANG_FRENCH
3306 #define SUBLANG_FRENCH SUBLANG_DEFAULT
3308 #ifndef SUBLANG_FRENCH_BELGIAN
3309 #define SUBLANG_FRENCH_BELGIAN SUBLANG_DEFAULT
3311 #ifndef SUBLANG_FRENCH_CANADIAN
3312 #define SUBLANG_FRENCH_CANADIAN SUBLANG_DEFAULT
3314 #ifndef SUBLANG_FRENCH_LUXEMBOURG
3315 #define SUBLANG_FRENCH_LUXEMBOURG SUBLANG_DEFAULT
3317 #ifndef SUBLANG_FRENCH_MONACO
3318 #define SUBLANG_FRENCH_MONACO SUBLANG_DEFAULT
3320 #ifndef SUBLANG_FRENCH_SWISS
3321 #define SUBLANG_FRENCH_SWISS SUBLANG_DEFAULT
3323 #ifndef SUBLANG_GERMAN
3324 #define SUBLANG_GERMAN SUBLANG_DEFAULT
3326 #ifndef SUBLANG_GERMAN_AUSTRIAN
3327 #define SUBLANG_GERMAN_AUSTRIAN SUBLANG_DEFAULT
3329 #ifndef SUBLANG_GERMAN_LIECHTENSTEIN
3330 #define SUBLANG_GERMAN_LIECHTENSTEIN SUBLANG_DEFAULT
3332 #ifndef SUBLANG_GERMAN_LUXEMBOURG
3333 #define SUBLANG_GERMAN_LUXEMBOURG SUBLANG_DEFAULT
3335 #ifndef SUBLANG_GERMAN_SWISS
3336 #define SUBLANG_GERMAN_SWISS SUBLANG_DEFAULT
3338 #ifndef SUBLANG_ITALIAN
3339 #define SUBLANG_ITALIAN SUBLANG_DEFAULT
3341 #ifndef SUBLANG_ITALIAN_SWISS
3342 #define SUBLANG_ITALIAN_SWISS SUBLANG_DEFAULT
3344 #ifndef SUBLANG_KASHMIRI_INDIA
3345 #define SUBLANG_KASHMIRI_INDIA SUBLANG_DEFAULT
3347 #ifndef SUBLANG_KOREAN
3348 #define SUBLANG_KOREAN SUBLANG_DEFAULT
3350 #ifndef SUBLANG_LITHUANIAN
3351 #define SUBLANG_LITHUANIAN SUBLANG_DEFAULT
3353 #ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM
3354 #define SUBLANG_MALAY_BRUNEI_DARUSSALAM SUBLANG_DEFAULT
3356 #ifndef SUBLANG_MALAY_MALAYSIA
3357 #define SUBLANG_MALAY_MALAYSIA SUBLANG_DEFAULT
3359 #ifndef SUBLANG_NEPALI_INDIA
3360 #define SUBLANG_NEPALI_INDIA SUBLANG_DEFAULT
3362 #ifndef SUBLANG_NORWEGIAN_BOKMAL
3363 #define SUBLANG_NORWEGIAN_BOKMAL SUBLANG_DEFAULT
3365 #ifndef SUBLANG_NORWEGIAN_NYNORSK
3366 #define SUBLANG_NORWEGIAN_NYNORSK SUBLANG_DEFAULT
3368 #ifndef SUBLANG_PORTUGUESE
3369 #define SUBLANG_PORTUGUESE SUBLANG_DEFAULT
3371 #ifndef SUBLANG_PORTUGUESE_BRAZILIAN
3372 #define SUBLANG_PORTUGUESE_BRAZILIAN SUBLANG_DEFAULT
3374 #ifndef SUBLANG_SERBIAN_CYRILLIC
3375 #define SUBLANG_SERBIAN_CYRILLIC SUBLANG_DEFAULT
3377 #ifndef SUBLANG_SERBIAN_LATIN
3378 #define SUBLANG_SERBIAN_LATIN SUBLANG_DEFAULT
3380 #ifndef SUBLANG_SPANISH
3381 #define SUBLANG_SPANISH SUBLANG_DEFAULT
3383 #ifndef SUBLANG_SPANISH_ARGENTINA
3384 #define SUBLANG_SPANISH_ARGENTINA SUBLANG_DEFAULT
3386 #ifndef SUBLANG_SPANISH_BOLIVIA
3387 #define SUBLANG_SPANISH_BOLIVIA SUBLANG_DEFAULT
3389 #ifndef SUBLANG_SPANISH_CHILE
3390 #define SUBLANG_SPANISH_CHILE SUBLANG_DEFAULT
3392 #ifndef SUBLANG_SPANISH_COLOMBIA
3393 #define SUBLANG_SPANISH_COLOMBIA SUBLANG_DEFAULT
3395 #ifndef SUBLANG_SPANISH_COSTA_RICA
3396 #define SUBLANG_SPANISH_COSTA_RICA SUBLANG_DEFAULT
3398 #ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC
3399 #define SUBLANG_SPANISH_DOMINICAN_REPUBLIC SUBLANG_DEFAULT
3401 #ifndef SUBLANG_SPANISH_ECUADOR
3402 #define SUBLANG_SPANISH_ECUADOR SUBLANG_DEFAULT
3404 #ifndef SUBLANG_SPANISH_EL_SALVADOR
3405 #define SUBLANG_SPANISH_EL_SALVADOR SUBLANG_DEFAULT
3407 #ifndef SUBLANG_SPANISH_GUATEMALA
3408 #define SUBLANG_SPANISH_GUATEMALA SUBLANG_DEFAULT
3410 #ifndef SUBLANG_SPANISH_HONDURAS
3411 #define SUBLANG_SPANISH_HONDURAS SUBLANG_DEFAULT
3413 #ifndef SUBLANG_SPANISH_MEXICAN
3414 #define SUBLANG_SPANISH_MEXICAN SUBLANG_DEFAULT
3416 #ifndef SUBLANG_SPANISH_MODERN
3417 #define SUBLANG_SPANISH_MODERN SUBLANG_DEFAULT
3419 #ifndef SUBLANG_SPANISH_NICARAGUA
3420 #define SUBLANG_SPANISH_NICARAGUA SUBLANG_DEFAULT
3422 #ifndef SUBLANG_SPANISH_PANAMA
3423 #define SUBLANG_SPANISH_PANAMA SUBLANG_DEFAULT
3425 #ifndef SUBLANG_SPANISH_PARAGUAY
3426 #define SUBLANG_SPANISH_PARAGUAY SUBLANG_DEFAULT
3428 #ifndef SUBLANG_SPANISH_PERU
3429 #define SUBLANG_SPANISH_PERU SUBLANG_DEFAULT
3431 #ifndef SUBLANG_SPANISH_PUERTO_RICO
3432 #define SUBLANG_SPANISH_PUERTO_RICO SUBLANG_DEFAULT
3434 #ifndef SUBLANG_SPANISH_URUGUAY
3435 #define SUBLANG_SPANISH_URUGUAY SUBLANG_DEFAULT
3437 #ifndef SUBLANG_SPANISH_VENEZUELA
3438 #define SUBLANG_SPANISH_VENEZUELA SUBLANG_DEFAULT
3440 #ifndef SUBLANG_SWEDISH
3441 #define SUBLANG_SWEDISH SUBLANG_DEFAULT
3443 #ifndef SUBLANG_SWEDISH_FINLAND
3444 #define SUBLANG_SWEDISH_FINLAND SUBLANG_DEFAULT
3446 #ifndef SUBLANG_URDU_INDIA
3447 #define SUBLANG_URDU_INDIA SUBLANG_DEFAULT
3449 #ifndef SUBLANG_URDU_PAKISTAN
3450 #define SUBLANG_URDU_PAKISTAN SUBLANG_DEFAULT
3452 #ifndef SUBLANG_UZBEK_CYRILLIC
3453 #define SUBLANG_UZBEK_CYRILLIC SUBLANG_DEFAULT
3455 #ifndef SUBLANG_UZBEK_LATIN
3456 #define SUBLANG_UZBEK_LATIN SUBLANG_DEFAULT
3462 #define LNG(wxlang, canonical, winlang, winsublang, layout, desc) \
3463 info.Language = wxlang; \
3464 info.CanonicalName = wxT(canonical); \
3465 info.LayoutDirection = layout; \
3466 info.Description = wxT(desc); \
3467 SETWINLANG(info, winlang, winsublang) \
3470 void wxLocale::InitLanguagesDB()
3472 wxLanguageInfo info
;
3473 wxStringTokenizer tkn
;
3475 LNG(wxLANGUAGE_ABKHAZIAN
, "ab" , 0 , 0 , wxLayout_LeftToRight
, "Abkhazian")
3476 LNG(wxLANGUAGE_AFAR
, "aa" , 0 , 0 , wxLayout_LeftToRight
, "Afar")
3477 LNG(wxLANGUAGE_AFRIKAANS
, "af_ZA", LANG_AFRIKAANS
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Afrikaans")
3478 LNG(wxLANGUAGE_ALBANIAN
, "sq_AL", LANG_ALBANIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Albanian")
3479 LNG(wxLANGUAGE_AMHARIC
, "am" , 0 , 0 , wxLayout_LeftToRight
, "Amharic")
3480 LNG(wxLANGUAGE_ARABIC
, "ar" , LANG_ARABIC
, SUBLANG_DEFAULT
, wxLayout_RightToLeft
, "Arabic")
3481 LNG(wxLANGUAGE_ARABIC_ALGERIA
, "ar_DZ", LANG_ARABIC
, SUBLANG_ARABIC_ALGERIA
, wxLayout_RightToLeft
, "Arabic (Algeria)")
3482 LNG(wxLANGUAGE_ARABIC_BAHRAIN
, "ar_BH", LANG_ARABIC
, SUBLANG_ARABIC_BAHRAIN
, wxLayout_RightToLeft
, "Arabic (Bahrain)")
3483 LNG(wxLANGUAGE_ARABIC_EGYPT
, "ar_EG", LANG_ARABIC
, SUBLANG_ARABIC_EGYPT
, wxLayout_RightToLeft
, "Arabic (Egypt)")
3484 LNG(wxLANGUAGE_ARABIC_IRAQ
, "ar_IQ", LANG_ARABIC
, SUBLANG_ARABIC_IRAQ
, wxLayout_RightToLeft
, "Arabic (Iraq)")
3485 LNG(wxLANGUAGE_ARABIC_JORDAN
, "ar_JO", LANG_ARABIC
, SUBLANG_ARABIC_JORDAN
, wxLayout_RightToLeft
, "Arabic (Jordan)")
3486 LNG(wxLANGUAGE_ARABIC_KUWAIT
, "ar_KW", LANG_ARABIC
, SUBLANG_ARABIC_KUWAIT
, wxLayout_RightToLeft
, "Arabic (Kuwait)")
3487 LNG(wxLANGUAGE_ARABIC_LEBANON
, "ar_LB", LANG_ARABIC
, SUBLANG_ARABIC_LEBANON
, wxLayout_RightToLeft
, "Arabic (Lebanon)")
3488 LNG(wxLANGUAGE_ARABIC_LIBYA
, "ar_LY", LANG_ARABIC
, SUBLANG_ARABIC_LIBYA
, wxLayout_RightToLeft
, "Arabic (Libya)")
3489 LNG(wxLANGUAGE_ARABIC_MOROCCO
, "ar_MA", LANG_ARABIC
, SUBLANG_ARABIC_MOROCCO
, wxLayout_RightToLeft
, "Arabic (Morocco)")
3490 LNG(wxLANGUAGE_ARABIC_OMAN
, "ar_OM", LANG_ARABIC
, SUBLANG_ARABIC_OMAN
, wxLayout_RightToLeft
, "Arabic (Oman)")
3491 LNG(wxLANGUAGE_ARABIC_QATAR
, "ar_QA", LANG_ARABIC
, SUBLANG_ARABIC_QATAR
, wxLayout_RightToLeft
, "Arabic (Qatar)")
3492 LNG(wxLANGUAGE_ARABIC_SAUDI_ARABIA
, "ar_SA", LANG_ARABIC
, SUBLANG_ARABIC_SAUDI_ARABIA
, wxLayout_RightToLeft
, "Arabic (Saudi Arabia)")
3493 LNG(wxLANGUAGE_ARABIC_SUDAN
, "ar_SD", 0 , 0 , wxLayout_RightToLeft
, "Arabic (Sudan)")
3494 LNG(wxLANGUAGE_ARABIC_SYRIA
, "ar_SY", LANG_ARABIC
, SUBLANG_ARABIC_SYRIA
, wxLayout_RightToLeft
, "Arabic (Syria)")
3495 LNG(wxLANGUAGE_ARABIC_TUNISIA
, "ar_TN", LANG_ARABIC
, SUBLANG_ARABIC_TUNISIA
, wxLayout_RightToLeft
, "Arabic (Tunisia)")
3496 LNG(wxLANGUAGE_ARABIC_UAE
, "ar_AE", LANG_ARABIC
, SUBLANG_ARABIC_UAE
, wxLayout_RightToLeft
, "Arabic (Uae)")
3497 LNG(wxLANGUAGE_ARABIC_YEMEN
, "ar_YE", LANG_ARABIC
, SUBLANG_ARABIC_YEMEN
, wxLayout_RightToLeft
, "Arabic (Yemen)")
3498 LNG(wxLANGUAGE_ARMENIAN
, "hy" , LANG_ARMENIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Armenian")
3499 LNG(wxLANGUAGE_ASSAMESE
, "as" , LANG_ASSAMESE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Assamese")
3500 LNG(wxLANGUAGE_AYMARA
, "ay" , 0 , 0 , wxLayout_LeftToRight
, "Aymara")
3501 LNG(wxLANGUAGE_AZERI
, "az" , LANG_AZERI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Azeri")
3502 LNG(wxLANGUAGE_AZERI_CYRILLIC
, "az" , LANG_AZERI
, SUBLANG_AZERI_CYRILLIC
, wxLayout_LeftToRight
, "Azeri (Cyrillic)")
3503 LNG(wxLANGUAGE_AZERI_LATIN
, "az" , LANG_AZERI
, SUBLANG_AZERI_LATIN
, wxLayout_LeftToRight
, "Azeri (Latin)")
3504 LNG(wxLANGUAGE_BASHKIR
, "ba" , 0 , 0 , wxLayout_LeftToRight
, "Bashkir")
3505 LNG(wxLANGUAGE_BASQUE
, "eu_ES", LANG_BASQUE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Basque")
3506 LNG(wxLANGUAGE_BELARUSIAN
, "be_BY", LANG_BELARUSIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Belarusian")
3507 LNG(wxLANGUAGE_BENGALI
, "bn" , LANG_BENGALI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Bengali")
3508 LNG(wxLANGUAGE_BHUTANI
, "dz" , 0 , 0 , wxLayout_LeftToRight
, "Bhutani")
3509 LNG(wxLANGUAGE_BIHARI
, "bh" , 0 , 0 , wxLayout_LeftToRight
, "Bihari")
3510 LNG(wxLANGUAGE_BISLAMA
, "bi" , 0 , 0 , wxLayout_LeftToRight
, "Bislama")
3511 LNG(wxLANGUAGE_BRETON
, "br" , 0 , 0 , wxLayout_LeftToRight
, "Breton")
3512 LNG(wxLANGUAGE_BULGARIAN
, "bg_BG", LANG_BULGARIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Bulgarian")
3513 LNG(wxLANGUAGE_BURMESE
, "my" , 0 , 0 , wxLayout_LeftToRight
, "Burmese")
3514 LNG(wxLANGUAGE_CAMBODIAN
, "km" , 0 , 0 , wxLayout_LeftToRight
, "Cambodian")
3515 LNG(wxLANGUAGE_CATALAN
, "ca_ES", LANG_CATALAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Catalan")
3516 LNG(wxLANGUAGE_CHINESE
, "zh_TW", LANG_CHINESE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Chinese")
3517 LNG(wxLANGUAGE_CHINESE_SIMPLIFIED
, "zh_CN", LANG_CHINESE
, SUBLANG_CHINESE_SIMPLIFIED
, wxLayout_LeftToRight
, "Chinese (Simplified)")
3518 LNG(wxLANGUAGE_CHINESE_TRADITIONAL
, "zh_TW", LANG_CHINESE
, SUBLANG_CHINESE_TRADITIONAL
, wxLayout_LeftToRight
, "Chinese (Traditional)")
3519 LNG(wxLANGUAGE_CHINESE_HONGKONG
, "zh_HK", LANG_CHINESE
, SUBLANG_CHINESE_HONGKONG
, wxLayout_LeftToRight
, "Chinese (Hongkong)")
3520 LNG(wxLANGUAGE_CHINESE_MACAU
, "zh_MO", LANG_CHINESE
, SUBLANG_CHINESE_MACAU
, wxLayout_LeftToRight
, "Chinese (Macau)")
3521 LNG(wxLANGUAGE_CHINESE_SINGAPORE
, "zh_SG", LANG_CHINESE
, SUBLANG_CHINESE_SINGAPORE
, wxLayout_LeftToRight
, "Chinese (Singapore)")
3522 LNG(wxLANGUAGE_CHINESE_TAIWAN
, "zh_TW", LANG_CHINESE
, SUBLANG_CHINESE_TRADITIONAL
, wxLayout_LeftToRight
, "Chinese (Taiwan)")
3523 LNG(wxLANGUAGE_CORSICAN
, "co" , 0 , 0 , wxLayout_LeftToRight
, "Corsican")
3524 LNG(wxLANGUAGE_CROATIAN
, "hr_HR", LANG_CROATIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Croatian")
3525 LNG(wxLANGUAGE_CZECH
, "cs_CZ", LANG_CZECH
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Czech")
3526 LNG(wxLANGUAGE_DANISH
, "da_DK", LANG_DANISH
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Danish")
3527 LNG(wxLANGUAGE_DUTCH
, "nl_NL", LANG_DUTCH
, SUBLANG_DUTCH
, wxLayout_LeftToRight
, "Dutch")
3528 LNG(wxLANGUAGE_DUTCH_BELGIAN
, "nl_BE", LANG_DUTCH
, SUBLANG_DUTCH_BELGIAN
, wxLayout_LeftToRight
, "Dutch (Belgian)")
3529 LNG(wxLANGUAGE_ENGLISH
, "en_GB", LANG_ENGLISH
, SUBLANG_ENGLISH_UK
, wxLayout_LeftToRight
, "English")
3530 LNG(wxLANGUAGE_ENGLISH_UK
, "en_GB", LANG_ENGLISH
, SUBLANG_ENGLISH_UK
, wxLayout_LeftToRight
, "English (U.K.)")
3531 LNG(wxLANGUAGE_ENGLISH_US
, "en_US", LANG_ENGLISH
, SUBLANG_ENGLISH_US
, wxLayout_LeftToRight
, "English (U.S.)")
3532 LNG(wxLANGUAGE_ENGLISH_AUSTRALIA
, "en_AU", LANG_ENGLISH
, SUBLANG_ENGLISH_AUS
, wxLayout_LeftToRight
, "English (Australia)")
3533 LNG(wxLANGUAGE_ENGLISH_BELIZE
, "en_BZ", LANG_ENGLISH
, SUBLANG_ENGLISH_BELIZE
, wxLayout_LeftToRight
, "English (Belize)")
3534 LNG(wxLANGUAGE_ENGLISH_BOTSWANA
, "en_BW", 0 , 0 , wxLayout_LeftToRight
, "English (Botswana)")
3535 LNG(wxLANGUAGE_ENGLISH_CANADA
, "en_CA", LANG_ENGLISH
, SUBLANG_ENGLISH_CAN
, wxLayout_LeftToRight
, "English (Canada)")
3536 LNG(wxLANGUAGE_ENGLISH_CARIBBEAN
, "en_CB", LANG_ENGLISH
, SUBLANG_ENGLISH_CARIBBEAN
, wxLayout_LeftToRight
, "English (Caribbean)")
3537 LNG(wxLANGUAGE_ENGLISH_DENMARK
, "en_DK", 0 , 0 , wxLayout_LeftToRight
, "English (Denmark)")
3538 LNG(wxLANGUAGE_ENGLISH_EIRE
, "en_IE", LANG_ENGLISH
, SUBLANG_ENGLISH_EIRE
, wxLayout_LeftToRight
, "English (Eire)")
3539 LNG(wxLANGUAGE_ENGLISH_JAMAICA
, "en_JM", LANG_ENGLISH
, SUBLANG_ENGLISH_JAMAICA
, wxLayout_LeftToRight
, "English (Jamaica)")
3540 LNG(wxLANGUAGE_ENGLISH_NEW_ZEALAND
, "en_NZ", LANG_ENGLISH
, SUBLANG_ENGLISH_NZ
, wxLayout_LeftToRight
, "English (New Zealand)")
3541 LNG(wxLANGUAGE_ENGLISH_PHILIPPINES
, "en_PH", LANG_ENGLISH
, SUBLANG_ENGLISH_PHILIPPINES
, wxLayout_LeftToRight
, "English (Philippines)")
3542 LNG(wxLANGUAGE_ENGLISH_SOUTH_AFRICA
, "en_ZA", LANG_ENGLISH
, SUBLANG_ENGLISH_SOUTH_AFRICA
, wxLayout_LeftToRight
, "English (South Africa)")
3543 LNG(wxLANGUAGE_ENGLISH_TRINIDAD
, "en_TT", LANG_ENGLISH
, SUBLANG_ENGLISH_TRINIDAD
, wxLayout_LeftToRight
, "English (Trinidad)")
3544 LNG(wxLANGUAGE_ENGLISH_ZIMBABWE
, "en_ZW", LANG_ENGLISH
, SUBLANG_ENGLISH_ZIMBABWE
, wxLayout_LeftToRight
, "English (Zimbabwe)")
3545 LNG(wxLANGUAGE_ESPERANTO
, "eo" , 0 , 0 , wxLayout_LeftToRight
, "Esperanto")
3546 LNG(wxLANGUAGE_ESTONIAN
, "et_EE", LANG_ESTONIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Estonian")
3547 LNG(wxLANGUAGE_FAEROESE
, "fo_FO", LANG_FAEROESE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Faeroese")
3548 LNG(wxLANGUAGE_FARSI
, "fa_IR", LANG_FARSI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Farsi")
3549 LNG(wxLANGUAGE_FIJI
, "fj" , 0 , 0 , wxLayout_LeftToRight
, "Fiji")
3550 LNG(wxLANGUAGE_FINNISH
, "fi_FI", LANG_FINNISH
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Finnish")
3551 LNG(wxLANGUAGE_FRENCH
, "fr_FR", LANG_FRENCH
, SUBLANG_FRENCH
, wxLayout_LeftToRight
, "French")
3552 LNG(wxLANGUAGE_FRENCH_BELGIAN
, "fr_BE", LANG_FRENCH
, SUBLANG_FRENCH_BELGIAN
, wxLayout_LeftToRight
, "French (Belgian)")
3553 LNG(wxLANGUAGE_FRENCH_CANADIAN
, "fr_CA", LANG_FRENCH
, SUBLANG_FRENCH_CANADIAN
, wxLayout_LeftToRight
, "French (Canadian)")
3554 LNG(wxLANGUAGE_FRENCH_LUXEMBOURG
, "fr_LU", LANG_FRENCH
, SUBLANG_FRENCH_LUXEMBOURG
, wxLayout_LeftToRight
, "French (Luxembourg)")
3555 LNG(wxLANGUAGE_FRENCH_MONACO
, "fr_MC", LANG_FRENCH
, SUBLANG_FRENCH_MONACO
, wxLayout_LeftToRight
, "French (Monaco)")
3556 LNG(wxLANGUAGE_FRENCH_SWISS
, "fr_CH", LANG_FRENCH
, SUBLANG_FRENCH_SWISS
, wxLayout_LeftToRight
, "French (Swiss)")
3557 LNG(wxLANGUAGE_FRISIAN
, "fy" , 0 , 0 , wxLayout_LeftToRight
, "Frisian")
3558 LNG(wxLANGUAGE_GALICIAN
, "gl_ES", 0 , 0 , wxLayout_LeftToRight
, "Galician")
3559 LNG(wxLANGUAGE_GEORGIAN
, "ka" , LANG_GEORGIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Georgian")
3560 LNG(wxLANGUAGE_GERMAN
, "de_DE", LANG_GERMAN
, SUBLANG_GERMAN
, wxLayout_LeftToRight
, "German")
3561 LNG(wxLANGUAGE_GERMAN_AUSTRIAN
, "de_AT", LANG_GERMAN
, SUBLANG_GERMAN_AUSTRIAN
, wxLayout_LeftToRight
, "German (Austrian)")
3562 LNG(wxLANGUAGE_GERMAN_BELGIUM
, "de_BE", 0 , 0 , wxLayout_LeftToRight
, "German (Belgium)")
3563 LNG(wxLANGUAGE_GERMAN_LIECHTENSTEIN
, "de_LI", LANG_GERMAN
, SUBLANG_GERMAN_LIECHTENSTEIN
, wxLayout_LeftToRight
, "German (Liechtenstein)")
3564 LNG(wxLANGUAGE_GERMAN_LUXEMBOURG
, "de_LU", LANG_GERMAN
, SUBLANG_GERMAN_LUXEMBOURG
, wxLayout_LeftToRight
, "German (Luxembourg)")
3565 LNG(wxLANGUAGE_GERMAN_SWISS
, "de_CH", LANG_GERMAN
, SUBLANG_GERMAN_SWISS
, wxLayout_LeftToRight
, "German (Swiss)")
3566 LNG(wxLANGUAGE_GREEK
, "el_GR", LANG_GREEK
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Greek")
3567 LNG(wxLANGUAGE_GREENLANDIC
, "kl_GL", 0 , 0 , wxLayout_LeftToRight
, "Greenlandic")
3568 LNG(wxLANGUAGE_GUARANI
, "gn" , 0 , 0 , wxLayout_LeftToRight
, "Guarani")
3569 LNG(wxLANGUAGE_GUJARATI
, "gu" , LANG_GUJARATI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Gujarati")
3570 LNG(wxLANGUAGE_HAUSA
, "ha" , 0 , 0 , wxLayout_LeftToRight
, "Hausa")
3571 LNG(wxLANGUAGE_HEBREW
, "he_IL", LANG_HEBREW
, SUBLANG_DEFAULT
, wxLayout_RightToLeft
, "Hebrew")
3572 LNG(wxLANGUAGE_HINDI
, "hi_IN", LANG_HINDI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Hindi")
3573 LNG(wxLANGUAGE_HUNGARIAN
, "hu_HU", LANG_HUNGARIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Hungarian")
3574 LNG(wxLANGUAGE_ICELANDIC
, "is_IS", LANG_ICELANDIC
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Icelandic")
3575 LNG(wxLANGUAGE_INDONESIAN
, "id_ID", LANG_INDONESIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Indonesian")
3576 LNG(wxLANGUAGE_INTERLINGUA
, "ia" , 0 , 0 , wxLayout_LeftToRight
, "Interlingua")
3577 LNG(wxLANGUAGE_INTERLINGUE
, "ie" , 0 , 0 , wxLayout_LeftToRight
, "Interlingue")
3578 LNG(wxLANGUAGE_INUKTITUT
, "iu" , 0 , 0 , wxLayout_LeftToRight
, "Inuktitut")
3579 LNG(wxLANGUAGE_INUPIAK
, "ik" , 0 , 0 , wxLayout_LeftToRight
, "Inupiak")
3580 LNG(wxLANGUAGE_IRISH
, "ga_IE", 0 , 0 , wxLayout_LeftToRight
, "Irish")
3581 LNG(wxLANGUAGE_ITALIAN
, "it_IT", LANG_ITALIAN
, SUBLANG_ITALIAN
, wxLayout_LeftToRight
, "Italian")
3582 LNG(wxLANGUAGE_ITALIAN_SWISS
, "it_CH", LANG_ITALIAN
, SUBLANG_ITALIAN_SWISS
, wxLayout_LeftToRight
, "Italian (Swiss)")
3583 LNG(wxLANGUAGE_JAPANESE
, "ja_JP", LANG_JAPANESE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Japanese")
3584 LNG(wxLANGUAGE_JAVANESE
, "jw" , 0 , 0 , wxLayout_LeftToRight
, "Javanese")
3585 LNG(wxLANGUAGE_KANNADA
, "kn" , LANG_KANNADA
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Kannada")
3586 LNG(wxLANGUAGE_KASHMIRI
, "ks" , LANG_KASHMIRI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Kashmiri")
3587 LNG(wxLANGUAGE_KASHMIRI_INDIA
, "ks_IN", LANG_KASHMIRI
, SUBLANG_KASHMIRI_INDIA
, wxLayout_LeftToRight
, "Kashmiri (India)")
3588 LNG(wxLANGUAGE_KAZAKH
, "kk" , LANG_KAZAK
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Kazakh")
3589 LNG(wxLANGUAGE_KERNEWEK
, "kw_GB", 0 , 0 , wxLayout_LeftToRight
, "Kernewek")
3590 LNG(wxLANGUAGE_KINYARWANDA
, "rw" , 0 , 0 , wxLayout_LeftToRight
, "Kinyarwanda")
3591 LNG(wxLANGUAGE_KIRGHIZ
, "ky" , 0 , 0 , wxLayout_LeftToRight
, "Kirghiz")
3592 LNG(wxLANGUAGE_KIRUNDI
, "rn" , 0 , 0 , wxLayout_LeftToRight
, "Kirundi")
3593 LNG(wxLANGUAGE_KONKANI
, "" , LANG_KONKANI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Konkani")
3594 LNG(wxLANGUAGE_KOREAN
, "ko_KR", LANG_KOREAN
, SUBLANG_KOREAN
, wxLayout_LeftToRight
, "Korean")
3595 LNG(wxLANGUAGE_KURDISH
, "ku" , 0 , 0 , wxLayout_LeftToRight
, "Kurdish")
3596 LNG(wxLANGUAGE_LAOTHIAN
, "lo" , 0 , 0 , wxLayout_LeftToRight
, "Laothian")
3597 LNG(wxLANGUAGE_LATIN
, "la" , 0 , 0 , wxLayout_LeftToRight
, "Latin")
3598 LNG(wxLANGUAGE_LATVIAN
, "lv_LV", LANG_LATVIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Latvian")
3599 LNG(wxLANGUAGE_LINGALA
, "ln" , 0 , 0 , wxLayout_LeftToRight
, "Lingala")
3600 LNG(wxLANGUAGE_LITHUANIAN
, "lt_LT", LANG_LITHUANIAN
, SUBLANG_LITHUANIAN
, wxLayout_LeftToRight
, "Lithuanian")
3601 LNG(wxLANGUAGE_MACEDONIAN
, "mk_MK", LANG_MACEDONIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Macedonian")
3602 LNG(wxLANGUAGE_MALAGASY
, "mg" , 0 , 0 , wxLayout_LeftToRight
, "Malagasy")
3603 LNG(wxLANGUAGE_MALAY
, "ms_MY", LANG_MALAY
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Malay")
3604 LNG(wxLANGUAGE_MALAYALAM
, "ml" , LANG_MALAYALAM
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Malayalam")
3605 LNG(wxLANGUAGE_MALAY_BRUNEI_DARUSSALAM
, "ms_BN", LANG_MALAY
, SUBLANG_MALAY_BRUNEI_DARUSSALAM
, wxLayout_LeftToRight
, "Malay (Brunei Darussalam)")
3606 LNG(wxLANGUAGE_MALAY_MALAYSIA
, "ms_MY", LANG_MALAY
, SUBLANG_MALAY_MALAYSIA
, wxLayout_LeftToRight
, "Malay (Malaysia)")
3607 LNG(wxLANGUAGE_MALTESE
, "mt_MT", 0 , 0 , wxLayout_LeftToRight
, "Maltese")
3608 LNG(wxLANGUAGE_MANIPURI
, "" , LANG_MANIPURI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Manipuri")
3609 LNG(wxLANGUAGE_MAORI
, "mi" , 0 , 0 , wxLayout_LeftToRight
, "Maori")
3610 LNG(wxLANGUAGE_MARATHI
, "mr_IN", LANG_MARATHI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Marathi")
3611 LNG(wxLANGUAGE_MOLDAVIAN
, "mo" , 0 , 0 , wxLayout_LeftToRight
, "Moldavian")
3612 LNG(wxLANGUAGE_MONGOLIAN
, "mn" , 0 , 0 , wxLayout_LeftToRight
, "Mongolian")
3613 LNG(wxLANGUAGE_NAURU
, "na" , 0 , 0 , wxLayout_LeftToRight
, "Nauru")
3614 LNG(wxLANGUAGE_NEPALI
, "ne" , LANG_NEPALI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Nepali")
3615 LNG(wxLANGUAGE_NEPALI_INDIA
, "ne_IN", LANG_NEPALI
, SUBLANG_NEPALI_INDIA
, wxLayout_LeftToRight
, "Nepali (India)")
3616 LNG(wxLANGUAGE_NORWEGIAN_BOKMAL
, "nb_NO", LANG_NORWEGIAN
, SUBLANG_NORWEGIAN_BOKMAL
, wxLayout_LeftToRight
, "Norwegian (Bokmal)")
3617 LNG(wxLANGUAGE_NORWEGIAN_NYNORSK
, "nn_NO", LANG_NORWEGIAN
, SUBLANG_NORWEGIAN_NYNORSK
, wxLayout_LeftToRight
, "Norwegian (Nynorsk)")
3618 LNG(wxLANGUAGE_OCCITAN
, "oc" , 0 , 0 , wxLayout_LeftToRight
, "Occitan")
3619 LNG(wxLANGUAGE_ORIYA
, "or" , LANG_ORIYA
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Oriya")
3620 LNG(wxLANGUAGE_OROMO
, "om" , 0 , 0 , wxLayout_LeftToRight
, "(Afan) Oromo")
3621 LNG(wxLANGUAGE_PASHTO
, "ps" , 0 , 0 , wxLayout_LeftToRight
, "Pashto, Pushto")
3622 LNG(wxLANGUAGE_POLISH
, "pl_PL", LANG_POLISH
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Polish")
3623 LNG(wxLANGUAGE_PORTUGUESE
, "pt_PT", LANG_PORTUGUESE
, SUBLANG_PORTUGUESE
, wxLayout_LeftToRight
, "Portuguese")
3624 LNG(wxLANGUAGE_PORTUGUESE_BRAZILIAN
, "pt_BR", LANG_PORTUGUESE
, SUBLANG_PORTUGUESE_BRAZILIAN
, wxLayout_LeftToRight
, "Portuguese (Brazilian)")
3625 LNG(wxLANGUAGE_PUNJABI
, "pa" , LANG_PUNJABI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Punjabi")
3626 LNG(wxLANGUAGE_QUECHUA
, "qu" , 0 , 0 , wxLayout_LeftToRight
, "Quechua")
3627 LNG(wxLANGUAGE_RHAETO_ROMANCE
, "rm" , 0 , 0 , wxLayout_LeftToRight
, "Rhaeto-Romance")
3628 LNG(wxLANGUAGE_ROMANIAN
, "ro_RO", LANG_ROMANIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Romanian")
3629 LNG(wxLANGUAGE_RUSSIAN
, "ru_RU", LANG_RUSSIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Russian")
3630 LNG(wxLANGUAGE_RUSSIAN_UKRAINE
, "ru_UA", 0 , 0 , wxLayout_LeftToRight
, "Russian (Ukraine)")
3631 LNG(wxLANGUAGE_SAMOAN
, "sm" , 0 , 0 , wxLayout_LeftToRight
, "Samoan")
3632 LNG(wxLANGUAGE_SANGHO
, "sg" , 0 , 0 , wxLayout_LeftToRight
, "Sangho")
3633 LNG(wxLANGUAGE_SANSKRIT
, "sa" , LANG_SANSKRIT
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Sanskrit")
3634 LNG(wxLANGUAGE_SCOTS_GAELIC
, "gd" , 0 , 0 , wxLayout_LeftToRight
, "Scots Gaelic")
3635 LNG(wxLANGUAGE_SERBIAN_CYRILLIC
, "sr_YU", LANG_SERBIAN
, SUBLANG_SERBIAN_CYRILLIC
, wxLayout_LeftToRight
, "Serbian (Cyrillic)")
3636 LNG(wxLANGUAGE_SERBIAN_LATIN
, "sr_YU", LANG_SERBIAN
, SUBLANG_SERBIAN_LATIN
, wxLayout_LeftToRight
, "Serbian (Latin)")
3637 LNG(wxLANGUAGE_SERBO_CROATIAN
, "sh" , 0 , 0 , wxLayout_LeftToRight
, "Serbo-Croatian")
3638 LNG(wxLANGUAGE_SESOTHO
, "st" , 0 , 0 , wxLayout_LeftToRight
, "Sesotho")
3639 LNG(wxLANGUAGE_SETSWANA
, "tn" , 0 , 0 , wxLayout_LeftToRight
, "Setswana")
3640 LNG(wxLANGUAGE_SHONA
, "sn" , 0 , 0 , wxLayout_LeftToRight
, "Shona")
3641 LNG(wxLANGUAGE_SINDHI
, "sd" , LANG_SINDHI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Sindhi")
3642 LNG(wxLANGUAGE_SINHALESE
, "si" , 0 , 0 , wxLayout_LeftToRight
, "Sinhalese")
3643 LNG(wxLANGUAGE_SISWATI
, "ss" , 0 , 0 , wxLayout_LeftToRight
, "Siswati")
3644 LNG(wxLANGUAGE_SLOVAK
, "sk_SK", LANG_SLOVAK
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Slovak")
3645 LNG(wxLANGUAGE_SLOVENIAN
, "sl_SI", LANG_SLOVENIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Slovenian")
3646 LNG(wxLANGUAGE_SOMALI
, "so" , 0 , 0 , wxLayout_LeftToRight
, "Somali")
3647 LNG(wxLANGUAGE_SPANISH
, "es_ES", LANG_SPANISH
, SUBLANG_SPANISH
, wxLayout_LeftToRight
, "Spanish")
3648 LNG(wxLANGUAGE_SPANISH_ARGENTINA
, "es_AR", LANG_SPANISH
, SUBLANG_SPANISH_ARGENTINA
, wxLayout_LeftToRight
, "Spanish (Argentina)")
3649 LNG(wxLANGUAGE_SPANISH_BOLIVIA
, "es_BO", LANG_SPANISH
, SUBLANG_SPANISH_BOLIVIA
, wxLayout_LeftToRight
, "Spanish (Bolivia)")
3650 LNG(wxLANGUAGE_SPANISH_CHILE
, "es_CL", LANG_SPANISH
, SUBLANG_SPANISH_CHILE
, wxLayout_LeftToRight
, "Spanish (Chile)")
3651 LNG(wxLANGUAGE_SPANISH_COLOMBIA
, "es_CO", LANG_SPANISH
, SUBLANG_SPANISH_COLOMBIA
, wxLayout_LeftToRight
, "Spanish (Colombia)")
3652 LNG(wxLANGUAGE_SPANISH_COSTA_RICA
, "es_CR", LANG_SPANISH
, SUBLANG_SPANISH_COSTA_RICA
, wxLayout_LeftToRight
, "Spanish (Costa Rica)")
3653 LNG(wxLANGUAGE_SPANISH_DOMINICAN_REPUBLIC
, "es_DO", LANG_SPANISH
, SUBLANG_SPANISH_DOMINICAN_REPUBLIC
, wxLayout_LeftToRight
, "Spanish (Dominican republic)")
3654 LNG(wxLANGUAGE_SPANISH_ECUADOR
, "es_EC", LANG_SPANISH
, SUBLANG_SPANISH_ECUADOR
, wxLayout_LeftToRight
, "Spanish (Ecuador)")
3655 LNG(wxLANGUAGE_SPANISH_EL_SALVADOR
, "es_SV", LANG_SPANISH
, SUBLANG_SPANISH_EL_SALVADOR
, wxLayout_LeftToRight
, "Spanish (El Salvador)")
3656 LNG(wxLANGUAGE_SPANISH_GUATEMALA
, "es_GT", LANG_SPANISH
, SUBLANG_SPANISH_GUATEMALA
, wxLayout_LeftToRight
, "Spanish (Guatemala)")
3657 LNG(wxLANGUAGE_SPANISH_HONDURAS
, "es_HN", LANG_SPANISH
, SUBLANG_SPANISH_HONDURAS
, wxLayout_LeftToRight
, "Spanish (Honduras)")
3658 LNG(wxLANGUAGE_SPANISH_MEXICAN
, "es_MX", LANG_SPANISH
, SUBLANG_SPANISH_MEXICAN
, wxLayout_LeftToRight
, "Spanish (Mexican)")
3659 LNG(wxLANGUAGE_SPANISH_MODERN
, "es_ES", LANG_SPANISH
, SUBLANG_SPANISH_MODERN
, wxLayout_LeftToRight
, "Spanish (Modern)")
3660 LNG(wxLANGUAGE_SPANISH_NICARAGUA
, "es_NI", LANG_SPANISH
, SUBLANG_SPANISH_NICARAGUA
, wxLayout_LeftToRight
, "Spanish (Nicaragua)")
3661 LNG(wxLANGUAGE_SPANISH_PANAMA
, "es_PA", LANG_SPANISH
, SUBLANG_SPANISH_PANAMA
, wxLayout_LeftToRight
, "Spanish (Panama)")
3662 LNG(wxLANGUAGE_SPANISH_PARAGUAY
, "es_PY", LANG_SPANISH
, SUBLANG_SPANISH_PARAGUAY
, wxLayout_LeftToRight
, "Spanish (Paraguay)")
3663 LNG(wxLANGUAGE_SPANISH_PERU
, "es_PE", LANG_SPANISH
, SUBLANG_SPANISH_PERU
, wxLayout_LeftToRight
, "Spanish (Peru)")
3664 LNG(wxLANGUAGE_SPANISH_PUERTO_RICO
, "es_PR", LANG_SPANISH
, SUBLANG_SPANISH_PUERTO_RICO
, wxLayout_LeftToRight
, "Spanish (Puerto Rico)")
3665 LNG(wxLANGUAGE_SPANISH_URUGUAY
, "es_UY", LANG_SPANISH
, SUBLANG_SPANISH_URUGUAY
, wxLayout_LeftToRight
, "Spanish (Uruguay)")
3666 LNG(wxLANGUAGE_SPANISH_US
, "es_US", 0 , 0 , wxLayout_LeftToRight
, "Spanish (U.S.)")
3667 LNG(wxLANGUAGE_SPANISH_VENEZUELA
, "es_VE", LANG_SPANISH
, SUBLANG_SPANISH_VENEZUELA
, wxLayout_LeftToRight
, "Spanish (Venezuela)")
3668 LNG(wxLANGUAGE_SUNDANESE
, "su" , 0 , 0 , wxLayout_LeftToRight
, "Sundanese")
3669 LNG(wxLANGUAGE_SWAHILI
, "sw_KE", LANG_SWAHILI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Swahili")
3670 LNG(wxLANGUAGE_SWEDISH
, "sv_SE", LANG_SWEDISH
, SUBLANG_SWEDISH
, wxLayout_LeftToRight
, "Swedish")
3671 LNG(wxLANGUAGE_SWEDISH_FINLAND
, "sv_FI", LANG_SWEDISH
, SUBLANG_SWEDISH_FINLAND
, wxLayout_LeftToRight
, "Swedish (Finland)")
3672 LNG(wxLANGUAGE_TAGALOG
, "tl_PH", 0 , 0 , wxLayout_LeftToRight
, "Tagalog")
3673 LNG(wxLANGUAGE_TAJIK
, "tg" , 0 , 0 , wxLayout_LeftToRight
, "Tajik")
3674 LNG(wxLANGUAGE_TAMIL
, "ta" , LANG_TAMIL
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Tamil")
3675 LNG(wxLANGUAGE_TATAR
, "tt" , LANG_TATAR
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Tatar")
3676 LNG(wxLANGUAGE_TELUGU
, "te" , LANG_TELUGU
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Telugu")
3677 LNG(wxLANGUAGE_THAI
, "th_TH", LANG_THAI
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Thai")
3678 LNG(wxLANGUAGE_TIBETAN
, "bo" , 0 , 0 , wxLayout_LeftToRight
, "Tibetan")
3679 LNG(wxLANGUAGE_TIGRINYA
, "ti" , 0 , 0 , wxLayout_LeftToRight
, "Tigrinya")
3680 LNG(wxLANGUAGE_TONGA
, "to" , 0 , 0 , wxLayout_LeftToRight
, "Tonga")
3681 LNG(wxLANGUAGE_TSONGA
, "ts" , 0 , 0 , wxLayout_LeftToRight
, "Tsonga")
3682 LNG(wxLANGUAGE_TURKISH
, "tr_TR", LANG_TURKISH
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Turkish")
3683 LNG(wxLANGUAGE_TURKMEN
, "tk" , 0 , 0 , wxLayout_LeftToRight
, "Turkmen")
3684 LNG(wxLANGUAGE_TWI
, "tw" , 0 , 0 , wxLayout_LeftToRight
, "Twi")
3685 LNG(wxLANGUAGE_UIGHUR
, "ug" , 0 , 0 , wxLayout_LeftToRight
, "Uighur")
3686 LNG(wxLANGUAGE_UKRAINIAN
, "uk_UA", LANG_UKRAINIAN
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Ukrainian")
3687 LNG(wxLANGUAGE_URDU
, "ur" , LANG_URDU
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Urdu")
3688 LNG(wxLANGUAGE_URDU_INDIA
, "ur_IN", LANG_URDU
, SUBLANG_URDU_INDIA
, wxLayout_LeftToRight
, "Urdu (India)")
3689 LNG(wxLANGUAGE_URDU_PAKISTAN
, "ur_PK", LANG_URDU
, SUBLANG_URDU_PAKISTAN
, wxLayout_LeftToRight
, "Urdu (Pakistan)")
3690 LNG(wxLANGUAGE_UZBEK
, "uz" , LANG_UZBEK
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Uzbek")
3691 LNG(wxLANGUAGE_UZBEK_CYRILLIC
, "uz" , LANG_UZBEK
, SUBLANG_UZBEK_CYRILLIC
, wxLayout_LeftToRight
, "Uzbek (Cyrillic)")
3692 LNG(wxLANGUAGE_UZBEK_LATIN
, "uz" , LANG_UZBEK
, SUBLANG_UZBEK_LATIN
, wxLayout_LeftToRight
, "Uzbek (Latin)")
3693 LNG(wxLANGUAGE_VIETNAMESE
, "vi_VN", LANG_VIETNAMESE
, SUBLANG_DEFAULT
, wxLayout_LeftToRight
, "Vietnamese")
3694 LNG(wxLANGUAGE_VOLAPUK
, "vo" , 0 , 0 , wxLayout_LeftToRight
, "Volapuk")
3695 LNG(wxLANGUAGE_WELSH
, "cy" , 0 , 0 , wxLayout_LeftToRight
, "Welsh")
3696 LNG(wxLANGUAGE_WOLOF
, "wo" , 0 , 0 , wxLayout_LeftToRight
, "Wolof")
3697 LNG(wxLANGUAGE_XHOSA
, "xh" , 0 , 0 , wxLayout_LeftToRight
, "Xhosa")
3698 LNG(wxLANGUAGE_YIDDISH
, "yi" , 0 , 0 , wxLayout_LeftToRight
, "Yiddish")
3699 LNG(wxLANGUAGE_YORUBA
, "yo" , 0 , 0 , wxLayout_LeftToRight
, "Yoruba")
3700 LNG(wxLANGUAGE_ZHUANG
, "za" , 0 , 0 , wxLayout_LeftToRight
, "Zhuang")
3701 LNG(wxLANGUAGE_ZULU
, "zu" , 0 , 0 , wxLayout_LeftToRight
, "Zulu")
3705 // --- --- --- generated code ends here --- --- ---
3707 #endif // wxUSE_INTL