Lilith Posted March 21, 2013 Posted March 21, 2013 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. 8
Euphy Posted March 21, 2013 Posted March 21, 2013 This project's roles: Coding: @Lilith & @Lighta Translations: Chinese: /@goddameit German: @Snow/@Lemongrass Russian: @Lilith Bahasa Malaysia: @Feistz Bahasa Indonesia: @Cydh/@nanakiwurtz French: @Capuche Spanish: @jaBote/@Tragedy Portuguese: @mkbu95 A huge thanks to everyone for your willingness to get involved! 1
DarkArcAngel Posted March 22, 2013 Posted March 22, 2013 (edited) very good idea, the brazilian project has a similar system. http://svn.brathena.org/brAthena/testes/conf/lang/ Edited March 22, 2013 by DarkArcAngel 1
Emistry Posted March 22, 2013 Posted March 22, 2013 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.
Lilith Posted March 22, 2013 Author Posted March 22, 2013 @Emistry, server's messages only ( \conf\msg_conf )
Euphy Posted March 24, 2013 Posted March 24, 2013 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. 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. 3
Cydh Posted March 24, 2013 Posted March 24, 2013 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.
Lilith Posted March 24, 2013 Author Posted March 24, 2013 (edited) 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 Diff: http://www.mediafire.com/?uita4m3p4e9uovu SQL Query: ALTER TABLE `login` ADD `lang` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '0' Edited March 26, 2013 by Lilith 2
Cydh Posted March 24, 2013 Posted March 24, 2013 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.confconf/msg_conf/login_msg.confconf/msg_conf/map_msg.confconf/msg_conf/ru/char_msg.confconf/msg_conf/ru/login_msg.confconf/msg_conf/ru/map_msg.confconf/msg_conf/sp/char_msg.confconf/msg_conf/sp/login_msg.confconf/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?
Lilith Posted March 24, 2013 Author Posted March 24, 2013 (edited) 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 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 March 24, 2013 by Lilith
Euphy Posted March 24, 2013 Posted March 24, 2013 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. 1
Lighta Posted March 24, 2013 Posted March 24, 2013 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. 3
Bin4ry Posted March 25, 2013 Posted March 25, 2013 I can contribute in chinese translation in case if rA needs anyone. 1
Euphy Posted March 25, 2013 Posted March 25, 2013 I can contribute in chinese translation in case if rA needs anyone.That would be wonderful. Thank you for your support!
Snow Posted March 25, 2013 Posted March 25, 2013 if nobody already doin it, i would support the german one o/ 1
Euphy Posted March 25, 2013 Posted March 25, 2013 if nobody already doin it, i would support the german one o/It's yours. Thanks!
Cydh Posted March 26, 2013 Posted March 26, 2013 (edited) @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 March 26, 2013 by Cydh 1
Lilith Posted March 26, 2013 Author Posted March 26, 2013 @Cydh So far, no change. I don't know how to not add an argument to a function msg_txt. 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 1
Lighta Posted March 26, 2013 Posted March 26, 2013 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. 1
Recommended Posts