dev-version:

- STRINGS
  Angefangen mit Strings für die NR-Generierung. Haben alle einene nr_ prefix.
  Verschiedene Pluralformen gefixt.

- LOKALISIERUNG
  #define LOC(s, l) locale_tring(s, l) -- kürzer und schöner.
  argument-typ der donation-message gefixt
This commit is contained in:
Enno Rehling 2001-04-22 05:36:50 +00:00
parent 4c07cd9be0
commit 1830bedd47
19 changed files with 307 additions and 274 deletions

View File

@ -127,7 +127,7 @@ write_translations(FILE * F)
for (i=0;i!=TRANSMAXHASH;++i) {
translation * t = translation_table[i];
while (t) {
fprintf(F, "\"%s\";%s\n", t->value, t->key);
fprintf(F, "\"%s\";%s\n", t->value, crtag(t->key));
t = t->next;
}
}
@ -333,6 +333,7 @@ static void
report_crtypes(FILE * F, const struct locale* lang)
{
int i;
#ifdef OLD_MESSAGETYPES
fputs("MESSAGETYPES\n", F);
for (i=0;i!=MTMAXHASH;++i) {
struct known_mtype * kmt;
@ -351,6 +352,26 @@ report_crtypes(FILE * F, const struct locale* lang)
free(kmt);
}
}
#else
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);
if (nrt) {
unsigned int hash = hashstring(mt_name(kmt->mtype));
fprintf(F, "MESSAGETYPE %d\n", hash);
fputc('\"', F);
fputs(escape_string(nrt_string(nrt), NULL, 0), F);
fputs("\";text\n", F);
}
}
while (mtypehash[i]) {
kmt = mtypehash[i];
mtypehash[i] = mtypehash[i]->nexthash;
free(kmt);
}
}
#endif
}
static void
@ -690,7 +711,7 @@ cr_output_unit(FILE * F, region * r,
pr = 1;
fputs("GEGENSTAENDE\n", F);
}
fprintf(F, "%d;%s\n", in, locale_string(NULL, ic));
fprintf(F, "%d;%s\n", in, add_translation(ic, locale_string(f->locale, ic)));
}
if ((u->faction == f || omniscient(f)) && u->botschaften)

View File

@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /Za /W4 /GX /Z7 /O2 /I "../kernel" /I "../util" /I "../.." /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /Za /W4 /GX /Z7 /O2 /I "../util" /I "../kernel" /I "../.." /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD BASE RSC /l 0x407
# ADD RSC /l 0x407
BSC32=bscmake.exe

View File

@ -165,33 +165,24 @@ read_datenames(const char *filename)
}
char *
gamedate(void)
gamedate(const struct locale * lang)
{
int year,month,week,r;
static char buf[256];
int t = turn - FIRST_TURN;
if (t<0) t = turn;
assert(lang);
year = t/(months_per_year * weeks_per_month) + 1;
r = t - (year-1) * months_per_year * weeks_per_month;
month = r/weeks_per_month;
week = r%weeks_per_month;
if (turn>=FIRST_TURN) {
sprintf(buf, "Wir schreiben %s des Monats %s im Jahre %d %s.",
weeknames[week],
monthnames[month],
year,
agename);
} else {
sprintf(buf, "Wir schreiben %s des Monats %s im Jahre %d %s.",
weeknames[week],
monthnames[month],
year,
"der alten Zeitrechnung");
}
sprintf(buf, LOC(lang, "nr_calendar"),
weeknames[week],
monthnames[month],
year,
agename);
return buf;
}
@ -209,20 +200,11 @@ gamedate2(void)
r = t - (year-1) * months_per_year * weeks_per_month;
month = r/weeks_per_month; /* 0 - months_per_year-1 */
week = r%weeks_per_month; /* 0 - weeks_per_month-1 */
if (turn>=FIRST_TURN) {
sprintf(buf, "in %s des Monats %s im Jahre %d %s.",
weeknames2[week],
monthnames[month],
year,
agename);
} else {
sprintf(buf, "in %s des Monats %s im Jahre %d %s.",
weeknames2[week],
monthnames[month],
year,
"der alten Zeitrechnung");
}
sprintf(buf, "in %s des Monats %s im Jahre %d %s.",
weeknames2[week],
monthnames[month],
year,
agename);
return buf;
}
@ -653,7 +635,7 @@ print_curses(FILE *F, const void * obj, typ_t typ, const attrib *a, int self, in
(data->value==1 ? "t" : "en"),
data->value,
(data->value==1 ? "" : "en"),
locale_string(NULL, resourcename(data->type->itype->rtype, 0)));
LOC(NULL, resourcename(data->type->itype->rtype, 0)));
rnl(F);
rparagraph(F, buf, indent, 0);
}
@ -743,7 +725,7 @@ rp_messages(FILE * F, message_list * msgs, faction * viewer, int indent, boolean
char cat_identifier[24];
sprintf(cat_identifier, "section_%s", category->name);
name = locale_string(viewer->locale, cat_identifier);
name = LOC(viewer->locale, cat_identifier);
if (debug) {
if (name!=buf) strcpy(buf, name);
sprintf(buf+strlen(name), " [%s]", cat_identifier);
@ -819,14 +801,14 @@ prices(FILE * F, region * r, faction * f)
assert(sale!=NULL);
sprintf(buf, "Auf dem Markt wird für %s %d Silber verlangt.",
locale_string(f->locale, resourcename(sale->itype->rtype, GR_PLURAL)),
LOC(f->locale, resourcename(sale->itype->rtype, GR_PLURAL)),
sale->price);
if(n > 0) scat(" Geboten wird für ");
for (dmd=r->land->demands;dmd;dmd=dmd->next) if(dmd->value > 0) {
char sbuf[80];
sprintf(sbuf, "%s %d Silber", locale_string(f->locale,
sprintf(sbuf, "%s %d Silber", LOC(f->locale,
resourcename(dmd->type->itype->rtype, GR_PLURAL)),
dmd->value * dmd->type->price);
scat(sbuf);
@ -937,7 +919,7 @@ describe(FILE * F, region * r, int partial, faction * f)
if (r_isforest(r)) tname = "forest";
else tname = terrain[rterrain(r)].name;
}
scat(locale_string(f->locale, tname));
scat(LOC(f->locale, tname));
/* Bäume */
@ -1009,7 +991,7 @@ describe(FILE * F, region * r, int partial, faction * f)
icat(rhorses(r));
scat(" ");
#ifdef NEW_ITEMS
scat(locale_string(f->locale, resourcename(oldresourcetype[R_HORSE], (rhorses(r)>1)?GR_PLURAL:0)));
scat(LOC(f->locale, resourcename(oldresourcetype[R_HORSE], (rhorses(r)>1)?GR_PLURAL:0)));
#else
scat(itemdata[I_HORSE].name[rhorses(r) > 1]);
#endif
@ -1049,7 +1031,7 @@ describe(FILE * F, region * r, int partial, faction * f)
else scat(", im ");
}
else scat(" Im ");
scat(locale_string(f->locale, directions[d]));
scat(LOC(f->locale, directions[d]));
scat(" ");
if (!dh) scat("der Region liegt ");
sprintf(dbuf, trailinto(r2, f->locale),
@ -1122,7 +1104,7 @@ describe(FILE * F, region * r, int partial, faction * f)
if (e->lastd==d) strcat(buf, " und im ");
else strcat(buf, ", im ");
}
strcat(buf, locale_string(f->locale, directions[d]));
strcat(buf, LOC(f->locale, directions[d]));
first = false;
}
if (!e->transparent) strcat(buf, " versperrt ");
@ -1196,7 +1178,7 @@ statistics(FILE * F, region * r, faction * f)
sprintf(buf, "Personen: %d", number);
rps(F, buf);
for (itm = items; itm; itm=itm->next) {
sprintf(buf, "%s: %d", locale_string(f->locale, resourcename(itm->type->rtype, GR_PLURAL)), itm->number);
sprintf(buf, "%s: %d", LOC(f->locale, resourcename(itm->type->rtype, GR_PLURAL)), itm->number);
rps(F, buf);
}
while (items) i_free(i_remove(&items, items));
@ -1293,7 +1275,7 @@ order_template(FILE * F, faction * f)
rps_nowrap(F, "");
rnl(F);
sprintf(buf, "%s %s \"hier_passwort_eintragen\"", locale_string(f->locale, parameters[P_FACTION]), factionid(f));
sprintf(buf, "%s %s \"hier_passwort_eintragen\"", LOC(f->locale, parameters[P_FACTION]), factionid(f));
rps_nowrap(F, buf);
rnl(F);
@ -1316,12 +1298,12 @@ order_template(FILE * F, faction * f)
rnl(F);
pl = getplane(r);
if (pl && fval(pl, PFL_NOCOORDS)) {
sprintf(buf, "%s; %s", locale_string(f->locale, parameters[P_REGION]), rname(r, f->locale));
sprintf(buf, "%s; %s", LOC(f->locale, parameters[P_REGION]), rname(r, f->locale));
} else if (pl && pl->id != 0) {
sprintf(buf, "%s %d,%d,%d ; %s", locale_string(f->locale, parameters[P_REGION]), region_x(r,f),
sprintf(buf, "%s %d,%d,%d ; %s", LOC(f->locale, parameters[P_REGION]), region_x(r,f),
region_y(r,f), pl->id, rname(r, f->locale));
} else {
sprintf(buf, "%s %d,%d ; %s", locale_string(f->locale, parameters[P_REGION]), region_x(r,f),
sprintf(buf, "%s %d,%d ; %s", LOC(f->locale, parameters[P_REGION]), region_x(r,f),
region_y(r,f), rname(r, f->locale));
}
rps_nowrap(F, buf);
@ -1334,7 +1316,7 @@ order_template(FILE * F, faction * f)
}
dh = 1;
sprintf(buf, "%s %s; %s [%d,%d$", locale_string(u->faction->locale, parameters[P_UNIT]),
sprintf(buf, "%s %s; %s [%d,%d$", LOC(u->faction->locale, parameters[P_UNIT]),
unitid(u), u->name, u->number, get_money(u));
if (u->building != NULL && fval(u, FL_OWNER)) {
building * b = u->building;
@ -1382,7 +1364,7 @@ order_template(FILE * F, faction * f)
}
rps_nowrap(F, "");
rnl(F);
sprintf(buf, locale_string(f->locale, parameters[P_NEXT]));
sprintf(buf, LOC(f->locale, parameters[P_NEXT]));
rps_nowrap(F, buf);
rnl(F);
}
@ -1571,7 +1553,7 @@ list_address(FILE * F, faction * uf)
}
v_sort(fcts->begin, fcts->end, fcompare);
centre(F, "Liste aller Adressen", false);
centre(F, LOC(uf->locale, "nr_addresses"), false);
rnl(F);
for (fp = fcts->begin; fp != fcts->end; ++fp) {
f = *fp;
@ -1600,7 +1582,8 @@ report_building(FILE *F, const region * r, const building * b, const faction * f
type = b->type;
}
sprintf(buf, "%s, Größe %d, %s", buildingname(b), b->size, buildingtype(b, b->size, lang));
sprintf(buf, "%s, %s %d, %s", buildingname(b), LOC(f->locale, "nr_size"),
b->size, buildingtype(b, b->size, lang));
if (b->size < type->maxsize) {
scat(" (im Bau)");
}
@ -1682,9 +1665,9 @@ report(FILE *F, faction * f)
else
printf(" - Schreibe Report\n");
centre(F, gamedate(), true);
centre(F, gamedate(f->locale), true);
rnl(F);
sprintf(buf, "%s, %s/%s (%s)", factionname(f), locale_string(f->locale, race[f->race].name[1]),
sprintf(buf, "%s, %s/%s (%s)", factionname(f), LOC(f->locale, race[f->race].name[1]),
neue_gebiete[f->magiegebiet], f->email);
centre(F, buf, true);
@ -1777,11 +1760,11 @@ report(FILE *F, faction * f)
}
}
sprintf(buf, "Optionen:");
sprintf(buf, "%s:", LOC(f->locale, "nr_options"));
for (op = 0; op != MAXOPTIONS; op++) {
if (f->options & (int) pow(2, op)) {
scat(" ");
scat(options[op]);
scat(LOC(f->locale, options[op]));
#ifdef AT_OPTION
if(op == O_NEWS) {
attrib *a = a_find(f->attribs, &at_option_news);
@ -1817,7 +1800,7 @@ report(FILE *F, faction * f)
if(f->battles) {
struct bmsg * bm;
rnl(F);
centre(F, "Kämpfe", false);
centre(F, LOC(f->locale, "section_battle"), false);
rnl(F);
for (bm=f->battles;bm;bm=bm->next) {
#ifdef HAVE_SNPRINTF
@ -1837,14 +1820,13 @@ report(FILE *F, faction * f)
a = a_find(f->attribs, &at_reportspell);
if (a) {
rnl(F);
centre(F, "Neue Zauber", true);
centre(F, LOC(f->locale, "section_newspells"), true);
while (a) {
report_spell(F, (spellid_t)a->data.i);
a = a->nexttype;
}
}
#ifdef NEW_ITEMS
ch = 0;
for (a=a_find(f->attribs, &at_showitem);a;a=a->nexttype) {
const potion_type * ptype = resource2potion(((const item_type*)a->data.v)->rtype);
@ -1853,18 +1835,18 @@ report(FILE *F, faction * f)
m = ptype->itype->construction->materials;
if (ch==0) {
rnl(F);
centre(F, "Erforschte Tränke", true);
centre(F, LOC(f->locale, "section_newpotions"), true);
ch = 1;
}
rnl(F);
centre(F, locale_string(f->locale, resourcename(ptype->itype->rtype, 0)), true);
sprintf(buf, "Stufe %d", ptype->level);
centre(F, LOC(f->locale, resourcename(ptype->itype->rtype, 0)), true);
sprintf(buf, "%s %d", LOC(f->locale, "nr_level"), ptype->level);
centre(F, buf, true);
rnl(F);
sprintf(buf, "Benötigte Kräuter: ");
sprintf(buf, "%s: ", LOC(f->locale, "nr_herbsrequired"));
while (m->number) {
scat(locale_string(f->locale, resourcename(oldresourcetype[m->type], 0)));
scat(LOC(f->locale, resourcename(oldresourcetype[m->type], 0)));
++m;
if (m->number) scat(", ");
}
@ -1872,47 +1854,8 @@ report(FILE *F, faction * f)
rnl(F);
centre(F, ptype->text, true);
}
#else
for (potion = 0; potion != MAXPOTIONS; potion++)
if (f->showpotion[potion] == 1)
break;
if (potion != MAXPOTIONS) {
rnl(F);
centre(F, "Erforschte Tränke", true);
for (potion = 0; potion != MAXPOTIONS; ++potion) {
if (f->showpotion[potion] == 1) {
int h;
rnl(F);
centre(F, potionnames[0][potion], true);
sprintf(buf, "Stufe %d", potionlevel[potion]);
centre(F, buf, true);
rnl(F);
sprintf(buf, "Benötigte Kräuter: ");
for (h = 0; h < MAXHERBSPERPOTION; h++) {
if (potionherbs[potion][h] == NOHERB)
break;
if (h > 0) {
scat(", ");
}
scat(herbdata[0][potionherbs[potion][h]]);
}
centre(F, buf, true);
rnl(F);
centre(F, (char *) potiontext[potion], true);
/* Nicht nochmal anzeigen! */
f->showpotion[potion] = 2;
}
}
}
#endif
rnl(F);
centre(F, "Aktueller Status", false);
centre(F, LOC(f->locale, "nr_alliances"), false);
rnl(F);
allies(F, f);
@ -2034,31 +1977,29 @@ report(FILE *F, faction * f)
}
sprintf(buf, "%s, %s, (%d/%d)",
shipname(sh),
locale_string(f->locale, sh->type->name[0]),
LOC(f->locale, sh->type->name[0]),
(w + 99) / 100, /* +99 weil sonst die Nachkommastellen ignoriert würden */
shipcapacity(sh) / 100);
} else {
sprintf(buf, "%s, %s", shipname(sh),
locale_string(f->locale, sh->type->name[0]));
LOC(f->locale, sh->type->name[0]));
}
assert(sh->type->construction->improvement==NULL); /* sonst ist construction::size nicht ship_type::maxsize */
if (sh->size!=sh->type->construction->maxsize) {
scat(", im Bau (");
icat(sh->size);
scat("/");
icat(sh->type->construction->maxsize);
scat(")");
sprintf(buf+strlen(buf), ", %s (%d/%d)",
LOC(f->locale, "nr_undercons"), sh->size,
sh->type->construction->maxsize);
}
if (sh->damage) {
scat(", ");
icat(sh->damage*100/(sh->size*DAMAGE_SCALE));
scat("% beschädigt");
sprintf(buf+strlen(buf), ", %d%% %s",
sh->damage*100/(sh->size*DAMAGE_SCALE),
LOC(f->locale, "nr_damaged"));
}
if (rterrain(r) != T_OCEAN) {
if (sh->coast != NODIRECTION) {
scat(", ");
scat(coasts[sh->coast]);
scat(LOC(f->locale, coasts[sh->coast]));
}
}
ch = 0;
@ -2097,9 +2038,7 @@ report(FILE *F, faction * f)
if (f->no != MONSTER_FACTION) {
if (!anyunits) {
rnl(F);
rparagraph(F, "Unglücklicherweise wurde deine Partei ausgelöscht. "
"Du kannst gerne an einer anderen Stelle wieder "
"einsteigen. Melde Dich einfach wieder an.", 0, 0);
rparagraph(F, LOC(f->locale, "nr_youaredead"), 0, 0);
} else {
if (wants_addresses) {
list_address(F, f);
@ -3382,7 +3321,7 @@ eval_resource(struct opstack ** stack, const void * userdata)
int j = opop(stack, int);
struct resource_type * res = opop(stack, struct resource_type *);
const char * c = locale_string(report->locale, resourcename(res, j!=1));
const char * c = LOC(report->locale, resourcename(res, j!=1));
opush(stack, strcpy(balloc(strlen(c)+1), c));
}
@ -3393,7 +3332,7 @@ eval_race(struct opstack ** stack, const void * userdata)
int j = opop(stack, int);
int r = opop(stack, int);
const char * c = locale_string(report->locale, race[r].name[j!=1]);
const char * c = LOC(report->locale, race[r].name[j!=1]);
opush(stack, strcpy(balloc(strlen(c)+1), c));
}
@ -3403,7 +3342,7 @@ eval_direction(struct opstack ** stack, const void * userdata)
const faction * report = (const faction*)userdata;
int i = opop(stack, int);
const char * c = locale_string(report->locale, directions[i]);
const char * c = LOC(report->locale, directions[i]);
opush(stack, strcpy(balloc(strlen(c)+1), c));
}

View File

@ -33,8 +33,8 @@ summon_igjarjuk(struct unit * u, const struct item_type * itype, const char * cm
}
static resource_type rt_demonseye = {
{ "ao_daemon", "ao_daemons" },
{ "ao_daemon", "ao_daemons" },
{ "ao_daemon", "ao_daemon_p" },
{ "ao_daemon", "ao_daemon_p" },
RTF_ITEM,
&res_changeitem
};

View File

@ -78,8 +78,8 @@ use_lmsreward(struct unit * u, const struct item_type * itype, const char * cmd)
#endif
static resource_type rt_lmsreward = {
{ "lmsreward", "lmsrewards" },
{ "lmsreward", "lmsrewards" },
{ "lmsreward", "lmsreward_p" },
{ "lmsreward", "lmsreward_p" },
RTF_ITEM,
&res_changeitem
};

View File

@ -278,8 +278,8 @@ init_oldweapons(void)
/** begin mallornspear **/
resource_type rt_mallornspear = {
{ "mallornspear", "mallornspears" },
{ "mallornspear", "mallornspears" },
{ "mallornspear", "mallornspear_p" },
{ "mallornspear", "mallornspear_p" },
RTF_ITEM,
&res_changeitem
};
@ -309,8 +309,8 @@ weapon_type wt_mallornspear = {
/** begin mallornlance **/
resource_type rt_mallornlance = {
{ "mallornlance", "mallornlances" },
{ "mallornlance", "mallornlances" },
{ "mallornlance", "mallornlance_p" },
{ "mallornlance", "mallornlance_p" },
RTF_ITEM,
&res_changeitem
};
@ -340,8 +340,8 @@ weapon_type wt_mallornlance = {
/** begin mallornbow **/
resource_type rt_mallornbow = {
{ "mallornbow", "mallornbows" },
{ "mallornbow", "mallornbows" },
{ "mallornbow", "mallornbow_p" },
{ "mallornbow", "mallornbow_p" },
RTF_ITEM,
&res_changeitem
};
@ -371,8 +371,8 @@ weapon_type wt_mallornbow = {
/** begin mallorncrossbow **/
resource_type rt_mallorncrossbow = {
{ "mallorncrossbow", "mallorncrossbows" },
{ "mallorncrossbow", "mallorncrossbows" },
{ "mallorncrossbow", "mallorncrossbow_p" },
{ "mallorncrossbow", "mallorncrossbow_p" },
RTF_ITEM,
&res_changeitem
};

View File

@ -1263,33 +1263,33 @@ use_olditem(struct unit * user, const struct item_type * itype, const char * cmd
typedef const char* translate_t[5];
static translate_t translation[] = {
{ "Holz", "log", "logs", "log", "logs" },
{ "Eisen", "iron", "irons", "iron", "irons" },
{ "Wagen", "cart", "carts", "cart", "carts" },
{ "Plattenpanzer", "plate", "plates", "plate", "plates" },
{ "Balsam", "balm", "balms", "balm", "balms" },
{ "Gewürz", "spice", "spices", "spice", "spices" },
{ "Myrrhe", "myrrh", "myrrhs", "myrrh", "myrrhs" },
{ "Öl", "oil", "oils", "oil", "oils" },
{ "Seide", "silk", "silks", "silk", "silks" },
{ "Weihrauch", "incense", "incenses", "incense", "incenses" },
{ "Bihänder", "greatsword", "greatswords", "greatsword", "greatswords" },
{ "Laen", "laen", "laens", "laen", "laens" },
{ "Goliathwasser", "p1", "p1s", NULL, NULL },
{ "Wasser des Lebens", "p2", "p2s", NULL, NULL },
{ "Bauernblut", "p5", "p5s", NULL, NULL },
{ "Gehirnschmalz", "p6", "p6s", NULL, NULL },
{ "Nestwärme", "p8", "p8s", NULL, NULL },
{ "Pferdeglück", "p9", "p9s", NULL, NULL },
{ "Berserkerblut", "p10", "p10s", NULL, NULL },
{ "Bauernlieb", "p11", "p11s", NULL, NULL },
{ "Heiltrank", "p14", "p14s", NULL, NULL },
{ "Holz", "log", "log_p", "log", "log_p" },
{ "Eisen", "iron", "iron_p", "iron", "iron_p" },
{ "Wagen", "cart", "cart_p", "cart", "cart_p" },
{ "Plattenpanzer", "plate", "plate_p", "plate", "plate_p" },
{ "Balsam", "balm", "balm_p", "balm", "balm_p" },
{ "Gewürz", "spice", "spice_p", "spice", "spice_p" },
{ "Myrrhe", "myrrh", "myrrh_p", "myrrh", "myrrh_p" },
{ "Öl", "oil", "oil_p", "oil", "oil_p" },
{ "Seide", "silk", "silk_p", "silk", "silk_p" },
{ "Weihrauch", "incense", "incense_p", "incense", "incense_p" },
{ "Bihänder", "greatsword", "greatsword_p", "greatsword", "greatsword_p" },
{ "Laen", "laen", "laen_p", "laen", "laen_p" },
{ "Goliathwasser", "p1", "p1_p", NULL, NULL },
{ "Wasser des Lebens", "p2", "p2_p", NULL, NULL },
{ "Bauernblut", "p5", "p5_p", NULL, NULL },
{ "Gehirnschmalz", "p6", "p6_p", NULL, NULL },
{ "Nestwärme", "p8", "p8_p", NULL, NULL },
{ "Pferdeglück", "p9", "p9_p", NULL, NULL },
{ "Berserkerblut", "p10", "p10_p", NULL, NULL },
{ "Bauernlieb", "p11", "p11_p", NULL, NULL },
{ "Heiltrank", "p14", "p14_p", NULL, NULL },
{ "Flachwurz", "h0", "h0s", NULL, NULL },
{ "Elfenlieb", "h5", "h5s", NULL, NULL },
{ "Wasserfinder", "h9", "h9s", NULL, NULL },
{ "Windbeutel", "h12", "h12s", NULL, NULL },
{ "Steinbeißer", "h15", "h15s", NULL, NULL },
{ "Flachwurz", "h0", "h0_p", NULL, NULL },
{ "Elfenlieb", "h5", "h5_p", NULL, NULL },
{ "Wasserfinder", "h9", "h9_p", NULL, NULL },
{ "Windbeutel", "h12", "h12_p", NULL, NULL },
{ "Steinbeißer", "h15", "h15_p", NULL, NULL },
{ NULL, NULL, NULL, NULL, NULL }
};
@ -1858,7 +1858,7 @@ init_oldpotions(void)
{
potion_t p;
const char * names[2];
const char * appearance[2] = { "vial", "vials" };
const char * appearance[2] = { "vial", "vial_p" };
const struct locale * lang = find_locale("de");
assert(lang);
@ -1946,7 +1946,15 @@ resource_type * r_person;
resource_type * r_silver;
item_type * i_silver;
static const char * names[] = { "money", "moneys", "person", "persons", "permaura", "permauras", "hp", "hps", "peasant", "peasants", "aura", "auras", "unit", "units" };
static const char * names[] = {
"money", "money_p",
"person", "person_p",
"permaura", "permaura_p",
"hp", "hp_p",
"peasant", "peasant_p",
"aura", "aura_p",
"unit", "unit_p"
};
void
init_resources(void)

View File

@ -328,7 +328,7 @@ bufunit(const faction * f, const unit * u, int indent,
scat(", ");
if (!dh) {
scat("hat: ");
sprintf(buf+strlen(buf), "%s: ", LOC(f->locale, "nr_inventory"));
dh = 1;
}
if (in == 1) {
@ -359,7 +359,7 @@ bufunit(const faction * f, const unit * u, int indent,
continue;
}
if (!dh){
scat(", Zauber: ");
sprintf(buf+strlen(buf),", %s: ", LOC(f->locale, "nr_spells"));
dh = 1;
}else{
scat(", ");
@ -376,7 +376,7 @@ bufunit(const faction * f, const unit * u, int indent,
}
if(dh){
dh = 0;
scat(". Kampfzauber: ");
sprintf(buf+strlen(buf),", %s: ", LOC(f->locale, "nr_combatspells"));
for (i = 0; i < MAXCOMBATSPELLS; i++){
if (!dh){
dh = 1;
@ -393,7 +393,7 @@ bufunit(const faction * f, const unit * u, int indent,
scat(")");
}
}else{
scat("keiner");
scat(LOC(f->locale, "nr_nospells"));
}
}
}
@ -437,6 +437,7 @@ bufunit(const faction * f, const unit * u, int indent,
void
spskill(const struct locale * lang, const struct unit * u, skill_t sk, int *dh, int days)
{
char * sbuf = buf+strlen(buf);
int i, d;
if (!u->number)
return;
@ -445,37 +446,32 @@ spskill(const struct locale * lang, const struct unit * u, skill_t sk, int *dh,
if (!d)
return;
scat(", ");
strcat(sbuf, ", "); sbuf+=2;
if (!*dh) {
scat("Talente: ");
sbuf += sprintf(sbuf, "%s: ", LOC(lang, "nr_skills"));
*dh = 1;
}
scat(skillname(sk, lang));
scat(" ");
sbuf += sprintf(sbuf, "%s ", skillname(sk, lang));
if (sk == SK_MAGIC){
if (find_magetype(u) != M_GRAU){
scat(magietypen[find_magetype(u)]);
scat(" ");
sbuf += sprintf(sbuf, "%s ", magietypen[find_magetype(u)]);
}
}
if (sk == SK_STEALTH) {
i = u_geteffstealth(u);
if(i>=0) {
icat(i);
scat("/");
sbuf += sprintf(sbuf, "%d/", i);
}
}
icat(effskill(u, sk));
sbuf += sprintf(sbuf, "%d", effskill(u, sk));
#ifndef NOVISIBLESKILLPOINTS
if (days) {
assert(u->number);
scat(" [");
icat(d / u->number);
scat("]");
sbuf += sprintf(sbuf, " [%d]", d / u->number);
}
#endif
}

View File

@ -43,7 +43,7 @@ extern void spskill(const struct locale * lang, const struct unit * u, skill_t s
extern void spunit(struct strlist ** SP, const struct faction * f, const struct unit * u, int indent, int mode);
void reports(void);
char *gamedate(void);
char *gamedate(const struct locale *);
char *gamedate2(void);
struct summary;

View File

@ -1503,6 +1503,8 @@ wsn(FILE * F, const char *s)
wc(F, *s++);
}
#define whs(F, s) fputs(s, F)
void
ws(FILE * F, const char *s)
{
@ -1529,7 +1531,7 @@ write_items(FILE *F, item *ilist)
{
item * itm;
for (itm=ilist;itm;itm=itm->next) if (itm->number) {
ws(F, resourcename(itm->type->rtype, 0));
whs(F, resourcename(itm->type->rtype, 0));
wspace(F);
wi(F, itm->number);
wspace(F);

View File

@ -103,8 +103,8 @@ leave_arena(struct unit * u, const struct item_type * itype, const char * cmd)
}
static resource_type rt_gryphonwing = {
{ "griphonwing", "griphonwings" },
{ "griphonwing", "griphonwings" },
{ "griphonwing", "griphonwing_p" },
{ "griphonwing", "griphonwing_p" },
RTF_ITEM,
&res_changeitem
};
@ -171,8 +171,8 @@ enter_arena(unit * u, const item_type * itype, const char * cmd)
}
static resource_type rt_arenagate = {
{ "eyeofdragon", "eyeofdragons" },
{ "eyeofdragon", "eyeofdragons" },
{ "eyeofdragon", "eyeofdragon_p" },
{ "eyeofdragon", "eyeofdragon_p" },
RTF_ITEM,
&res_changeitem
};

View File

@ -42,8 +42,8 @@
#include <stdlib.h>
resource_type rt_museumticket = {
{ "museumticket", "museumtickets"},
{ "museumticket", "museumtickets"},
{ "museumticket", "museumticket_p"},
{ "museumticket", "museumticket_p"},
RTF_ITEM,
&res_changeitem
};
@ -57,8 +57,8 @@ item_type it_museumticket = {
};
resource_type rt_museumexitticket = {
{ "museumexitticket", "museumexittickets"},
{ "museumexitticket", "museumexittickets"},
{ "museumexitticket", "museumexitticket_p"},
{ "museumexitticket", "museumexitticket_p"},
RTF_ITEM,
&res_changeitem
};

View File

@ -121,6 +121,7 @@ locale_string(const locale * lang, const char * key)
s = locale_string(default_locale, key);
if (s_debug) {
fprintf(s_debug, "%s;%s;%s\n", key, lang->name, s);
fflush(s_debug);
locale_setstring((struct locale*)lang, key, s);
}
}

View File

@ -30,4 +30,7 @@ extern const char * locale_name(const struct locale * lang);
extern const char * reverse_lookup(const struct locale * lang, const char * str);
extern void debug_language(const char * log);
#define LOC(s,l) locale_string(s, l)
#endif

View File

@ -44,7 +44,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /Za /W4 /GX /Z7 /O2 /I "../common/kernel" /I "../common/gamecode" /I "../common/util" /I "../common" /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /Za /W4 /GX /Z7 /O2 /I ".." /I "../common" /I "../common/util" /I "../common/kernel" /I "../common/gamecode" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x407 /d "NDEBUG"
# ADD RSC /l 0x407 /d "NDEBUG"
BSC32=bscmake.exe

View File

@ -3910,10 +3910,16 @@
<arg name="unit" type="unit"></arg>
<arg name="region" type="region"></arg>
<arg name="dead" type="int"></arg>
<arg name="live" type="int"></arg>
</type>
<locale name="de">
<nr section="events">
<text>"$unit($unit) verliert in $region($region) $int($dead) Personen durch Unterernährung."</text>
<text>"$unit($unit) verliert in $region($region) $int($dead) von $int($add($live,$dead)) Personen durch Unterernährung."</text>
</nr>
</locale>
<locale name="en">
<nr section="none">
<text>"$unit($unit) loses $int($dead) of $int($add($live,$dead)) people due to starvation in $region($region)."</text>
</nr>
</locale>
</message>
@ -3952,7 +3958,7 @@
<type>
<arg name="from" type="unit"></arg>
<arg name="amount" type="int"></arg>
<arg name="to" type="region"></arg>
<arg name="to" type="unit"></arg>
</type>
<locale name="de">
<nr section="events">

View File

@ -1,10 +1,11 @@
## Schiffstypen
Karavelle;de;Karavelle
Boot;de;Boot
Langboot;de;Langboot
Drachenschiff;de;Drachenschiff
Trireme;de;Trireme
# Terraintypen
## Terraintypen
maelstrom;de;Mahlstrom
ocean;de;Ozean
plain;de;Ebene
@ -50,7 +51,7 @@ xmas_exit;de;Pforte
coal;de;Kohlenstück
coal_p;de;Kohlenstücke
# Himmelsrichtungen
## Himmelsrichtungen
west;de;Westen
northwest;de;Nordwesten
northeast;de;Nordosten
@ -65,10 +66,10 @@ dir_SO;de;SO
dir_SW;de;SW
dir_West;de;West
# Verschiedenes
## Verschiedenes
unknownunit;de;eine unbekannte Einheit
# Meldungssektionen
## Meldungssektionen
section_event_p;de;Meldungen und Ereignisse
section_error_p;de;Warnungen und Fehler
section_economy;de;Wirtschaft und Handel
@ -78,8 +79,9 @@ section_movement;de;Reisen und Bewegung
section_study;de;Lehren und Lernen
section_battle;de;Kämpfe
section_none;de;Verschiedenes
section_newspells;de;Neue Zauber
# Gebäudetypen
## Gebäudetypen
fortress_generic;de;Burg
lighthouse;de;Leuchtturm
mine;de;Bergwerk
@ -100,16 +102,16 @@ blessedstonecircle;de;Gesegneter Steinkreis
illusioncastle;de;Traumschlößchen
genericbuilding;de;Struktur
#Testgebäude
## Testgebäude
temple;de;Tempel
#Testitem
## Testitem
wand;de;Zauberstab
wand_p;de;Zauberstäbe
wand_of_tear_p;de;Szepter der Tränen
wands_of_tear_p;de;Szepter der Tränen
# Burgausbaustufen
## Burgausbaustufen
site;de;Grundmauern
fortification;de;Befestigung
tower;de;Turm
@ -117,13 +119,13 @@ castle;de;Burg
fortres_p;de;Festung
citadel;de;Zitadelle
# Items
## Items
herb;de;Kraut
herbbag;de;Kräuterbeutel
vial;de;Phiole
vial_p;de;Phiolen
# Resourcen
## Resourcen
money;de;Silber
money_p;de;Silber
hp;de;Trefferpunkt
@ -139,7 +141,7 @@ unit_p;de;Einheiten
person;de;Person
person_p;de;Personen
#items
## items
runesword;de;Runenschwert
runesword_p;de;Runenschwerter
iron;de;Eisen
@ -166,7 +168,7 @@ bow;de;Bogen
bow_p;de;Bögen
mallornbow;de;Mallornbogen
mallornbow_p;de;Mallornbögen
# more items
## more items
chainmail;de;Kettenhemd
chainmail_p;de;Kettenhemden
plate;de;Plattenpanzer
@ -293,7 +295,7 @@ museumticket_p;de;Eintrittskarten des Gro
museumexitticket;de;Rückkehrticket des Großen Museum
museumexitticket_p;de;Rückkehrtickets des Großen Museum
# herb singular
## herb singular
h0;de;Flachwurz
h1;de;Würziger Wagemut
h2;de;Eulenauge
@ -316,7 +318,7 @@ h18;de;Eisblume
h19;de;Weißer Wüterich
h20;de;Schneekristall
#herb plural
## herb plural
h0_p;de;Flachwurz
h1_p;de;Würzige Wagemut
h2_p;de;Eulenaugen
@ -371,11 +373,11 @@ p12_p;de;Tr
p13_p;de;Elixiere der Macht
p14_p;de;Heiltränke
# Spezialitems
## Spezialitems
lmsreward;de;Gürtel der Heldentaten
lmsreward_p;de;Gürtel der Heldentaten
# Parameter
## Parameter
ALLE_p;de;ALLES
BAUERN;de;BAUERN
BURG;de;BURG
@ -416,7 +418,7 @@ ANZAHL;de;ANZAHL
GEGENSTÄNDE;de;GEGENSTÄNDE
TRÄNKE;de;TRÄNKE
#;Talente:
## ;Talente:
sk_alchemy;de;Alchemie
sk_crossbow;de;Armbrustschießen
sk_stamina;de;Ausdauer
@ -447,7 +449,7 @@ sk_unarmed;de;Waffenloser Kampf
sk_cartmaking;de;Wagenbau
sk_perception;de;Wahrnehmung
# Befehle
## Befehle
//;de;//
BANNER;de;BANNER
ARBEITEN;de;ARBEITEN
@ -561,7 +563,7 @@ Zombie_p;de;Zombies
Zwerg;de;Zwerg
Zwerge;de;Zwerge
# races, future use:
## races, future use:
rc_lynx;de;Luchse
rc_unicorn_p;de;Einhörner
rc_wolve_p;de;Warge
@ -599,3 +601,31 @@ rc_orc;de;Ork
rc_zombie;de;Zombie
rc_zombie_p;de;Zombies
rc_shadowknight;de;Schattenritter
## NR generieren
nr_options;de;Optionen
nr_level;de;Stufe
nr_alliances;de;Aktueller Status
nr_herbsrequired;de;Benötigte Kräuter
nr_undercons;de;im Bau
nr_damaged;de;beschädigt
nr_youaredead;de;Unglücklicherweise wurde deine Partei ausgelöscht. Du kannst gerne an einer anderen Stelle wieder einsteigen. Melde Dich einfach wieder an.
nr_calendar;de;Wir schreiben %s des Monats %s im Jahre %d %s.
nr_skills;de;Talente
nr_inventory;de;hat
nr_size;de;Größe
nr_spells;de;Zauber
nr_combatspells;de;Kampfzauber
nr_nospells;de;keiner
nr_addresses;de;Liste aller Adressen
## Küsten
Nordwestküste;de;Nordwestküste
Nordostküste;de;Nordostküste
Ostküste;de;Ostküste
Südostküste;de;Südostküste
Südwestküste;de;Südwestküste
Westküste;de;Westküste

View File

@ -3272,19 +3272,6 @@
</locale>
</message>
<message name="starvation">
<type>
<arg name="unit" type="unit"></arg>
<arg name="dead" type="int"></arg>
<arg name="region" type="region"></arg>
</type>
<locale name="en">
<nr section="none">
<text>"$unit($unit) loses $int($dead) people due to starvation in $region($region)."</text>
</nr>
</locale>
</message>
<message name="pest">
<type>
<arg name="dead" type="int"></arg>

View File

@ -20,8 +20,8 @@ dir_West;en;West
unknownunit;en;an unknown unit
section_event_p;en;Messages and Events
section_error_p;en;Warnings and Errors
section_events;en;Messages and Events
section_errors;en;Warnings and Errors
section_economy;en;Economy and Trade
section_production;en;Resources and Production
section_magic;en;Magic and Artefacts
@ -29,8 +29,9 @@ section_movement;en;Movement and Travel
section_study;en;Learning and Teaching
section_battle;en;Battles
section_none;en;Miscellaneous
section_newspells;en;New Spells
# Building Types
## Building Types
academy;en;academy
blessedstonecircle;en;blessed stonecircle
caravan;en;caravanserei
@ -46,24 +47,24 @@ monument;en;monument
quarry;en;quarry
sawmill;en;sawmill
smithy;en;smithy
stables;en;stables
stables;en;stable
stonecircle;en;stonecircle
tunnel;en;tunnel
# Burgausbaustufen
site;en;site
## Burgausbaustufen
site;en;foundation
fortification;en;fortification
tower;en;tower
castle;en;castle
fortres_p;en;fortress
fortress;en;fortress
citadel;en;citadel
# Items
## Items
herb;en;herb
vial;en;vial
vial_p;en;vials
# Resourcen
## Resourcen
money;en;silver
money_p;en;silver
hp;en;hp
@ -75,7 +76,7 @@ permaura_p;en;permauras
peasant;en;peasant
peasant_p;en;peasants
#items
## items
almond;en;almond
almond_p;en;almonds
amulet;en;amulet
@ -219,7 +220,7 @@ trollbelt;en;trollbelt
unit;en;unit
unit_p;en;units
# luxury goods
## luxury goods
balm;en;balm
spice;en;spice
jewel;en;gem
@ -235,11 +236,11 @@ oil_p;en;oil
silk_p;en;silk
incense_p;en;incense
# Spezialitems
## Spezialitems
lmsreward;en;Belt of Heroic Legends
lmsreward_p;en;Belts of Heroic Legends
# Terraintypen
## Terraintypen
activevolcano;en;active volcano
corridor1;en;corridor
desert;en;desert
@ -286,7 +287,7 @@ xmas_exit;en;portal
viele;en;many
sehr viele;en;a great many
# intranslatables:
## intranslatables:
h0;en;Flachwurz
h0_p;en;Flachwurz
h1;en;Würziger Wagemut
@ -329,38 +330,38 @@ h19;en;Wei
h19_p;en;Weiße Wüteriche
h20;en;Schneekristall
h20_p;en;Schneekristalle
p0;en;Siebenmeilentee
p0_p;en;Siebenmeilentees
p1;en;Goliathwasser
p1_p;en;Goliathwasser
p2;en;Wasser des Lebens
p2_p;en;Wasser des Lebens
p0;en;seven mile tea
p0_p;en;seven mile teas
p1;en;goliath water
p1_p;en;goliath waters
p2;en;water of life
p2_p;en;waters of life
p3;en;Schaffenstrunk
p3_p;en;Schaffenstrünke
p4;en;Wundsalbe
p4_p;en;Wundsalben
p5;en;Bauernblut
p5_p;en;Bauernblut
p6;en;Gehirnschmalz
p6_p;en;Gehirnschmalz
p4;en;ointment
p4_p;en;ointments
p5;en;peasant bood
p5_p;en;peasant bloods
p6;en;brain wax
p6_p;en;brain waxes
p7;en;Dumpfbackenbrot
p7_p;en;Dumpfbackenbrote
p8;en;Nestwärme
p8_p;en;Nestwärme
p9;en;Pferdeglück
p9_p;en;Pferdeglück
p10;en;Berserkerblut
p10_p;en;Berserkerblut
p11;en;Bauernlieb
p11_p;en;Bauernlieb
p12;en;Trank der Wahrheit
p12_p;en;Tränke der Wahrheit
p13;en;Elixier der Macht
p13_p;en;Elixiere der Macht
p14;en;Heiltrank
p14_p;en;Heiltränke
p9;en;horsepower potion
p9_p;en;horsepower potions
p10;en;berserkers blood potion
p10_p;en;berserkers blood potions
p11;en;peasant love potion
p11_p;en;peasant love potion
p12;en;potion of truth
p12_p;en;potions of truth
p13;en;elixir of power
p13_p;en;elixirs of power
p14;en;healing potion
p14_p;en;healing potions
# Parameters
## Parameters
AGGRESSIV;en;AGGRESSIVE
ALLES;en;ALL
ANZAHL;en;NUMBER
@ -368,7 +369,7 @@ AURA;en;AURA
BAUERN;en;PEASANTS
BEISTAND;en;AID
BEWACHE;en;GUARD
BURG;en;FORTIFICATION
BURG;en;CASTLE
DEFENSIV;en;DEFENSIVE
EINHEIT;en;UNIT
FLIEHE;en;FLEE
@ -378,11 +379,11 @@ GEGENST
GIB;en;GIVE
GNADE;en;MERCY
HELFE;en;HELP
HINTEN;en;BACK
HINTEN;en;REAR
HINTER;en;AFTER
KOMMANDO;en;CONTROL
KRÄUTER;en;HERBS
KÄMPFE;en;COMBAT
KÄMPFE;en;FIGHT
NICHT;en;NOT
NÄCHSTER;en;NEXT
PARTEI;en;PARTEI
@ -401,7 +402,7 @@ VOR;en;BEFORE
VORNE;en;FRONT
ZAUBERBUCH;en;SPELLBOOK
# Skills
## Skills
sk_alchemy;en;alchemy
sk_armorer;en;armorer
sk_bow;en;bow
@ -432,7 +433,7 @@ sk_training;en;taming
sk_unarmed;en;unarmed combat
sk_weaponsmithing;en;weaponsmithing
# Keywords
## Keywords
//;en;//
ARBEITEN;en;WORK
ATTACKIEREN;en;ATTACK
@ -510,7 +511,7 @@ Eulen;en;owls
Geist;en;ghost
Geister;en;ghosts
Goblin;en;goblin
Goblin_p;en;goblins
Goblins;en;goblins
Halbling;en;halfling
Halblinge;en;halflings
Hirntöter;en;braineater
@ -522,14 +523,14 @@ Katze;en;cat
Katzen;en;cats
Katzendrache;en;catdragon
Katzendrachen;en;catdragons
Luch_p;en;lynx
Luchs;en;lynx
Luchse;en;lynx
Meermensch;en;aquarian
Meermenschen;en;aquarians
Mensch;en;human
Menschen;en;humans
Ork;en;orc
Ork_p;en;orc
Orks;en;orc
Riesenschildkröte;en;giant turtle
Riesenschildkröten;en;giant turtles
Schablone;en;template
@ -546,3 +547,42 @@ Zombie;en;zombie
Zombie_p;en;zombies
Zwerg;en;dwarf
Zwerge;en;dwarves
## NR generieren
nr_options;en;Options
nr_level;en;Level
nr_alliances;en;Political Status
nr_herbsrequired;en;Herbs required
nr_undercons;en;under construction
nr_damaged;en;damage
nr_youaredead;en;Your faction has been eliminated. We hope you had a good time anyways, and encourage you to sign up you for another game.
# TODO: calendar ist noch komplexer
nr_calendar;en;It is %s of the month of %s in the %d. year of %s.
nr_skills;en;skills
nr_inventory;en;has
nr_size;en;size
nr_spells;en;spells
nr_combatspells;en;combat spells
nr_nospells;en;none
nr_Addresslist;en;Addresses
## Küsten
Nordwestküste;en;northwest coast
Nordostküste;en;northeast coast
Ostküste;en;east coast
Südostküste;en;southeast coast
Südwestküste;en;southwest coast
Westküste;en;west coast
## Reportoptionen
AUSWERTUNG;en;REPORT
COMPUTER;en;COMPUTER
ZUGVORLAGE;en;TEMPLATE
SILBERPOOL;en;SILVERPOOL
STATISTIK;en;STATISTICS
MATERIALPOOL;en;ITEMPOOL
ADRESSEN;en;ADDRESSES
ZIPPED;en;ZIPPED
BZIP2;en;BZIP2
PUNKTE;en;SCORE