• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Language text file

SaLeM

New Member
Joined
Oct 14, 2007
Messages
97
Reaction score
0
Location
Spain
Hi. I have translated my server in sources, ok? Have you ever thought on exporting every "readable" text in the sources into a single language file? For example:

english.lng
polish.lng
french.lng

etc..

So, if you want to translate your server's texts, you just have to do it on that file, which is always the same, on every server's update, so you don't have to translate sources every time the server is updated or bugfixed.

Just a dream.. :)
 
Nope, just like this:

Example of sources:

s<< "Sorry not possible" <<

(I don't know C++, something like that)

and change it to:

s<<LANGUAGEFILE:CANCELMESSAGE<<

and the language file would contain every text like "sorry not possible" and that sort of texts, but in your language.

english.lng:

CANCELMESSAGE = "Sorry not possible"

spanish.lng:

CANCELMESSAGE = "Lo siento, no es posible"

So, depending on the language you selected, you will get the translated text in the .lng file, instead of editing sources every time the server is updated. And you could create as many language files as you want, just by adding the .lng file on the server folder, called as the language name you want. You understand?
 
Sure, thats good idea, like in PHP. ;) OTS will be more customizable (or something like this, my english isn't good :p)

I have already thinked about making my otserv 3 language, i already translated site, now i'm starting to translate all lua scripts, that first will get player language from storage value, it will look like this:

Code:
if getPlayerLang(cid) == 1 then //english
welcome = "Welcome"
elseif getPlayerLang(cid) == 2 then //polish
welcome = "Witaj"

I accept this idea, i quess it isn't hard to do, and make OTS better place to peoples who don't know much another languages ;)

But i have new idea to this, account should have "language", then ots will check for this and send msg in language which account have. Something like multilanguage OTServ :D
 
Sure, thats good idea, like in PHP. ;) OTS will be more customizable (or something like this, my english isn't good :p)

I have already thinked about making my otserv 3 language, i already translated site, now i'm starting to translate all lua scripts, that first will get player language from storage value, it will look like this:

Code:
if getPlayerLang(cid) == 1 then //english
welcome = "Welcome"
elseif getPlayerLang(cid) == 2 then //polish
welcome = "Witaj"

I accept this idea, i quess it isn't hard to do, and make OTS better place to peoples who don't know much another languages ;)

But i have new idea to this, account should have "language", then ots will check for this and send msg in language which account have. Something like multilanguage OTServ :D


Can you believe that I made an NPC called "Language Changer" ? xD xD The purpose was that you said, so you can change it whenever you want in game xD xD
 
Hah, i have too NPC which will change your language :p

Now question for C++ masters, it is possible to be language in C++ was to all players another? I mean when player have in account language="english" then it will send msg "Sorry not possible" but if player is from Poland then msg "Nie mozliwe"? Or it will use to much % CPU?
 
Why much cpu? Btw, Nothing is impossible, and that isn't even near that, its near lvl1 programming! ;]
 
Back
Top