Jump to content

Multilanguage support


Lilith

Recommended Posts


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  407
  • Reputation:   159
  • Joined:  11/18/11
  • Last Seen:  

I propose to add multilingual support. Player's language stored in the database (sd-> lang_id, for ex.), default 0 - English language. The idea is to read multiple files msg_conf different languages.
sd->lang_id = 0 // English
sd->lang_id = 1 // Spanish
sd->lang_id = 2 // German
etc...
 

msg_table[MAX_LANG][MAP_MAX_MSG];

 

For add the new language we must add a new parameter like 'read_msg: 1,map_msg_sp.conf',
where
'1' - is Language ID
'map_msg_sp.conf' - spanish translation.
 
In-game example: if player havent language (sd->lang_id = 0), he will recive 
'Character not found'
if(sd->lang_id = 1) // Spanish
he will recive
'El carácter no se ha encontrado'.
 
Thus, each player will receive messages from the server in understandable language.
  • Upvote 8
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

This project's roles:

A huge thanks to everyone for your willingness to get involved!
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

nice translation idea for msg_conf. :D

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  1
  • Reputation:   1
  • Joined:  06/07/12
  • Last Seen:  

very good idea, the brazilian project has a similar system.  /ok

http://svn.brathena.org/brAthena/testes/conf/lang/

Edited by DarkArcAngel
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2347
  • Joined:  10/28/11
  • Last Seen:  

just a translation of all system messages ? or something that look like the eAmod language system ?

isnt that would be very large to store all messages in database ? why not just create another option to read different message conf file ?

 

beside....if i am not mistaken, this will also required the client to have a proper langtype to support some of the languages..and of course not all language is supported i believe.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  407
  • Reputation:   159
  • Joined:  11/18/11
  • Last Seen:  

@Emistry, server's messages only ( \conf\msg_conf )

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  398
  • Reputation:   140
  • Joined:  01/04/12
  • Last Seen:  

Seems like a good idea, you got my support.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  12
  • Reputation:   1
  • Joined:  03/22/13
  • Last Seen:  

I'm supporting this.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  60
  • Reputation:   9
  • Joined:  04/16/12
  • Last Seen:  

+1 /no1

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

This is a fantastic and very reasonable way for rAthena to encompass a larger community. It certainly gets my vote. If no developer disagrees, we can begin work on this immediately.

Lilith: Are you able to code the implementation of this, and contribute a Russian translation?

To everyone else: If you have the time, please post or let me know if you're willing to write a translation for your native language. We will need, at minimum, one file for each language in our International Forums.

 

very good idea, the brazilian project has a similar system.  /ok

http://svn.brathena.org/brAthena/testes/conf/lang/

That's also an interesting idea; it's not as immediately useful, but worth considering. Let's return to it after msg_conf is finished or under way.
  • Upvote 3
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

To everyone else: If you have the time, please post or let me know if you're willing to write a translation for your native language. We will need, at minimum, one file for each language in our International Forums.

+1

and I hope Indonesian will have own msg_conf, Indonesian and Malay have different speech. :D

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  407
  • Reputation:   159
  • Joined:  11/18/11
  • Last Seen:  

Initial support to read multiple 'msg_conf' files... Need tests.

Change 'lang' column in table 'login' for change language id... By default, lang ID = 0 its English

 

Examples: (in char_athena.conf, login_athena_conf and map_athena_conf )

 

Translations
Format:
read_msg: language ID,path
read_msg: 1,conf/msg_conf/map_msg_sp.conf // Spanish
read_msg: 2,conf/msg_conf/map_msg_ru.conf // Russian

 

 
SQL Query:
ALTER TABLE  `login` ADD  `lang` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT  '0'

 

 

 

 
Edited by Lilith
  • Upvote 2
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

Wow nice. changed all msg_txt line on whole src. You're careful to change them xD

 

btw, any simplier way?
1st, define msg dir, conf/msg_conf

2nd, define each msg file

  • char_msg.conf
  • login_msg.conf
  • map_msg.conf

3nd, define language directory

  • English: (lang_id 0)
  • Russian: ru/ (lang_id 1)
  • Spanish: sp/ (lang_id 2)

so, the dir structure

conf/msg_conf/char_msg.conf
conf/msg_conf/login_msg.conf
conf/msg_conf/map_msg.conf
conf/msg_conf/ru/char_msg.conf
conf/msg_conf/ru/login_msg.conf
conf/msg_conf/ru/map_msg.conf
conf/msg_conf/sp/char_msg.conf
conf/msg_conf/sp/login_msg.conf
conf/msg_conf/sp/map_msg.conf

4th, so when msg_txt is called, it checks player's lang_id, lang_id can be set by @lang maybe, and the default is 0

possible?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  407
  • Reputation:   159
  • Joined:  11/18/11
  • Last Seen:  

3nd, define language directory

  • English: (lang_id 0)
  • Russian: ru/ (lang_id 1)
  • Spanish: sp/ (lang_id 2)

Do you mean that lang_id to be hardcoded in src ? No problem  /bo

4th, of course its possible.

btw, i'm not sure about this implementation. For example in the file int_auction.c there is no check on the language...

Edited by Lilith
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

not sure too.. haha

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Thanks for the hard work, Lilith.

Is it possible to instead modify the msg_txt function itself to check for player lang, using the default if nothing is found/no player is attached?

As for structure, here's what I think:

  • Store language files in subdirectories, as Cydh posted, to avoid clutter:
    • conf/msg_conf/ - English files (root)
    • conf/msg_conf/[lang]/ - Translations (subdirectories)
  • Define lang directory names in src.
  • Define default directory either in conf (once, in inter_athena or a new file?) or src.
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

Hoi, nice idea I had the same actually but never finish it, anyway here my input/ remark on this :

- not official blabla, so I was thinking of just a mod but I'm agreeing with Euphy stating it's a good plus so we might put in in svn. (ok but then I think we need #define to not increase ram consumtion for people who's interested in 1 lang only.

(each lang take 1 more msg_conf comsumtion, not that big but there no reason to increase it if you wont use it especially when is not that hard to prevent it...)

- we was thinking of #define LANG (bitmask) so you can choose wich lang to choose.

- if msg from user lang not define return default lang msg. (fallback)

 

That general concept now to speak more about diff :
-I don't like new structure of msg_txt(lang,int), I think lang could be taken in msg_txt() fonction without being assign as argument.

-store data is duplicated, I mean on each serv you have assigned a var to config wich lang you want. (duplication => posssible mistmatch => possible failure), I personnaly hate duplication for this. I was thinking mmo_status could do it fine. mmo is char wide yeah but since we have one at the time I think it's ok, we wont lose ram.

- New row in login is good but that could be stored as global_reg as well. Global_reg table offert the possibility of scripts/atcommand interaction while login table shouldn't if we want to respect schema/server independancy. Plus present to not need a whole new colum for that.

That all anyway thx Lilith, didn't have time to properly try it yet but I'll.

  • Upvote 3
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

I can contribute in chinese translation in case if rA needs anyone.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

I can contribute in chinese translation in case if rA needs anyone.

That would be wonderful. Thank you for your support!
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  141
  • Reputation:   34
  • Joined:  05/30/12
  • Last Seen:  

if nobody already doin it, i would support the german one o/

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

if nobody already doin it, i would support the german one o/

It's yours. Thanks!
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

@Lilith, I saw your post has been edited, what's change?

 

@topic

btw, if the lang is decided by player in-game (with command @lang <lang_id> maybe), then it will stored on `login` table, `lang` field.

is the login_msg still can be translated? example "Rejected from server", the player doesn't login at all, can't read sd->lang. (CMIIW)

 

LOL, can I participate too for Bahasa if Indonesian Moderator doesn't do it? xD

Edited by Cydh
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  407
  • Reputation:   159
  • Joined:  11/18/11
  • Last Seen:  

@Cydh

So far, no change. I don't know how to not add an argument to a function msg_txt. :unsure: I'll see today how to do this.

Need to remake this all, because login server use msg_txt only for logs, not for players, my mistake... We must to add language support for map server only ( + char server's mail messages? )

 

I can give the russian translation of file map_msg.txt

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

hmm I just check how to not add an arg, we could do it by define but that may be too weak/tricky. So ye we probably need one, but I was thinking of sending sd or char_id or mmo and do the langage treatement in the msg_txt function rather then for each line.

like

const char* _msg_txt(struct mmo_charstatus *mmc,int msg_number,int size, char *** msg_table)
{
    char output[128] = "??";
    uint8 lang = mmc->lang;
    if (msg_number >= 0 && msg_number < size){
    if(msg_table[lang][msg_number] != NULL && msg_table[lang][msg_number][0] != '\0')
        output[128] = msg_table[lang][msg_number];
    else if(msg_table[0][msg_number] != NULL && msg_table[0][msg_number][0] != '\0') //fallback
        output[128] = msg_table[0][msg_number];
    }
    return output[128];
}

point was doing the langage treatement in the msg_txt function rather then at each call.
Yes for login that may be annoying, well we don't necessarly need multiple table for login, probably the default would suffice.
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  139
  • Reputation:   10
  • Joined:  11/10/11
  • Last Seen:  

I will do the Malaysian/Bahasa Malaysia :)

  • Upvote 1
Link to comment
Share on other sites

×
×
  • Create New...