I don't have problems with language detection. You can see the code in my GIPE framework.
LanguageManager::LanguageManager():
Manager("Language Manager", false),
IUpdatable(true)
{
#if defined(ANDROID)
std::string loc = sf::GetLanguage();
const char* curLoc = loc.c_str();
#else
const char* curLoc = setlocale(LC_CTYPE, "");
Log::Message("LanguageManager: current locale is %s", curLoc);
#endif
if (curLoc)
{
mLangId = std::string(curLoc, 2);
}
else
{
Log::Warning("LanguageManager: using default locale %s", mLangId.c_str());
}
Where sf::GetLanguage is my modification for SFML.
std::string GetLanguage()
{
priv::ActivityStates* states = priv::getActivity(NULL);
Lock(states->mutex);
char lng[3] = { 0 };
AConfiguration_getLanguage(states->config, lng);
return std::string(lng);
}
Language can be selected from the game directly.