diff options
author | Haru <haru@dotalux.com> | 2016-07-08 12:35:49 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-07-10 16:12:35 +0200 |
commit | e369beded2b6758a4358b2366130e59976b8856b (patch) | |
tree | aa76b4ca05b2727c18cc7d58799f85483693f6bd | |
parent | ba4404e08ad2ef0f70a0faf9bb1538a80e3abf1a (diff) | |
download | hercules-e369beded2b6758a4358b2366130e59976b8856b.tar.gz hercules-e369beded2b6758a4358b2366130e59976b8856b.tar.bz2 hercules-e369beded2b6758a4358b2366130e59976b8856b.tar.xz hercules-e369beded2b6758a4358b2366130e59976b8856b.zip |
HULD generator: Show the amount of strings parsed
Signed-off-by: Haru <haru@dotalux.com>
-rw-r--r-- | src/plugins/generate-translations.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/generate-translations.c b/src/plugins/generate-translations.c index 23f436abc..759e788a2 100644 --- a/src/plugins/generate-translations.c +++ b/src/plugins/generate-translations.c @@ -48,6 +48,7 @@ FILE *lang_export_fp; char *lang_export_file;/* for lang_export_fp */ struct script_string_buf lang_export_line_buf; struct script_string_buf lang_export_escaped_buf; +int lang_export_stringcount; /// Whether the translations template generator will automatically run. bool generating_translations = false; @@ -187,6 +188,7 @@ void script_add_translatable_string_posthook(const struct script_string_buf *str script->parser_current_npc_name ? script->parser_current_npc_name : "Unknown NPC", VECTOR_DATA(lang_export_escaped_buf) ); + lang_export_stringcount++; VECTOR_TRUNCATE(lang_export_line_buf); VECTOR_TRUNCATE(lang_export_escaped_buf); } @@ -232,6 +234,7 @@ bool msg_config_read_posthook(bool retVal, const char *cfg_name, bool allow_over "msgstr \"\"\n", atcommand->msg_table[0][i] ); + lang_export_stringcount++; } } @@ -248,6 +251,7 @@ HPExport void server_preinit(void) addHookPre(script, parse, parse_script_prehook); addHookPost(script, parser_clean_leftovers, script_parser_clean_leftovers_posthook); addHookPost(atcommand, msg_read, msg_config_read_posthook); + lang_export_stringcount = 0; } HPExport void plugin_init(void) @@ -257,7 +261,7 @@ HPExport void plugin_init(void) HPExport void server_online(void) { if (generating_translations && lang_export_fp != NULL) { - ShowInfo("Lang exported to '%s'\n", lang_export_file); + ShowInfo("Translations template exported to '%s' with %d strings.\n", lang_export_file, lang_export_stringcount); fclose(lang_export_fp); lang_export_fp = NULL; } |