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

Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Blaze

Elite
Elite
VIP
Joined
Jan 28, 2019
Messages
507
Credits
635
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:
Expand Collapse Copy
bool LocaleService_Init(const std::string& c_rstServiceName)
changed with
Code:
Expand Collapse Copy
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:
Expand Collapse Copy
string g_stServiceName;
so '
Code:
Expand Collapse Copy
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:
Expand Collapse Copy
enum
{
ADDRESS_MAX_LEN = 15
};


Code:
Expand Collapse Copy
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:
Expand Collapse Copy
char g_szPublicIP[16] = "0";

char g_szInternalIP[16] = "0";

bool g_bSkillDisable = false;

int g_iFullUserCount = 2000;

int g_iBusyUserCount = 200;

//Canada


Code:
Expand Collapse Copy
C ++:
#ifdef ENABLE_MULTY_LANG
string    g_stServiceName = "";
#endif

now in config.cpp look for add later
Code:
Expand Collapse Copy
TOKEN("channel")

{

str_to_number(g_bChannel, value_string);

continue;

}

Code:
Expand Collapse Copy
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:
Expand Collapse Copy
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
 
Lol, i will try it... Interesting o.O
Someone tried it? is it working?
 
Back
Top