From e0428fb19044419446f2f930d60843fb08b9d325 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Tue, 23 Oct 2012 14:49:08 +0000 Subject: [PATCH] - bugfix for transifex download, filename parse out bad characters for language filename --- source/glest_game/menu/menu_state_options.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source/glest_game/menu/menu_state_options.cpp b/source/glest_game/menu/menu_state_options.cpp index 09dfe9ab..45056963 100644 --- a/source/glest_game/menu/menu_state_options.cpp +++ b/source/glest_game/menu/menu_state_options.cpp @@ -1212,6 +1212,16 @@ void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton){ size_t posDetailsEnd = fileDataDetails.find( "\"", posDetails + 9 ); langName = fileDataDetails.substr(posDetails + 9, posDetailsEnd - (posDetails + 9)); + replaceAll(langName,",",""); + replaceAll(langName,"\\",""); + replaceAll(langName,"/",""); + replaceAll(langName,"?",""); + replaceAll(langName,":",""); + replaceAll(langName,"@",""); + replaceAll(langName,"!",""); + replaceAll(langName,"*",""); + langName = trim(langName); + replaceAll(langName," ","-"); } printf("PARSED Language filename [%s]\n",langName.c_str()); @@ -1295,7 +1305,7 @@ void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton){ if(gotDownloads == true) { mainMessageBoxState=0; Lang &lang= Lang::getInstance(); - showMessageBox(lang.get("TransifexDownloadSuccess"), lang.get("Notice"), false); + showMessageBox(lang.get("TransifexDownloadSuccess") + "\n" + langName, lang.get("Notice"), false); } } return;