parse -lang switch at startup, remove MSG_Init search for -lang switch

This commit is contained in:
Jonathan Campbell
2015-08-19 07:09:52 -07:00
parent 42efcf2b90
commit 8f21761d32
3 changed files with 11 additions and 7 deletions

View File

@@ -136,13 +136,13 @@ bool MSG_Write(const char * location) {
}
void MSG_Init() {
Section_prop * section=static_cast<Section_prop *>(control->GetSection("dosbox"));
Section_prop *section=static_cast<Section_prop *>(control->GetSection("dosbox"));
std::string file_name;
if (control->cmdline->FindString("-lang",file_name,true)) {
LoadMessageFile(file_name.c_str());
} else {
if (control->opt_lang != "") {
LoadMessageFile(control->opt_lang.c_str());
}
else {
Prop_path* pathprop = section->Get_path("language");
if(pathprop) LoadMessageFile(pathprop->realpath.c_str());
if (pathprop != NULL) LoadMessageFile(pathprop->realpath.c_str());
}
}