What's new

Tutorial [Mini Release] multi language for different channels same server same db

Blaze

Active member
a simple system to load a different locale on different channels of the same server with the same database,
so if you want to channel2 in the LANG_GLOBAL config
: germany you will need to have everything inside what about the local germany so 'you can make for example
4 channels one Italian one Spanish one German one English and have a multi-language server complete with quests

in local_service.cpp
Code:
bool LocaleService_Init(const std::string& c_rstServiceName)
changed with
Code:
C ++:
bool LocaleService_Init(const std::string& c_rstServiceName)
{
#ifdef ENABLE_MULTY_LANG // Raziel |maked a new Token for Global Lang|
    sys_err("NEW LANGUAGE GLOBAL ARE MAKED |WELL DONE!!|");
#else
    if (!g_stServiceName.empty())
    {
        sys_err("ALREADY exist service");
        return false;
    }

    g_stServiceName = c_rstServiceName;
#endif
    if ( "japan" == g_stServiceName)
    {
        __LocaleService_Init_JAPAN();
    }
look
Code:
string g_stServiceName;
so '
Code:
C ++:
#ifdef ENABLE_MULTY_LANG // Raziel |maked a new Token for Global Lang|
extern string    g_stServiceName;
#else
string g_stServiceName;
#endif
look in config.h and add later
Code:
enum
{
ADDRESS_MAX_LEN = 15
};

Code:
C ++:
#ifdef ENABLE_MULTY_LANG // Raziel |maked a new Token for Global Lang|
extern std::string    g_stServiceName;
#endif
look in config.cpp add later
Code:
char g_szPublicIP[16] = "0";

char g_szInternalIP[16] = "0";

bool g_bSkillDisable = false;

int g_iFullUserCount = 2000;

int g_iBusyUserCount = 200;

//Canada

Code:
C ++:
#ifdef ENABLE_MULTY_LANG
string    g_stServiceName = "";
#endif
now in config.cpp look for add later
Code:
TOKEN("channel")

{

str_to_number(g_bChannel, value_string);

continue;

}
Code:
C ++:
#ifdef ENABLE_MULTY_LANG
        TOKEN("LANG_GLOBAL") // Raziel |maked a new Token for Global Lang|
        {
            g_stServiceName = value_string;
            fprintf(stdout, "g_stServiceName: %s\n", g_stServiceName.c_str());
            continue;
        }
#endif
now in service.h add this
Code:
C ++:
#define ENABLE_MULTY_LANG // Raziel |maked a new Token for Global Lang| sintax |LANG_GLOBAL: germany| config from core
1 server 1 database and all the rooms you want by setting them in the config of each ch
 
Top