- // take care of LC_MESSAGES
- if (envLongIncluded == false)
- environment.push_back(envLong);
- environment.push_back(envShort);
- // take care of LANGUAGE
- string envLang = Locale == 0 ? getenv("LANGUAGE") : *(Locale+1);
- if (envLang.empty() == false) {
- std::vector<string> env = ExplodeString(envLang,':');
- short addedLangs = 0; // add a maximum of 3 fallbacks from the environment
- for (std::vector<string>::const_iterator e = env.begin();
- e != env.end() && addedLangs < 3; ++e) {
- if (unlikely(e->empty() == true) || *e == "en")
- continue;
- if (*e == envLong || *e == envShort)
- continue;
- if (std::find(environment.begin(), environment.end(), *e) != environment.end())
- continue;
- if (e->find('_') != string::npos) {
- // Drop LongCodes here - ShortCodes are also included
- string const shorty = e->substr(0, e->find('_'));
- char const **n = needLong;
- for (; *n != NULL; ++n)
- if (shorty == *n)
- break;
- if (*n == NULL)
+ if (envShort != "C") {
+ // take care of LC_MESSAGES
+ if (envLongIncluded == false)
+ environment.push_back(envLong);
+ environment.push_back(envShort);
+ // take care of LANGUAGE
+ const char *language_env = getenv("LANGUAGE") == 0 ? "" : getenv("LANGUAGE");
+ string envLang = Locale == 0 ? language_env : *(Locale+1);
+ if (envLang.empty() == false) {
+ std::vector<string> env = VectorizeString(envLang,':');
+ short addedLangs = 0; // add a maximum of 3 fallbacks from the environment
+ for (std::vector<string>::const_iterator e = env.begin();
+ e != env.end() && addedLangs < 3; ++e) {
+ if (unlikely(e->empty() == true) || *e == "en")
+ continue;
+ if (*e == envLong || *e == envShort)
+ continue;
+ if (std::find(environment.begin(), environment.end(), *e) != environment.end())