forked from github/server
simplified sue of localized parameter-strings in messages
This commit is contained in:
parent
b5d6b0876e
commit
5ca0e5cd8a
|
@ -1110,7 +1110,8 @@ recruit_archetype(unit * u, order * ord)
|
|||
if (a==NULL) a = a_add(&u->building->attribs, a_new(&at_recruit));
|
||||
a->data.i += n*arch->size;
|
||||
}
|
||||
ADDMSG(&u->faction->msgs, msg_message("recruit_archetype", "unit archetype", u, arch->name));
|
||||
ADDMSG(&u->faction->msgs, msg_message("recruit_archetype",
|
||||
"unit amount archetype", u, n, arch->name));
|
||||
return n;
|
||||
} else switch(n) {
|
||||
case ENOMATERIALS:
|
||||
|
|
|
@ -757,7 +757,7 @@ static void
|
|||
eval_trail(struct opstack ** stack, const void * userdata) /* (int, int) -> int */
|
||||
{
|
||||
const struct faction * f = (const struct faction *)userdata;
|
||||
const struct locale * lang = (const struct locale*)opop(stack).v;
|
||||
const struct locale * lang = f?f->locale:default_locale;
|
||||
const struct region * r = (const struct region*)opop(stack).v;
|
||||
const char * trail = trailinto(r, lang);
|
||||
const char * rn = f_regionid_s(r, f);
|
||||
|
|
|
@ -454,20 +454,11 @@ eval_int(opstack ** stack, const void * userdata)
|
|||
static void
|
||||
eval_localize(opstack ** stack, const void * userdata) /* (string, locale) -> string */
|
||||
{
|
||||
const struct locale *lang = (const struct locale *)opop_v(stack);
|
||||
const struct faction * f = (const struct faction *)userdata;
|
||||
const struct locale *lang = f?f->locale:default_locale;
|
||||
const char *c = (const char *)opop_v(stack);
|
||||
c = locale_string(lang, c);
|
||||
opush_v(stack, strcpy(balloc(strlen(c)+1), c));
|
||||
unused(userdata);
|
||||
}
|
||||
|
||||
static void
|
||||
eval_locale(opstack ** stack, const void * userdata) /* (string) -> locale */
|
||||
{
|
||||
const char *c = (const char *)opop_v(stack);
|
||||
struct locale * lang = find_locale(c);
|
||||
opush_v(stack, lang);
|
||||
unused(userdata);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -481,7 +472,6 @@ translation_init(void)
|
|||
add_function("if", &eval_if);
|
||||
add_function("isnull", &eval_isnull);
|
||||
add_function("localize", &eval_localize);
|
||||
add_function("locale", &eval_locale);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -714,9 +714,8 @@
|
|||
<type>
|
||||
<arg name="region" type="region"/>
|
||||
</type>
|
||||
<text locale="de">$trail($region,$locale("de"))</text>
|
||||
<text locale="fr">$trail($region,$locale("en"))</text>
|
||||
<text locale="en">$trail($region,$locale("en"))</text>
|
||||
<text locale="de">$trail($region)</text>
|
||||
<text locale="en">$trail($region)</text>
|
||||
</message>
|
||||
<message name="nr_migrants" section="nr">
|
||||
<type>
|
||||
|
@ -814,9 +813,8 @@
|
|||
<arg name="dir" type="int"/>
|
||||
<arg name="region" type="region"/>
|
||||
</type>
|
||||
<text locale="de">"Im $direction($dir) der Region liegt $trail($region,$locale("de"))"</text>
|
||||
<text locale="fr">"To the $direction($dir) lies $trail($region,$locale("en"))"</text>
|
||||
<text locale="en">"To the $direction($dir) lies $trail($region,$locale("en"))"</text>
|
||||
<text locale="de">"Im $direction($dir) der Region liegt $trail($region)"</text>
|
||||
<text locale="en">"To the $direction($dir) lies $trail($region)"</text>
|
||||
</message>
|
||||
<message name="nr_market_price" section="nr">
|
||||
<type>
|
||||
|
@ -2704,8 +2702,8 @@
|
|||
<arg name="herb" type="resource"/>
|
||||
<arg name="region" type="region"/>
|
||||
</type>
|
||||
<text locale="de">"$unit($unit) in $region($region) stellt fest, dass es hier $localize($amount,$locale("de")) $resource($herb,$amount) gibt."</text>
|
||||
<text locale="en">"$unit($unit) discovers that $localize($amount,$locale("en")) $resource($herb,$amount) grow in $region($region)."</text>
|
||||
<text locale="de">"$unit($unit) in $region($region) stellt fest, dass es hier $localize($amount) $resource($herb,0) gibt."</text>
|
||||
<text locale="en">"$unit($unit) discovers that $localize($amount) $resource($herb,0) grow in $region($region)."</text>
|
||||
</message>
|
||||
<message name="destroy_partial" section="events">
|
||||
<type>
|
||||
|
@ -7266,4 +7264,14 @@
|
|||
<text locale="en">"A message from $unit($unit): '$message'"</text>
|
||||
</message>
|
||||
|
||||
<message name="recruit_archetype" section="events">
|
||||
<type>
|
||||
<arg name="unit" type="unit"/>
|
||||
<arg name="archetype" type="string"/>
|
||||
<arg name="amount" type="int"/>
|
||||
</type>
|
||||
<text locale="de">"$unit($unit) rekrutiert $int($amount) $localize($archetype)."</text>
|
||||
<text locale="en">"$unit($unit) recruits $int($amount) $localize($archetype)."</text>
|
||||
</message>
|
||||
|
||||
</messages>
|
||||
|
|
Loading…
Reference in New Issue