diff --git a/res/core/de/strings.xml b/res/core/de/strings.xml
index 2be2f04e4..82174da28 100644
--- a/res/core/de/strings.xml
+++ b/res/core/de/strings.xml
@@ -1688,12 +1688,6 @@
Mallornsamen
-
- Feuerwerk
-
-
- Feuerwerke
-
Lebkuchenherz mit der Aufschrift 'Erz und
Stein, das ist fein'
diff --git a/res/core/en/strings.xml b/res/core/en/strings.xml
index 096dace78..c4663d1b1 100644
--- a/res/core/en/strings.xml
+++ b/res/core/en/strings.xml
@@ -874,12 +874,6 @@
mallorn seeds
-
- firework
-
-
- fireworks
-
gingerbread heart
diff --git a/res/core/fr/strings.xml b/res/core/fr/strings.xml
index d6c61e00c..1c9c524f4 100644
--- a/res/core/fr/strings.xml
+++ b/res/core/fr/strings.xml
@@ -881,12 +881,6 @@
graines de mallorn
-
- feu d'artifice
-
-
- feux d'artifice
-
coeur de pain d'épices
diff --git a/res/core/messages.xml b/res/core/messages.xml
index 371369dbf..afc391650 100644
--- a/res/core/messages.xml
+++ b/res/core/messages.xml
@@ -750,38 +750,6 @@
"$unit($unit) hat Glück und findet einen Hort von $int($amount) $resource($item,$amount)."
"$unit($unit) luckily finds a cache of $int($amount) $resource($item,$amount)."
-
-
-
-
- "$unit($unit) brennt ein großes Feuerwerk ab und Kaskaden bunter Sterne, leuchtende Wasserfälle aus Licht und strahlende Feuerdrachen erhellen den Himmel."
- "A large firework is visible all over the sky."
-
-
-
-
-
-
- "In $region($region) wird ein großes Feuerwerk abgebrannt, welches noch hier zu bewundern ist. Kaskaden bunter Sterne, leuchtende Wasserfälle aus Licht und strahlende Feuerdrachen erhellen den Himmel."
- "A large firework, visible all over the sky, has been started in $region($region)."
-
-
-
-
-
-
- "Zur Feier des Geburtstags von ${name} brennt $unit($unit) ein großes Feuerwerk ab. Kaskaden bunter Sterne, leuchtende Wasserfälle aus Licht und strahlende Feuerdrachen erhellen den Himmel."
- "A large firework in honor of ${name} is visible all over the sky."
-
-
-
-
-
-
-
- "Zur Feier des Geburtstags von ${name} wird in $region($region) ein großes Feuerwerk abgebrannt, welches noch hier zu bewundern ist. Kaskaden bunter Sterne, leuchtende Wasserfälle aus Licht und strahlende Feuerdrachen erhellen den Himmel."
- "A large firework in honor of ${name}, visible all over the sky, has been started in $region($region)."
-
@@ -7628,7 +7596,7 @@
"$unit($unit) in $region($region): '$order($command)' - The $ship($ship) will now be faster."
-
+
diff --git a/scripts/tests/e2/items.lua b/scripts/tests/e2/items.lua
index 99b32cc52..d4b09e363 100644
--- a/scripts/tests/e2/items.lua
+++ b/scripts/tests/e2/items.lua
@@ -86,7 +86,7 @@ function test_aurapotion50()
turn_begin()
turn_process()
assert_equal(0, u:get_item("aurapotion50"))
- assert_equal(1, f:count_msg_type('aurapotion50'))
+ assert_equal(1, f:count_msg_type('aurapotion50_effect'))
assert_equal(50, u.aura)
turn_end()
end
diff --git a/src/bindings.c b/src/bindings.c
index 7d9534c21..11a049c5d 100755
--- a/src/bindings.c
+++ b/src/bindings.c
@@ -924,12 +924,6 @@ static void export_locale(const struct locale *lang, const char *name) {
export_strings(lang, F);
fclose(F);
}
- sprintf(fname, "messages.%2s.po", name);
- F = fopen(fname, "wt");
- if (F) {
- export_messages(lang, F, NULL);
- fclose(F);
- }
}
static int tolua_export_locales(lua_State *L) {
diff --git a/src/creport.c b/src/creport.c
index 4fc1cdd99..d48c61739 100644
--- a/src/creport.c
+++ b/src/creport.c
@@ -512,14 +512,14 @@ static void report_crtypes(FILE * F, const struct locale *lang)
for (i = 0; i != MTMAXHASH; ++i) {
struct known_mtype *kmt;
for (kmt = mtypehash[i]; kmt; kmt = kmt->nexthash) {
- const struct nrmessage_type *nrt = nrt_find(lang, kmt->mtype);
+ const struct nrmessage_type *nrt = nrt_find(kmt->mtype);
if (nrt) {
char buffer[DISPLAYSIZE];
int hash = (int)kmt->mtype->key;
assert(hash > 0);
fprintf(F, "MESSAGETYPE %d\n", hash);
fputc('\"', F);
- fputs(str_escape(nrt_string(nrt), buffer, sizeof(buffer)), F);
+ fputs(str_escape(nrt_string(nrt, lang), buffer, sizeof(buffer)), F);
fputs("\";text\n", F);
fprintf(F, "\"%s\";section\n", nrt_section(nrt));
}
diff --git a/src/items.c b/src/items.c
index d0f6f7b0b..574c1da3b 100644
--- a/src/items.c
+++ b/src/items.c
@@ -224,7 +224,7 @@ int amount, struct order *ord)
change_spellpoints(u, 50);
- ADDMSG(&u->faction->msgs, msg_message("aurapotion50",
+ ADDMSG(&u->faction->msgs, msg_message("aurapotion50_effect",
"unit region command", u, u->region, ord));
use_pooled(u, itype->rtype, GET_DEFAULT, 1);
diff --git a/src/util/nrmessage.c b/src/util/nrmessage.c
index f74d6ab51..f35734f37 100644
--- a/src/util/nrmessage.c
+++ b/src/util/nrmessage.c
@@ -30,38 +30,26 @@
#define NRT_MAXHASH 1021
static nrmessage_type *nrtypes[NRT_MAXHASH];
-const char *nrt_string(const struct nrmessage_type *type)
+const char *nrt_string(const struct nrmessage_type *nrt, const struct locale *lang)
{
- if (type->string) {
- return type->string;
- }
- return locale_get(type->lang, type->mtype->name);
+ return locale_getstring(lang, nrt->mtype->name);
}
-nrmessage_type *nrt_find(const struct locale * lang,
- const struct message_type * mtype)
+nrmessage_type *nrt_find(const struct message_type * mtype)
{
nrmessage_type *found = NULL;
unsigned int hash = mtype->key % NRT_MAXHASH;
nrmessage_type *type = nrtypes[hash];
while (type) {
if (type->mtype == mtype) {
- if (found == NULL)
+ if (found == NULL) {
found = type;
- else if (type->lang == NULL)
- found = type;
- if (lang == type->lang) {
- found = type;
- break;
}
}
type = type->next;
}
if (!found) {
- log_warning("could not find nr-type %s for locale %s\n", mtype->name, locale_name(lang));
- }
- if (lang && found && found->lang != lang) {
- log_warning("could not find nr-type %s for locale %s, using %s\n", mtype->name, locale_name(lang), locale_name(found->lang));
+ log_warning("could not find nr-type %s\n", mtype->name);
}
return found;
}
@@ -100,12 +88,11 @@ const nrsection *section_add(const char *name)
}
void
-nrt_register(const struct message_type *mtype, const struct locale *lang,
-const char *string, int level, const char *section)
+nrt_register(const struct message_type *mtype, const char *section)
{
unsigned int hash = mtype->key % NRT_MAXHASH;
nrmessage_type *nrt = nrtypes[hash];
- while (nrt && (nrt->lang != lang || nrt->mtype != mtype)) {
+ while (nrt && nrt->mtype != mtype) {
nrt = nrt->next;
}
if (nrt) {
@@ -117,10 +104,8 @@ const char *string, int level, const char *section)
char zNames[256];
char *c = zNames;
nrt = malloc(sizeof(nrmessage_type));
- nrt->lang = lang;
nrt->mtype = mtype;
nrt->next = nrtypes[hash];
- nrt->level = level;
if (section) {
const nrsection *s = section_find(section);
if (s == NULL) {
@@ -131,8 +116,6 @@ const char *string, int level, const char *section)
else
nrt->section = NULL;
nrtypes[hash] = nrt;
- assert(string && *string);
- nrt->string = str_strdup(string);
*c = '\0';
for (i = 0; i != mtype->nparameters; ++i) {
if (i != 0)
@@ -147,11 +130,11 @@ size_t
nr_render(const struct message *msg, const struct locale *lang, char *buffer,
size_t size, const void *userdata)
{
- struct nrmessage_type *nrt = nrt_find(lang, msg->type);
+ struct nrmessage_type *nrt = nrt_find(msg->type);
if (nrt) {
const char *m =
- translate(nrt_string(nrt), userdata, nrt->vars, msg->parameters);
+ translate(nrt_string(nrt, lang), userdata, nrt->vars, msg->parameters);
if (m) {
return str_strlcpy((char *)buffer, m, size);
}
@@ -164,15 +147,9 @@ size_t size, const void *userdata)
return 0;
}
-int nr_level(const struct message *msg)
-{
- nrmessage_type *nrt = nrt_find(NULL, msg->type);
- return nrt ? nrt->level : 0;
-}
-
const char *nr_section(const struct message *msg)
{
- nrmessage_type *nrt = nrt_find(default_locale, msg->type);
+ nrmessage_type *nrt = nrt_find(msg->type);
return nrt ? nrt->section : NULL;
}
@@ -187,20 +164,8 @@ void free_nrmesssages(void) {
while (nrtypes[i]) {
nrmessage_type *nr = nrtypes[i];
nrtypes[i] = nr->next;
- free(nr->string);
free(nr->vars);
free(nr);
}
}
}
-
-void export_messages(const struct locale * lang, FILE *F, const char *context) {
- 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, context);
- nrt = nrt->next;
- }
- }
-}
diff --git a/src/util/nrmessage.h b/src/util/nrmessage.h
index 7c4201010..abb47551c 100644
--- a/src/util/nrmessage.h
+++ b/src/util/nrmessage.h
@@ -34,21 +34,15 @@ extern "C" {
void free_nrmesssages(void);
- void nrt_register(const struct message_type *mtype,
- const struct locale *lang, const char *script,
- int level, const char *section);
- struct nrmessage_type *nrt_find(const struct locale *,
- const struct message_type *);
- const char *nrt_string(const struct nrmessage_type *type);
- const char *nrt_section(const struct nrmessage_type *mt);
+ void nrt_register(const struct message_type *mtype, const char *section);
+ struct nrmessage_type *nrt_find(const struct message_type *);
+ const char *nrt_string(const struct nrmessage_type *nrt, const struct locale *lang);
+ const char *nrt_section(const struct nrmessage_type *nrt);
size_t nr_render(const struct message *msg, const struct locale *lang,
char *buffer, size_t size, const void *userdata);
- int nr_level(const struct message *msg);
const char *nr_section(const struct message *msg);
- void export_messages(const struct locale * lang, FILE *F, const char *context);
-
#ifdef __cplusplus
}
#endif
diff --git a/src/util/nrmessage_struct.h b/src/util/nrmessage_struct.h
index 57f8e644d..a25a6341a 100644
--- a/src/util/nrmessage_struct.h
+++ b/src/util/nrmessage_struct.h
@@ -7,11 +7,8 @@
typedef struct nrmessage_type {
const struct message_type *mtype;
- const struct locale *lang;
- char *string;
char *vars;
struct nrmessage_type *next;
- int level;
const char *section;
} nrmessage_type;
diff --git a/src/xmlreader.c b/src/xmlreader.c
index afb421ce2..e9b30d060 100644
--- a/src/xmlreader.c
+++ b/src/xmlreader.c
@@ -1368,6 +1368,8 @@ static int parse_messages(xmlDocPtr doc)
if (propSection == NULL)
propSection = BAD_CAST default_section;
+ nrt_register(mtype, (const char *)propSection);
+
/* strings */
xpath->node = node;
result = xmlXPathEvalExpression(BAD_CAST "text", xpath);
@@ -1380,8 +1382,7 @@ static int parse_messages(xmlDocPtr doc)
xml_readtext(node, &lang, &propText);
if (lang) {
xml_cleanup_string(propText);
- nrt_register(mtype, lang, (const char *)propText, 0,
- (const char *)propSection);
+ locale_setstring(lang, mtype->name, (const char *)propText);
}
xmlFree(propText);