QString MusicUtils::UCore::getLanguageName(int index) { QString lan(LANGUAGE_DIR_FULL); switch(index) { case 0 : return lan.append("cn.ln"); case 1 : return lan.append("cn_c.ln"); case 2 : return lan.append("en.ln"); default: return QString(); } }
QString MusicUtils::getLanguageName(int index) { QString lan(MusicObject::getAppDir() + TR_LANGUAGE); switch(index) { case 0 : return lan.append("cn.ln"); case 1 : return lan.append("cn_c.ln"); case 2 : return lan.append("en.ln"); default: return QString(); } }
bool LangChanged(CVar* var, const char* val) { gcString lan("{0}{1}.xml", LANGFOLDER(), val); if (GetLanguageManager().loadFromFile(lan.c_str())) { Msg(gcString("Loaded Language file: {0}\n", val)); return true; } Warning(gcString("Failed to Load Language file: {0}\n", val)); return false; }
bool LangChanged(CVar* var, const char* val) { gcString lan("{0}{1}.xml", LANGFOLDER, val); gcString extra("{0}{1}_utility.xml", LANGFOLDER, val); if (GetLanguageManager().loadFromFile(lan.c_str())) { GetLanguageManager().loadFromFile(extra.c_str()); Msg(gcString("Loaded Language file: {0}\n", val)); return true; } else { Warning(gcString("Failed to Load Language file: {0}\n", val)); return false; } return true; }
int main(){ printf("%d\n", lan(1,2)); return 0; }