From 409f5df9a9d198172e38574e84ee2e0ff1e2577a Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 17 May 2018 23:29:12 +0200 Subject: [PATCH] po export code removed. --- scripts/export.lua | 16 ---------------- src/bindings.c | 27 --------------------------- src/util/nrmessage.c | 10 ---------- src/util/nrmessage.h | 2 -- 4 files changed, 55 deletions(-) delete mode 100644 scripts/export.lua diff --git a/scripts/export.lua b/scripts/export.lua deleted file mode 100644 index 050c163e1..000000000 --- a/scripts/export.lua +++ /dev/null @@ -1,16 +0,0 @@ -local path = 'scripts' -if config.install then - path = config.install .. '/' .. path -end -package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua' -require 'eressea' -require 'eressea.xmlconf' -- read xml data - -local rules = {} -if config.rules then - rules = require('eressea.' .. config.rules) - eressea.log.info('loaded ' .. #rules .. ' modules for ' .. config.rules) -else - eressea.log.warning('no rule modules loaded, specify a game in eressea.ini or with -r') -end -export_locales() diff --git a/src/bindings.c b/src/bindings.c index 3f93a8a2f..5c6174c75 100755 --- a/src/bindings.c +++ b/src/bindings.c @@ -914,32 +914,6 @@ static int lua_rng_default(lua_State *L) { return 0; } -static void export_locale(const struct locale *lang, const char *name) { - char fname[64]; - FILE * F; - - sprintf(fname, "messages.%2s.po", name); - F = fopen(fname, "wt"); - if (F) { - export_messages(lang, F, NULL); - } -#if 0 - /* disabled, because it also export message text */ - sprintf(fname, "strings.%2s.po", name); - F = fopen(fname, "wt"); - if (F) { - export_strings(lang, F); - fclose(F); - } -#endif -} - -static int tolua_export_locales(lua_State *L) { - UNUSED_ARG(L); - locale_foreach(export_locale); - return 0; -} - void tolua_bind_open(lua_State * L); int tolua_bindings_open(lua_State * L, const dictionary *inifile) @@ -1057,7 +1031,6 @@ int tolua_bindings_open(lua_State * L, const dictionary *inifile) tolua_function(L, TOLUA_CAST "spells", tolua_get_spells); tolua_function(L, TOLUA_CAST "read_xml", tolua_read_xml); tolua_function(L, TOLUA_CAST "equip_newunits", tolua_equip_newunits); - tolua_function(L, TOLUA_CAST "export_locales", tolua_export_locales); } tolua_endmodule(L); return 1; } diff --git a/src/util/nrmessage.c b/src/util/nrmessage.c index 5adbde86f..057019242 100644 --- a/src/util/nrmessage.c +++ b/src/util/nrmessage.c @@ -175,13 +175,3 @@ void free_nrmesssages(void) { } } -void export_messages(const struct locale * lang, FILE *F, const char *msgctxt) { - int i; - for (i = 0; i != NRT_MAXHASH; ++i) { - nrmessage_type *nrt = nrtypes[i]; - while (nrt) { - po_write_msg(F, nrt->mtype->name, nrt_string(nrt, lang), msgctxt); - nrt = nrt->next; - } - } -} diff --git a/src/util/nrmessage.h b/src/util/nrmessage.h index e6c9f3ebc..abb47551c 100644 --- a/src/util/nrmessage.h +++ b/src/util/nrmessage.h @@ -43,8 +43,6 @@ extern "C" { char *buffer, size_t size, const void *userdata); const char *nr_section(const struct message *msg); - void export_messages(const struct locale * lang, FILE *F, const char *msgctxt); - #ifdef __cplusplus } #endif