"Unbenannter Effekt (Mahlstrom?)"
- made the quotes around messages in XML optional by parsing as string if there is no leading quote.
This commit is contained in:
Enno Rehling 2008-06-17 08:41:17 +00:00
parent 13e7e640fb
commit ce6fbde53e
3 changed files with 13 additions and 8 deletions

View File

@ -131,7 +131,6 @@ nrt_register(const struct message_type * mtype, const struct locale * lang, cons
c+= strlen(strcpy(c, mtype->pnames[i])); c+= strlen(strcpy(c, mtype->pnames[i]));
} }
nrt->vars = strdup(zNames); nrt->vars = strdup(zNames);
/* TODO: really necessary to strdup them all? here? better to extend the caller? hash? */
} }
} }

View File

@ -383,10 +383,17 @@ translate(const char* format, const void * userdata, const char* vars, variant a
} }
} }
if (parse(&stack, format, userdata)==NULL) return NULL; if (format[0]=='"') {
rv = (const char*)opop(&stack).v; rv = parse(&stack, format, userdata);
free(stack->begin); }
free(stack); else {
rv = parse_string(&stack, format, userdata);
}
if (rv!=NULL) {
rv = (const char*)opop(&stack).v;
free(stack->begin);
free(stack);
}
return rv; return rv;
} }

View File

@ -1967,9 +1967,8 @@
<arg name="mage" type="unit"/> <arg name="mage" type="unit"/>
<arg name="amount" type="int"/> <arg name="amount" type="int"/>
</type> </type>
<text locale="de">"$if($isnull($mage),"Ein unentdeckter Magier",$unit($mage)) erschuf einen heiligen Hain von $int($amount) Schößlingen."</text> <text locale="de">$if($isnull($mage),"Ein unentdeckter Magier",$unit($mage)) erschuf einen heiligen Hain von $int($amount) Schößlingen.</text>
<text locale="fr">$if($isnull($mage),"An unknown magician ",$unit($mage)) created a holy forest of $int($amount) young trees."</text> <text locale="en">$if($isnull($mage),"An unknown magician ",$unit($mage)) created a holy forest of $int($amount) young trees.</text>
<text locale="en">$if($isnull($mage),"An unknown magician ",$unit($mage)) created a holy forest of $int($amount) young trees."</text>
</message> </message>
<message name="harvest_effect" section="magic"> <message name="harvest_effect" section="magic">
<type> <type>