+ // default C locale
+ return wxLANGUAGE_ENGLISH;
+ }
+
+ // the language string has the following form
+ //
+ // lang[_LANG[.encoding]]
+ //
+ // where lang is the primary language, LANG is a sublang
+ //
+ // for example, the following strings are valid:
+ // fr
+ // fr_FR
+ // de_DE.iso88591
+
+ // for now we don't use the encoding, although we probably should (doing
+ // translations of the msg catalogs on the fly as required) (TODO)
+ langFull = langFull.BeforeFirst(_T('.'));
+
+ // in addition to the format above, we also can have full language names
+ // in LANG env var - for example, SuSE is known to use LANG="german" - so
+ // check for this
+
+ // do we have just the language (or sublang too)?
+ bool justLang = langFull.Len() == LEN_LANG;
+ if ( justLang ||
+ (langFull.Len() == LEN_FULL && langFull[LEN_LANG] == wxT('_')) )
+ {
+ // 0. Make sure the lang is according to latest ISO 639
+ // (this is neccessary because glibc uses iw and in instead
+ // of he and id respectively).
+
+ // the language itself (second part is the dialect/sublang)
+ wxString langOrig = ExtractLang(langFull);
+
+ wxString lang;
+ if ( langOrig == wxT("iw"))
+ lang = _T("he");
+ else if ( langOrig == wxT("in") )
+ lang = wxT("id");
+ else if ( langOrig == wxT("ji") )
+ lang = wxT("yi");
+ else
+ lang = langOrig;
+
+ // did we change it?
+ if ( lang != langOrig )
+ {
+ langFull = lang + ExtractNotLang(langFull);
+ }
+
+ // 1. Try to find the language either as is:
+ for ( i = 0; i < count; i++ )