- bool justLang = langFull.length() == LEN_LANG;
- if ( justLang ||
- (langFull.length() == LEN_FULL && langFull[LEN_LANG] == wxS('_')) )
- {
- // 0. Make sure the lang is according to latest ISO 639
- // (this is necessary 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 == wxS("iw"))
- lang = wxS("he");
- else if (langOrig == wxS("in"))
- lang = wxS("id");
- else if (langOrig == wxS("ji"))
- lang = wxS("yi");
- else if (langOrig == wxS("no_NO"))
- lang = wxS("nb_NO");
- else if (langOrig == wxS("no_NY"))
- lang = wxS("nn_NO");
- else if (langOrig == wxS("no"))
- lang = wxS("nb_NO");
- else
- lang = langOrig;
+ const bool justLang = langFull.find('_') == wxString::npos;
+
+ // 0. Make sure the lang is according to latest ISO 639
+ // (this is necessary 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 == wxS("iw"))
+ lang = wxS("he");
+ else if (langOrig == wxS("in"))
+ lang = wxS("id");
+ else if (langOrig == wxS("ji"))
+ lang = wxS("yi");
+ else if (langOrig == wxS("no_NO"))
+ lang = wxS("nb_NO");
+ else if (langOrig == wxS("no_NY"))
+ lang = wxS("nn_NO");
+ else if (langOrig == wxS("no"))
+ lang = wxS("nb_NO");
+ else
+ lang = langOrig;