quickfix falsch sortierte messages.

This commit is contained in:
Enno Rehling 2001-05-20 08:41:11 +00:00
parent ef32a52524
commit 9e49e7ef47
11 changed files with 19 additions and 17 deletions

View File

@ -194,7 +194,7 @@ print_curses(FILE * F, void * obj, typ_t typ, attrib *a, int self)
header = 1; header = 1;
fputs("EFFECTS\n", F); fputs("EFFECTS\n", F);
} }
fprintf(F, "\"%d %s\"\n", data->value, add_translation(key, locale_string(NULL, key))); fprintf(F, "\"%d %s\"\n", data->value, add_translation(key, locale_string(default_locale, key)));
} }
a = a->next; a = a->next;
} }

View File

@ -1682,13 +1682,13 @@ attack_message(const troop at, const troop dt, const weapon * wp, int dist)
if (dist > 1) { if (dist > 1) {
sprintf(smallbuf, "%s schießt mit %s auf %s", sprintf(smallbuf, "%s schießt mit %s auf %s",
a_unit, a_unit,
locale_string(NULL, resourcename(wp->type->itype->rtype, GR_INDEFINITE_ARTICLE)), d_unit); locale_string(default_locale, resourcename(wp->type->itype->rtype, GR_INDEFINITE_ARTICLE)), d_unit);
return smallbuf; return smallbuf;
} }
sprintf(smallbuf, "%s schlägt mit %s nach %s", sprintf(smallbuf, "%s schlägt mit %s nach %s",
a_unit, a_unit,
locale_string(NULL, resourcename(wp->type->itype->rtype, GR_INDEFINITE_ARTICLE)), d_unit); locale_string(default_locale, resourcename(wp->type->itype->rtype, GR_INDEFINITE_ARTICLE)), d_unit);
return smallbuf; return smallbuf;
} }
@ -1731,11 +1731,11 @@ hits(troop at, troop dt, weapon * awp)
sprintf(debugbuf, "%.4s/%d [%6s/%d] attackiert %.4s/%d [%6s/%d] mit %d dist %d", sprintf(debugbuf, "%.4s/%d [%6s/%d] attackiert %.4s/%d [%6s/%d] mit %d dist %d",
unitid(au), at.index, unitid(au), at.index,
(awp != NULL) ? (awp != NULL) ?
locale_string(NULL, resourcename(awp->type->itype->rtype, 0)) : "unbewaffnet", locale_string(default_locale, resourcename(awp->type->itype->rtype, 0)) : "unbewaffnet",
weapon_effskill(at, dt, awp, true, dist>1), weapon_effskill(at, dt, awp, true, dist>1),
unitid(du), dt.index, unitid(du), dt.index,
(dwp != NULL) ? (dwp != NULL) ?
locale_string(NULL, resourcename(dwp->type->itype->rtype, 0)) : "unbewaffnet", locale_string(default_locale, resourcename(dwp->type->itype->rtype, 0)) : "unbewaffnet",
weapon_effskill(dt, at, dwp, true, dist>1), weapon_effskill(dt, at, dwp, true, dist>1),
skdiff, dist); skdiff, dist);
if (b->small) { if (b->small) {
@ -2494,7 +2494,7 @@ aftermath(battle * b)
for (l=df->loot; l; l=l->next) { for (l=df->loot; l; l=l->next) {
const item_type * itype = l->type; const item_type * itype = l->type;
sprintf(buf, "%s erbeute%s %d %s.", unitname(du), du->number==1?"t":"n", sprintf(buf, "%s erbeute%s %d %s.", unitname(du), du->number==1?"t":"n",
l->number, locale_string(NULL, resourcename(itype->rtype, l->number!=1))); l->number, locale_string(default_locale, resourcename(itype->rtype, l->number!=1)));
fbattlerecord(du->faction, r, buf); fbattlerecord(du->faction, r, buf);
i_change(&du->items, itype, l->number); i_change(&du->items, itype, l->number);
} }

View File

@ -1340,7 +1340,7 @@ sp_reanimate(fighter * fi, int level, int force, spell * sp)
} }
if (get_item(mage, I_AMULET_OF_HEALING) > 0) { if (get_item(mage, I_AMULET_OF_HEALING) > 0) {
scat(" und benutzt das "); scat(" und benutzt das ");
scat(locale_string(NULL, resourcename(oldresourcetype[R_AMULET_OF_HEALING], 0))); scat(locale_string(default_locale, resourcename(oldresourcetype[R_AMULET_OF_HEALING], 0)));
scat(", um den Zauber zu verstärken"); scat(", um den Zauber zu verstärken");
k *= 2; k *= 2;
c += 0.10; c += 0.10;
@ -1421,7 +1421,7 @@ sp_healing(fighter * fi, int level, int force, spell * sp)
if (get_item(mage, I_AMULET_OF_HEALING) > 0) { if (get_item(mage, I_AMULET_OF_HEALING) > 0) {
scat(" und benutzt das "); scat(" und benutzt das ");
scat(locale_string(NULL, resourcename(oldresourcetype[R_AMULET_OF_HEALING], 0))); scat(locale_string(default_locale, resourcename(oldresourcetype[R_AMULET_OF_HEALING], 0)));
scat(", um die Heilzauber zu verstärken"); scat(", um die Heilzauber zu verstärken");
healhp *= 2; healhp *= 2;
} }

View File

@ -1631,9 +1631,9 @@ sail(region * starting_point, unit * u, region * next_point, boolean move_on_lan
icat(trans->number); icat(trans->number);
scat(" "); scat(" ");
if (itm->number == 1) { if (itm->number == 1) {
scat(locale_string(NULL, resourcename(itm->type->rtype, 0))); scat(locale_string(default_locale, resourcename(itm->type->rtype, 0)));
} else { } else {
scat(locale_string(NULL, resourcename(itm->type->rtype, NMF_PLURAL))); scat(locale_string(default_locale, resourcename(itm->type->rtype, NMF_PLURAL)));
} }
} }
scat(" von der "); scat(" von der ");

View File

@ -932,6 +932,7 @@ r_addmessage(struct region * r, const struct faction * viewer, struct message *
if (imsg==NULL) { if (imsg==NULL) {
imsg = malloc(sizeof(struct individual_message)); imsg = malloc(sizeof(struct individual_message));
imsg->next = r->individual_messages; imsg->next = r->individual_messages;
imsg->msgs = NULL;
r->individual_messages = imsg; r->individual_messages = imsg;
imsg->viewer = viewer; imsg->viewer = viewer;
} }

View File

@ -420,7 +420,7 @@ caldera_handle(trigger * t, void * data)
while (*ip) { while (*ip) {
item * i = *ip; item * i = *ip;
char zText[10]; char zText[10];
sprintf(zText, " %d %s", i->number, locale_string(NULL, resourcename(i->type->rtype, i->number!=1))); sprintf(zText, " %d %s", i->number, locale_string(default_locale, resourcename(i->type->rtype, i->number!=1)));
strcat(buf, zText); strcat(buf, zText);
i_remove(ip, i); i_remove(ip, i);
if (*ip==i) ip=&i->next; if (*ip==i) ip=&i->next;

View File

@ -38,8 +38,8 @@ struct locale {
} * strings[SMAXHASH]; } * strings[SMAXHASH];
}; };
locale * default_locale;
static locale * locales; static locale * locales;
static locale * default_locale;
unsigned int unsigned int
locale_hashkey(const locale * lang) locale_hashkey(const locale * lang)

View File

@ -33,4 +33,6 @@ extern void debug_language(const char * log);
#define LOC(s,l) locale_string(s, l) #define LOC(s,l) locale_string(s, l)
extern locale * default_locale;
#endif #endif

View File

@ -17,6 +17,7 @@
/* util includes */ /* util includes */
#include "log.h" #include "log.h"
#include "message.h" #include "message.h"
#include "language.h"
#include "translation.h" #include "translation.h"
/* libc includes */ /* libc includes */
@ -116,6 +117,6 @@ nr_level(const struct message *msg)
const char * const char *
nr_section(const struct message *msg) nr_section(const struct message *msg)
{ {
nrmessage_type * nrt = nrt_find(NULL, msg->type); nrmessage_type * nrt = nrt_find(default_locale, msg->type);
return nrt->section; return nrt->section;
} }

View File

@ -4059,7 +4059,7 @@
</nr> </nr>
</locale> </locale>
<locale name="en"> <locale name="en">
<nr section="none"> <nr section="events">
<text>"$unit($unit) loses $int($dead) of $int($add($live,$dead)) people due to starvation in $region($region)."</text> <text>"$unit($unit) loses $int($dead) of $int($add($live,$dead)) people due to starvation in $region($region)."</text>
</nr> </nr>
</locale> </locale>
@ -5148,7 +5148,7 @@
</nr> </nr>
</locale> </locale>
<locale name="en"> <locale name="en">
<nr section="none"> <nr section="economy">
<text>"$unit($unit) earns $int($amount)$if($eq($wanted,$amount),""," of $int($wanted)") in $region($region)."</text> <text>"$unit($unit) earns $int($amount)$if($eq($wanted,$amount),""," of $int($wanted)") in $region($region)."</text>
</nr> </nr>
</locale> </locale>

View File

@ -74,8 +74,6 @@ unknownunit;de;eine unbekannte Einheit
## Meldungssektionen ## Meldungssektionen
section_events;de;Meldungen und Ereignisse section_events;de;Meldungen und Ereignisse
section_errors;de;Warnungen und Fehler section_errors;de;Warnungen und Fehler
section_event_p;de;Meldungen und Ereignisse
section_error_p;de;Warnungen und Fehler
section_economy;de;Wirtschaft und Handel section_economy;de;Wirtschaft und Handel
section_production;de;Rohstoffe und Produktion section_production;de;Rohstoffe und Produktion
section_magic;de;Magie und Artefakte section_magic;de;Magie und Artefakte