"road anstatt straße im cr"
fixed again, differently
This commit is contained in:
Enno Rehling 2007-12-18 22:58:58 +00:00
parent e780097a3b
commit 09683fd891
7 changed files with 305 additions and 283 deletions

View file

@ -1116,9 +1116,9 @@ cr_borders(seen_region ** seen, const region * r, const faction * f, int seemode
} }
} }
if (cs) { if (cs) {
const char * bname = b->type->name(b, r, f, 0); /* bug 1326 - I hate this */ const char * bname = b->type->name(b, r, f, GF_PURE);
fprintf(F, "GRENZE %d\n", ++g); fprintf(F, "GRENZE %d\n", ++g);
fprintf(F, "\"%s\";typ\n", LOC(default_locale, mkname("border", bname))); fprintf(F, "\"%s\";typ\n", LOC(default_locale, bname));
fprintf(F, "%d;richtung\n", d); fprintf(F, "%d;richtung\n", d);
if (!b->type->transparent(b, f)) fputs("1;opaque\n", F); if (!b->type->transparent(b, f)) fputs("1;opaque\n", F);
/* hack: */ /* hack: */

View file

@ -840,7 +840,7 @@ describe(FILE * F, const region * r, int partial, faction * f)
const char *tname; const char *tname;
struct edge { struct edge {
struct edge * next; struct edge * next;
const char * name; char * name;
boolean transparent; boolean transparent;
boolean block; boolean block;
boolean exist[MAXDIRECTIONS]; boolean exist[MAXDIRECTIONS];
@ -871,7 +871,7 @@ describe(FILE * F, const region * r, int partial, faction * f)
while (e && (e->transparent != transparent || strcmp(name,e->name))) e = e->next; while (e && (e->transparent != transparent || strcmp(name,e->name))) e = e->next;
if (!e) { if (!e) {
e = calloc(sizeof(struct edge), 1); e = calloc(sizeof(struct edge), 1);
e->name = name; e->name = strdup(name);
e->transparent = transparent; e->transparent = transparent;
e->next = edges; e->next = edges;
edges = e; edges = e;
@ -989,7 +989,7 @@ describe(FILE * F, const region * r, int partial, faction * f)
bytes = (int)strlcpy(bufp, LOC(f->locale, resourcename(oldresourcetype[R_SILVER], rmoney(r)!=1)), size); bytes = (int)strlcpy(bufp, LOC(f->locale, resourcename(oldresourcetype[R_SILVER], rmoney(r)!=1)), size);
if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER(); if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER();
} }
/* horses */ /* Pferde */
if (rhorses(r)) { if (rhorses(r)) {
bytes = snprintf(bufp, size, ", %d ", rhorses(r)); bytes = snprintf(bufp, size, ", %d ", rhorses(r));
@ -1152,7 +1152,7 @@ describe(FILE * F, const region * r, int partial, faction * f)
if (!e->transparent) bytes = (int)strlcpy(bufp, " versperrt ", size); if (!e->transparent) bytes = (int)strlcpy(bufp, " versperrt ", size);
else bytes = (int)strlcpy(bufp, " befindet sich ", size); else bytes = (int)strlcpy(bufp, " befindet sich ", size);
if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER(); if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER();
bytes = (int)strlcpy(bufp, LOC(f->locale, mkname("border", e->name)), size); bytes = (int)strlcpy(bufp, e->name, size);
if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER(); if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER();
if (!e->transparent) bytes = (int)strlcpy(bufp, " die Sicht.", size); if (!e->transparent) bytes = (int)strlcpy(bufp, " die Sicht.", size);
else bytes = (int)strlcpy(bufp, ".", size); else bytes = (int)strlcpy(bufp, ".", size);
@ -1163,6 +1163,7 @@ describe(FILE * F, const region * r, int partial, faction * f)
if (edges) { if (edges) {
while (edges) { while (edges) {
e = edges->next; e = edges->next;
free(edges->name);
free(edges); free(edges);
edges = e; edges = e;
} }

View file

@ -278,11 +278,14 @@ age_borders(void)
static const char * static const char *
b_namewall(const border * b, const region * r, const struct faction * f, int gflags) b_namewall(const border * b, const region * r, const struct faction * f, int gflags)
{ {
const char * bname = "wall";
unused(f); unused(f);
unused(r); unused(r);
unused(b); unused(b);
if (gflags & GF_ARTICLE) return "a_wall"; if (gflags & GF_ARTICLE) bname = "a_wall";
return "wall"; if (gflags & GF_PURE) return bname;
return LOC(f->locale, mkname("border", bname));
} }
border_type bt_wall = { border_type bt_wall = {
@ -319,8 +322,9 @@ b_namefogwall(const border * b, const region * r, const struct faction * f, int
unused(f); unused(f);
unused(b); unused(b);
unused(r); unused(r);
if (gflags & GF_ARTICLE) return "a_fogwall"; if (gflags & GF_PURE) return "fogwall";
return "fogwall"; if (gflags & GF_ARTICLE) return LOC(f->locale, mkname("border", "a_fogwall"));
return LOC(f->locale, mkname("border", "fogwall"));
} }
static boolean static boolean
@ -349,11 +353,15 @@ border_type bt_fogwall = {
static const char * static const char *
b_nameillusionwall(const border * b, const region * r, const struct faction * f, int gflags) b_nameillusionwall(const border * b, const region * r, const struct faction * f, int gflags)
{ {
/* TODO: UNICODE: f->locale bestimmt die Sprache */
int fno = b->data.i; int fno = b->data.i;
unused(b); unused(b);
unused(r); unused(r);
if (gflags & GF_ARTICLE) return (f && fno==f->subscription)?"an_illusionwall":"a_wall"; if (gflags & GF_PURE) return (f && fno==f->no)?"illusionwall":"wall";
return (f && fno==f->no)?"illusionwall":"wall"; if (gflags & GF_ARTICLE) {
return LOC(f->locale, mkname("border", (f && fno==f->subscription)?"an_illusionwall":"a_wall"));
}
return LOC(f->locale, mkname("border", (f && fno==f->no)?"illusionwall":"wall"));
} }
border_type bt_illusionwall = { border_type bt_illusionwall = {
@ -382,23 +390,27 @@ boolean b_blockquestportal(const border * b, const unit * u, const region * r) {
static const char * static const char *
b_namequestportal(const border * b, const region * r, const struct faction * f, int gflags) b_namequestportal(const border * b, const region * r, const struct faction * f, int gflags)
{ {
/* TODO: UNICODE: f->locale bestimmt die Sprache */
const char * bname;
int lock = b->data.i; int lock = b->data.i;
unused(b); unused(b);
unused(r); unused(r);
if (gflags & GF_ARTICLE) { if (gflags & GF_ARTICLE) {
if (lock > 0) { if (lock > 0) {
return "a_gate_locked"; bname = "a_gate_locked";
} else { } else {
return "a_gate_open"; bname = "a_gate_open";
} }
} else { } else {
if (lock > 0) { if (lock > 0) {
return "gate_locked"; bname = "gate_locked";
} else { } else {
return "gate_open"; bname = "gate_open";
} }
} }
if (gflags & GF_PURE) return bname;
return LOC(f->locale, mkname("border", bname));
} }
border_type bt_questportal = { border_type bt_questportal = {
@ -427,26 +439,27 @@ b_nameroad(const border * b, const region * r, const struct faction * f, int gfl
static char buffer[64]; static char buffer[64];
unused(f); unused(f);
if (gflags & GF_PURE) return "road";
if (gflags & GF_ARTICLE) { if (gflags & GF_ARTICLE) {
if (!(gflags & GF_DETAILED)) return "a_road"; if (!(gflags & GF_DETAILED)) return LOC(f->locale, mkname("border", "a_road"));
else if (r->terrain->max_road<=local) { else if (r->terrain->max_road<=local) {
int remote = (r2==b->from)?b->data.sa[0]:b->data.sa[1]; int remote = (r2==b->from)?b->data.sa[0]:b->data.sa[1];
if (r2->terrain->max_road<=remote) { if (r2->terrain->max_road<=remote) {
return "a_road"; return LOC(f->locale, mkname("border", "a_road"));
} else { } else {
return "an_incomplete_road"; return LOC(f->locale, mkname("border", "an_incomplete_road"));
} }
} else { } else {
int percent = max(1, 100*local/r->terrain->max_road); int percent = max(1, 100*local/r->terrain->max_road);
if (local) { if (local) {
snprintf(buffer, sizeof(buffer), "a_road_percent", percent); snprintf(buffer, sizeof(buffer), LOC(f->locale, mkname("border", "road_percent")), percent);
} else { } else {
return "a_road_connection"; return LOC(f->locale, mkname("border", "a_road_connection"));
} }
} }
} }
else if (gflags & GF_PLURAL) return "roads"; else if (gflags & GF_PLURAL) return LOC(f->locale, mkname("border", "roads"));
else return "road"; else return LOC(f->locale, mkname("border", "road"));
return buffer; return buffer;
} }

View file

@ -303,6 +303,8 @@ void addmessage(struct region * r, struct faction * f, const char *s, msg_t mtyp
/* der, die, das vs. ein, eine */ /* der, die, das vs. ein, eine */
#define GF_DETAILED 32 #define GF_DETAILED 32
/* mehr Informationen. z.b. straße zu 50% */ /* mehr Informationen. z.b. straße zu 50% */
#define GF_PURE 64
/* untranslated */
#define GUARD_NONE 0 #define GUARD_NONE 0
#define GUARD_TAX 1 #define GUARD_TAX 1

View file

@ -312,7 +312,7 @@ guardian_faction(plane * pl, int id)
if (!f) { if (!f) {
f = calloc(1, sizeof(faction)); f = calloc(1, sizeof(faction));
f->banner = strdup("Sie dienen dem grossen Wyrm"); f->banner = strdup("Sie dienen dem großen Wyrm");
f->passw = strdup(itoa36(rng_int())); f->passw = strdup(itoa36(rng_int()));
f->override = strdup(itoa36(rng_int())); f->override = strdup(itoa36(rng_int()));
set_email(&f->email, "igjarjuk@eressea.de"); set_email(&f->email, "igjarjuk@eressea.de");

View file

@ -545,7 +545,7 @@ sp_summon_familiar(castorder *co)
int dh, dh1, bytes; int dh, dh1, bytes;
direction_t d; direction_t d;
message * msg; message * msg;
char zText[1024], * bufp = zText; char zText[NAMESIZE], * bufp = zText;
size_t size = sizeof(zText) - 1; size_t size = sizeof(zText) - 1;
if (get_familiar(mage) != NULL ) { if (get_familiar(mage) != NULL ) {
@ -2810,13 +2810,15 @@ resolve_buddy(variant data)
static const char * static const char *
b_namefirewall(const border * b, const region * r, const faction * f, int gflags) b_namefirewall(const border * b, const region * r, const faction * f, int gflags)
{ {
const char * bname;
unused(f); unused(f);
unused(r); unused(r);
unused(b); unused(b);
if (gflags & GF_ARTICLE) if (gflags & GF_ARTICLE) bname = "a_firewall";
return "a_firewall"; else bname = "firewall";
else
return "firewall"; if (gflags & GF_PURE) return bname;
return LOC(f->locale, mkname("border", bname));
} }
static void static void
@ -2955,15 +2957,19 @@ sp_firewall(castorder *co)
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
static const char * static const char *
b_namewisps(const border * b, const region * r, const faction * f, int gflags) wisps_name(const border * b, const region * r, const faction * f, int gflags)
{ {
const char * bname;
unused(f); unused(f);
unused(r); unused(r);
unused(b); unused(b);
if (gflags & GF_ARTICLE) if (gflags & GF_ARTICLE) {
return "a_wisps"; bname = "a_wisps";
else } else {
return "wisps"; bname = "wisps";
}
if (gflags & GF_PURE) return bname;
return LOC(f->locale, mkname("border", bname));
} }
typedef struct wisps_data { typedef struct wisps_data {
@ -3009,7 +3015,7 @@ border_type bt_wisps = {
wall_read, /* read */ wall_read, /* read */
wall_write, /* write */ wall_write, /* write */
b_blocknone, /* block */ b_blocknone, /* block */
b_namewisps, /* name */ wisps_name, /* name */
b_rvisible, /* rvisible */ b_rvisible, /* rvisible */
b_fvisible, /* fvisible */ b_fvisible, /* fvisible */
b_uvisible, /* uvisible */ b_uvisible, /* uvisible */

View file

@ -7524,13 +7524,13 @@
<text locale="en">a massive open door</text> <text locale="en">a massive open door</text>
</string> </string>
<string name="gate_closed"> <string name="gate_locked">
<text locale="de">gewaltiges geschlossenes Tor</text> <text locale="de">gewaltiges verschlossenes Tor</text>
<text locale="en">massive locked door</text> <text locale="en">massive locked door</text>
</string> </string>
<string name="a_gate_closed"> <string name="a_gate_locked">
<text locale="de">ein gewaltiges geschlossenes Tor</text> <text locale="de">ein gewaltiges verschlossenes Tor</text>
<text locale="en">a massive locked door</text> <text locale="en">a massive locked door</text>
</string> </string>