summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2015-02-23 14:24:36 -0300
committershennetsind <ind@henn.et>2015-02-23 14:24:36 -0300
commit330e31cc71ece055908acb1eb967b4009ebc9c46 (patch)
tree17636c66a28d452c01f77df2728f37287abbbeea /src/map/map.c
parent47ff8ed7fa7603974a6f5e41b5290e5e24916317 (diff)
downloadhercules-330e31cc71ece055908acb1eb967b4009ebc9c46.tar.gz
hercules-330e31cc71ece055908acb1eb967b4009ebc9c46.tar.bz2
hercules-330e31cc71ece055908acb1eb967b4009ebc9c46.tar.xz
hercules-330e31cc71ece055908acb1eb967b4009ebc9c46.zip
Hercules Ultimate Localization Design
Servers can now run on any number of languages, without editing npc files. Designed by Haruna and Ind http://hercules.ws/board/topic/8687-hercules-ultimate-localization-design/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 745814f78..c79d49c3e 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -3595,6 +3595,8 @@ int map_config_read(char *cfgName) {
map->enable_grf = config_switch(w2);
else if (strcmpi(w1, "console_msg_log") == 0)
console_msg_log = atoi(w2);//[Ind]
+ else if (strcmpi(w1, "default_language") == 0)
+ safestrncpy(map->default_lang_str, w2, sizeof(map->default_lang_str));
else if (strcmpi(w1, "import") == 0)
map->config_read(w2);
else
@@ -5821,6 +5823,24 @@ static CMDLINEARG(loadscript)
map->extra_scripts[map->extra_scripts_count-1] = aStrdup(params);
return true;
}
+
+/**
+ * --generate-translations
+ *
+ * Creates "./generated_translations.pot"
+ * @see cmdline->exec
+ **/
+static CMDLINEARG(generatetranslations) {
+ script->lang_export_file = aStrdup("./generated_translations.pot");
+
+ if( !(script->lang_export_fp = fopen(script->lang_export_file,"wb")) ) {
+ ShowError("export-dialog: failed to open '%s' for writing\n",script->lang_export_file);
+ }
+
+ runflag = CORE_ST_STOP;
+ return true;
+}
+
/**
* Defines the local command line arguments
*/
@@ -5837,6 +5857,7 @@ void cmdline_args_init_local(void)
CMDLINEARG_DEF2(log-config, logconfig, "Alternative logging configuration.", CMDLINE_OPT_NORMAL|CMDLINE_OPT_PARAM);
CMDLINEARG_DEF2(script-check, scriptcheck, "Doesn't run the server, only tests the scripts passed through --load-script.", CMDLINE_OPT_SILENT);
CMDLINEARG_DEF2(load-script, loadscript, "Loads an additional script (can be repeated).", CMDLINE_OPT_NORMAL|CMDLINE_OPT_PARAM);
+ CMDLINEARG_DEF2(generate-translations, generatetranslations, "Creates './generated_translations.pot' file with all translateable strings from scripts, server terminates afterwards.", CMDLINE_OPT_NORMAL);
}
int do_init(int argc, char *argv[])
@@ -6087,6 +6108,7 @@ void map_defaults(void) {
sprintf(map->server_pw,"ragnarok");
sprintf(map->server_db,"ragnarok");
map->mysql_handle = NULL;
+ map->default_lang_str[0] = '\0';
map->cpsd_active = false;