So, the gentleman that released multilanguage awhile back posted about an issue with it. Apparently, his version would give you question marks if you changed the language (this is due to the folderpath not being found I assume, or not being applied correctly). I'm going to be releasing my version that does work correctly.
Step 1:
Get the locale.xml data from Jorklenis' link.
Step 2:Code:http://forum.ragezone.com/f245/system-multi-language-1024977/ Also, follow teh steps in his guide to re-enable the widget (don't use his cpp's/headers)
After you've completed that, open ZConfiguration.cpp & ZConfiguration.h
Code:Replace the top lines of zconfiguration.cpp with this: #include "stdafx.h" //By Jorklenis2 and MAET #include "ZConfiguration.h" #include "Mint.h" #include "ZInterface.h" //#include "ZGameInterface.h" #include "ZLocatorList.h" #include "ZGameTypeList.h" #include "ZLocale.h" ZConfiguration g_Configuration; ZConfiguration* ZGetConfiguration() { return &g_Configuration; } #ifdef LOCALE_BRAZIL LANGID LangID = LANG_PORTUGUESE; /* Brazil */ #elif LOCALE_JAPAN LangID = LANG_JAPANESE; /* Japanese */ #elif LOCALE_US LangID = LANG_ENGLISH; /* International */ #elif LOCALE_KOREAN LangID = LANG_KOREAN; /* Korean */ #elif LOCALE_INDIA LangID = LANG_ENGLISH; /* India */ #endif unsigned int ZLanguageSetting_forNHNUSA::m_idLang = 0; void ZLanguageSetting_forNHNUSA::SetLanguageIndexFromCmdLineStr(const char* cmdline) { // -¾ð¾îº° id´Â ÇϵåÄÚµù;- // xml\usa\locale.xml ¿¡ ÀÖ´Â ¼±Åð¡´ÉÇÑ ¾ð¾î ¸ñ·Ï¿£ ´ÙÀ½°ú °°Àº À妽º°¡ ÁöÁ¤µÇ¾î ÀÖ´Ù const unsigned int id_USA = 0; const unsigned int id_POR = 1; const unsigned int id_SPA = 2; m_idLang = id_USA; if (NULL == cmdline) return; if (NULL!= strstr(cmdline, "&u100e:2=en")) m_idLang = id_USA; else if (NULL!= strstr(cmdline, "&u100e:2=po")) m_idLang = id_POR; else if (NULL!= strstr(cmdline, "&u100e:2=sp")) m_idLang = id_SPA; } ZLanguageSetting_forNHNUSA g_LanguageSettingForNHNUSA; ZLanguageSetting_forNHNUSA* ZGetLanguageSetting_forNHNUSA() { return &g_LanguageSettingForNHNUSA; } Next, find this: aRootElement.AppendText("\n"); add this below it: #ifdef LOCALE_BRAZIL LANGID LangID = LANG_PORTUGUESE; /* Brazil */ #elif LOCALE_JAPAN LangID = LANG_JAPANESE; /* Japanese */ #elif LOCALE_US LangID = LANG_ENGLISH; /* International */ #elif LOCALE_KOREAN LangID = LANG_KOREAN; /* Korean */ #elif LOCALE_INDIA LangID = LANG_ENGLISH; /* India */ #endif return xmlConfig.SaveToFile(szFileName); In ZConfiguration.cpp, search for this: unsigned int ZConfiguration::GetSelectedLanguageIndex() Above it, add this: const char* ZConfiguration::GetLanguagePath() { switch (GetSelectedLanguageIndex()) { case 1: return PATH_USA; case 2: return PATH_SPA; case 3: return PATH_POR; default: return PATH_USA; } }Step 3:Code:In ZConfiguration.h, search for this: unsigned int GetSelectedLanguageIndex(); above it, add this: const char* GetLanguagePath();
Now that the language folderpath code is in place, it's time to do some changes to ZFilePath.h
Next in this step is adding the new folderpaths.Code:In ZFilePath.h, search for system/tips.xml, remove system/ from that so it only reads tips.xml
Step 4:Code:In ZFilePath.h, search for this: #define PATH_INTERFACE "Interface/" above it, add this: #define PATH_USA "system/USA/" #define PATH_SPA "system/SPA/" #define PATH_POR "system/POR/"
Now that all that's done, the next step is to change some functions so the filepaths will load correctly (this also allows you to remove messages,tips, cserror, and strings from the main container in system.mrs, thus reducing filesize).
Open ZStringResManager.cpp,
Next, open MBaseStringResManager.cpp:search for this:
if (ZGetConfiguration()->IsComplete() && ZGetLocale()->bIsComplete())
Replace the entire if statement(brackets as well), with this:
if (ZGetConfiguration()->IsComplete() && ZGetLocale()->bIsComplete())
{
if (!m_Messages.Initialize(strFileName.c_str(), ZGetLocale()->GetLanguage(), m_pFS))
{
_ASSERT(0);
char szPath[32] = "system/USA/messages.xml";
if (!m_Messages.Initialize(szPath, ZGetLocale()->GetLanguage(), m_pFS))
{
mlog("Error!! - Messages Initalize Failed\n");
return false;
}
}
}
Finally, open ztips.cpp:Search for this:
bool MBaseStringResManager::Init(const char* szPath, const int nLangID, MZFileSystem* pfs )
Replace the entire function with this one:
bool MBaseStringResManager::Init(const char* szPath, const int nLangID, MZFileSystem* pfs )
{
m_strPath = szPath;
m_pFS = pfs;
string strFileName;
// string table
strFileName = m_strPath + FILENAME_STRING_TABLE;
if (!m_StringTable.Initialize(strFileName.c_str(), nLangID, pfs))
{
_ASSERT(0);
char szPath[32] = "system/USA/strings.xml";
if (!m_StringTable.Initialize(szPath, nLangID, pfs))
{
mlog("Error!! - StringTable Initalize Failed\n");
return false;
}
}
// error table
strFileName = m_strPath + FILENAME_ERROR_TABLE;
if (!m_ErrorTable.Initialize(strFileName.c_str(), nLangID, pfs))
{
_ASSERT(0);
char szPath[32] = "system/USA/cserror.xml";
if (!m_ErrorTable.Initialize(szPath, nLangID, pfs))
{
mlog("Error!! - ErrorTable Initalize Failed\n");
return false;
}
}
bool ret = OnInit();
return ret;
}
Step 5:Code:Under MZFile mzf; add this: char szTipsPath[64]; sprintf(szTipsPath, "%s%s", ZGetConfiguration()->GetLanguagePath(), FILENAME_TIPS); replace the if(!mzf.open) statement with this one: if (!mzf.Open(szTipsPath, pfs)) return false;
Launch the client, and make sure all of the code works correctly. If it does, you can now remove strings.xml, cserror.xml, messages.xml, and tips.xml from your base container path in system.mrs. The benefit of the doublecheck implementation is it allows matchserver.exe & gunz.exe to both find the xml's correctly without having to change the code back to normal, build matchserver, and then change the code back to the modified to build gunz. It searches the original path first, then if the xml isn't found, it searches again. Let me know if you guys have any problems with the code.
Step 6.
Right Click on the gunz solution, open properties. Click Configuration properties, then c/c++, then click on preprocessor. Add this to the processor definitions:
_MULTILANGUAGE
Credits:
Lib: for showing me how to do a switch way back then lol, thanks bro, you're always such a big help.
Jorkenlis2 : for making that tutorial so mine could be much shorter :p







