What's new

Welcome to Onforum.net - Web and gaming resource community

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

Ask question

Ask Questions and Get Answers from Our Community

Answer

Answer Questions and Become an Expert on Your Topic

Contact Staff

Our Experts are Ready to Answer your Questions

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

Blaze

Elite
Elite
Joined
Jan 28, 2019
Messages
250
Reaction score
1,608
Points
93
Credits
51
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
 
shape1
shape2
shape3
shape4
shape7
shape8
Top