summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-12-30 17:47:24 +0100
committerHaru <haru@dotalux.com>2016-06-25 17:29:46 +0200
commitd442d4c5beca900865c5f323486818ae9ef42d89 (patch)
treefa9553cc1d8f938c6e358d47cd548cc0fda20eb3
parentbdc2d0ba6382ef32862052363306abcb3c63c49a (diff)
downloadhercules-d442d4c5beca900865c5f323486818ae9ef42d89.tar.gz
hercules-d442d4c5beca900865c5f323486818ae9ef42d89.tar.bz2
hercules-d442d4c5beca900865c5f323486818ae9ef42d89.tar.xz
hercules-d442d4c5beca900865c5f323486818ae9ef42d89.zip
Improved the format of the exported .pot translation template
Signed-off-by: Haru <haru@dotalux.com>
-rw-r--r--src/map/map.c25
-rw-r--r--src/map/script.c2
2 files changed, 25 insertions, 2 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 3a7d752c3..22486b8f4 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -6010,8 +6010,31 @@ static CMDLINEARG(loadscript)
static CMDLINEARG(generatetranslations) {
script->lang_export_file = aStrdup("./generated_translations.pot");
- if( !(script->lang_export_fp = fopen(script->lang_export_file,"wb")) ) {
+ 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);
+ } else {
+ time_t t = time(NULL);
+ struct tm *lt = localtime(&t);
+ int year = lt->tm_year+1900;
+ fprintf(script->lang_export_fp,
+ "# This file is part of Hercules.\n"
+ "# http://herc.ws - http://github.com/HerculesWS/Hercules\n"
+ "#\n"
+ "# Copyright (C) 2013-%d Hercules Dev Team\n"
+ "#\n"
+ "# Hercules is free software: you can redistribute it and/or modify\n"
+ "# it under the terms of the GNU General Public License as published by\n"
+ "# the Free Software Foundation, either version 3 of the License, or\n"
+ "# (at your option) any later version.\n"
+ "#\n"
+ "# This program is distributed in the hope that it will be useful,\n"
+ "# but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+ "# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
+ "# GNU General Public License for more details.\n"
+ "#\n"
+ "# You should have received a copy of the GNU General Public License\n"
+ "# along with this program. If not, see <http://www.gnu.org/licenses/>.\n",
+ year);
}
core->runflag = CORE_ST_STOP;
return true;
diff --git a/src/map/script.c b/src/map/script.c
index 5b179dea1..1f2f51d13 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -1411,7 +1411,7 @@ void script_add_translatable_string(const struct script_string_buf *string, cons
"\"");
VECTOR_PUSH(script->lang_export_escaped_buf, '\0');
- fprintf(script->lang_export_fp, "#: %s\n"
+ fprintf(script->lang_export_fp, "\n#: %s\n"
"# %s\n"
"msgctxt \"%s\"\n"
"msgid \"%s\"\n"