Multilanguage Support
r17251 extends the functionality of rAthena's map-server message system to support other languages. When enabled, players are able to set a language to receive self-information messages, notably from atcommands. This setting is stored as the #langtype variable in `global_reg_value` (default 0, or English). Note that adding additional languages consume RAM, so all languages besides English are disabled by default.
Adding a Language
Languages are defined in a bitmask in trunk/src/common/msg_conf.h:
enum lang_types {
LANG_RUS = 0x01,
LANG_SPN = 0x02,
LANG_GRM = 0x04,
LANG_CHN = 0x08,
LANG_MAL = 0x10,
LANG_IDN = 0x20,
LANG_FRN = 0x40,
LANG_POR = 0x80,
LANG_THA = 0X100,
LANG_MAX
};
// Multilanguage System.
// Define which languages to enable (bitmask).
// 0xFFF will enable all, while 0x000 will enable English only.
#define LANG_ENABLE 0x000Add values for languages you want to enable, then recompile.Setting a Language
The @langtype command will allow players to switch their language setting:
For example, typing @langtype SPN will make all messages display in Spanish.Language Files
All language files are stored in the trunk/conf/msg_conf/ directory as map_msg_***.conf. Custom messages may be stored inside the 'import' directory for easy updating.
When the server reads a line from a language file, you may receive debug messages for the following cases:
The line is missing from the translation file.
The language is enabled, but the table is missing.
In both cases, the server will output the English line as a fallback.(As of now, not all translations are complete.)
Other Changes
The msg_txt function now takes a target parameter, so all lines like this:
clif_displaymessage(fd, msg_txt(6)); // Your save point has been changed. Now look like this:clif_displaymessage(fd, msg_txt(sd,6)); // Your save point has been changed.If you have any conflicting code, consider using RegEx to batch update the lines rather than doing so manually; Cydh has explained the process here.Lastly, the @reloadmsgconf command will reload all message configuration files.
Credits
This project is made possible through the support of many of our members:
Coding: @Lilith & @Lighta
Translations:
Chinese: @goddameit/ (svn) (user)
German: @Snow/@Lemongrass
Russian: @Lilith/@Jarek (svn) (user)
Bahasa Malaysia: @Feistz
Bahasa Indonesia: @Cydh/@nanakiwurtz (svn) (user)
French: @Capuche (svn) (user)
Spanish: @Leeg (svn) (user) ~ @jaBote/@Tragedy (user)
Portuguese: @mkbu95 (svn)
Thai: @boneskung (svn)
Thanks to everyone for their help!(The original topic may be found here.)
Updates
Please post any updates or changes you would like to see in a translation file here; they will be reviewed and added periodically.
Any time changes are made to the original map_msg files, a post will also be made; if you are contributing to the translations, I ask that you follow this topic and provide updates when this happens.