forked from github/server
Korrekte Email-Subject und Adresse, auch im NR.
Eliminate crufty per-game strings.
This commit is contained in:
parent
94fcef2fac
commit
9ccaab6516
|
@ -52,16 +52,4 @@
|
||||||
<xi:include href="config://default/names-zombies.xml"/>
|
<xi:include href="config://default/names-zombies.xml"/>
|
||||||
<xi:include href="config://default/names-ghouls.xml"/>
|
<xi:include href="config://default/names-ghouls.xml"/>
|
||||||
<xi:include href="config://default/names-dragons.xml"/>
|
<xi:include href="config://default/names-dragons.xml"/>
|
||||||
<strings>
|
|
||||||
<string name="newbie_info_game">
|
|
||||||
<text locale="de">Bitte denke daran, deine Befehle mit dem Betreff
|
|
||||||
ERESSEA 2 BEFEHLE an eressea-server@eressea.kn-bremen.de zu senden.</text>
|
|
||||||
<text locale="en">Remember to send your orders to
|
|
||||||
eressea-server@eressea.kn-bremen.de with the subject ERESSEA 2 ORDERS.</text>
|
|
||||||
</string>
|
|
||||||
<string name="mailcmd">
|
|
||||||
<text locale="de">ERESSEA 2 BEFEHLE</text>
|
|
||||||
<text locale="en">ERESSEA 2 ORDERS</text>
|
|
||||||
</string>
|
|
||||||
</strings>
|
|
||||||
</eressea>
|
</eressea>
|
||||||
|
|
|
@ -36,16 +36,4 @@
|
||||||
<rules>
|
<rules>
|
||||||
<function name="wage" value="minimum_wage"/>
|
<function name="wage" value="minimum_wage"/>
|
||||||
</rules>
|
</rules>
|
||||||
<strings>
|
|
||||||
<string name="newbie_info_game">
|
|
||||||
<text locale="de">Bitte denke daran, deine Befehle mit dem Betreff
|
|
||||||
ERESSEA 3 BEFEHLE an eressea-server@eressea.kn-bremen.de zu senden.</text>
|
|
||||||
<text locale="en">Remember to send your orders to
|
|
||||||
eressea-server@eressea.kn-bremen.de with the subject E3 ORDERS.</text>
|
|
||||||
</string>
|
|
||||||
<string name="mailcmd">
|
|
||||||
<text locale="de">ERESSEA 3 BEFEHLE</text>
|
|
||||||
<text locale="en">ERESSEA 3 ORDERS</text>
|
|
||||||
</string>
|
|
||||||
</strings>
|
|
||||||
</eressea>
|
</eressea>
|
||||||
|
|
|
@ -36,16 +36,4 @@
|
||||||
<rules>
|
<rules>
|
||||||
<function name="wage" value="minimum_wage"/>
|
<function name="wage" value="minimum_wage"/>
|
||||||
</rules>
|
</rules>
|
||||||
<strings>
|
|
||||||
<string name="newbie_info_game">
|
|
||||||
<text locale="de">Bitte denke daran, deine Befehle mit dem Betreff
|
|
||||||
ERESSEA 4 BEFEHLE an eressea-server@eressea.kn-bremen.de zu senden.</text>
|
|
||||||
<text locale="en">Remember to send your orders to
|
|
||||||
eressea-server@eressea.kn-bremen.de with the subject ERESSEA 4 ORDERS.</text>
|
|
||||||
</string>
|
|
||||||
<string name="mailcmd">
|
|
||||||
<text locale="de">ERESSEA 4 BEFEHLE</text>
|
|
||||||
<text locale="en">ERESSEA 4 ORDERS</text>
|
|
||||||
</string>
|
|
||||||
</strings>
|
|
||||||
</eressea>
|
</eressea>
|
||||||
|
|
|
@ -6,6 +6,12 @@
|
||||||
_x: preposition (15 /Schlumpf/schwerter)
|
_x: preposition (15 /Schlumpf/schwerter)
|
||||||
_a: including article (ein Schlumpf, a smurf)
|
_a: including article (ein Schlumpf, a smurf)
|
||||||
-->
|
-->
|
||||||
|
<strings>
|
||||||
|
<string name="mailcmd">
|
||||||
|
<text locale="de">BEFEHLE</text>
|
||||||
|
<text locale="en">ORDERS</text>
|
||||||
|
</string>
|
||||||
|
</strings>
|
||||||
<string name="vortex">
|
<string name="vortex">
|
||||||
<text locale="de">Wirbel</text>
|
<text locale="de">Wirbel</text>
|
||||||
<text locale="en">vortex</text>
|
<text locale="en">vortex</text>
|
||||||
|
|
|
@ -1,5 +1,15 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<messages>
|
<messages>
|
||||||
|
<message name="newbie_info_game" section="events">
|
||||||
|
<type>
|
||||||
|
<arg name="subject" type="string"/>
|
||||||
|
<arg name="email" type="string"/>
|
||||||
|
</type>
|
||||||
|
<text locale="de">Bitte denke daran, deine Befehle mit dem Betreff
|
||||||
|
$subject an $email zu senden.</text>
|
||||||
|
<text locale="en">Remember to send your orders to
|
||||||
|
$email with the subject ${subject}.</text>
|
||||||
|
</message>
|
||||||
<message name="parse_error" section="errors">
|
<message name="parse_error" section="errors">
|
||||||
<type>
|
<type>
|
||||||
<arg name="unit" type="unit"/>
|
<arg name="unit" type="unit"/>
|
||||||
|
|
|
@ -1510,9 +1510,7 @@ report_computer(const char *filename, report_context * ctx, const char *bom)
|
||||||
fprintf(F, "%d;Zeitalter\n", era);
|
fprintf(F, "%d;Zeitalter\n", era);
|
||||||
fprintf(F, "\"%s\";Build\n", eressea_version());
|
fprintf(F, "\"%s\";Build\n", eressea_version());
|
||||||
if (mailto != NULL) {
|
if (mailto != NULL) {
|
||||||
// char mailcmd[64];
|
const char * mailcmd = get_mailcmd(f->locale);
|
||||||
// snprintf(mailcmd, sizeof(mailcmd), "%s %d, %s", game_name(), game_id(), LOC(f->locale, "mailcmd"));
|
|
||||||
const char * mailcmd = LOC(f->locale, "mailcmd");
|
|
||||||
fprintf(F, "\"%s\";mailto\n", mailto);
|
fprintf(F, "\"%s\";mailto\n", mailto);
|
||||||
fprintf(F, "\"%s\";mailcmd\n", mailcmd);
|
fprintf(F, "\"%s\";mailcmd\n", mailcmd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -803,12 +803,25 @@ void free_gamedata(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * game_name(void) {
|
const char * game_name(void)
|
||||||
|
{
|
||||||
const char * param = config_get("game.name");
|
const char * param = config_get("game.name");
|
||||||
return param ? param : global.gamename;
|
return param ? param : global.gamename;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char * game_name_upper(void)
|
||||||
|
{
|
||||||
|
static char result[32]; // FIXME: static result
|
||||||
|
char *r = result;
|
||||||
|
const char *param = game_name();
|
||||||
|
const char *c = param;
|
||||||
|
while (*c && (r-result)<sizeof(result)) {
|
||||||
|
*r++ = (char)toupper(*c++);
|
||||||
|
}
|
||||||
|
*r = '\0';
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
int game_id(void) {
|
int game_id(void) {
|
||||||
return config_get_int("game.id", 0);
|
return config_get_int("game.id", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,7 @@ extern "C" {
|
||||||
param_t getparam(const struct locale *lang);
|
param_t getparam(const struct locale *lang);
|
||||||
|
|
||||||
const char * game_name(void);
|
const char * game_name(void);
|
||||||
|
const char * game_name_upper(void);
|
||||||
int game_id(void);
|
int game_id(void);
|
||||||
/* returns a value between [0..xpct_2], generated with two dice */
|
/* returns a value between [0..xpct_2], generated with two dice */
|
||||||
|
|
||||||
|
|
|
@ -244,6 +244,8 @@ static void test_config_inifile(CuTest *tc) {
|
||||||
iniparser_set(ini, "game:name", "Eressea");
|
iniparser_set(ini, "game:name", "Eressea");
|
||||||
config_set_from(ini);
|
config_set_from(ini);
|
||||||
CuAssertStrEquals(tc, "Eressea", config_get("game.name"));
|
CuAssertStrEquals(tc, "Eressea", config_get("game.name"));
|
||||||
|
CuAssertStrEquals(tc, "Eressea", game_name());
|
||||||
|
CuAssertStrEquals(tc, "ERESSEA", game_name_upper());
|
||||||
CuAssertIntEquals(tc, 42, game_id());
|
CuAssertIntEquals(tc, 42, game_id());
|
||||||
iniparser_freedict(ini);
|
iniparser_freedict(ini);
|
||||||
test_cleanup();
|
test_cleanup();
|
||||||
|
|
17
src/report.c
17
src/report.c
|
@ -2081,19 +2081,24 @@ report_plaintext(const char *filename, report_context * ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (f->age <= 2) {
|
if (f->age <= 2) {
|
||||||
const char *s;
|
const char *email;
|
||||||
s = locale_getstring(f->locale, "newbie_info_game");
|
const char *subject;
|
||||||
if (s) {
|
email = config_get("game.email");
|
||||||
newline(out);
|
subject = get_mailcmd(f->locale);
|
||||||
centre(out, s, true);
|
m = msg_message("newbie_info_game", "email subject", email, subject);
|
||||||
|
if (m) {
|
||||||
|
nr_render(m, f->locale, buf, sizeof(buf), f);
|
||||||
|
msg_release(m);
|
||||||
|
centre(out, buf, true);
|
||||||
}
|
}
|
||||||
if ((f->options & want(O_COMPUTER)) == 0) {
|
if ((f->options & want(O_COMPUTER)) == 0) {
|
||||||
f->options |= want(O_COMPUTER);
|
const char *s;
|
||||||
s = locale_getstring(f->locale, "newbie_info_cr");
|
s = locale_getstring(f->locale, "newbie_info_cr");
|
||||||
if (s) {
|
if (s) {
|
||||||
newline(out);
|
newline(out);
|
||||||
centre(out, s, true);
|
centre(out, s, true);
|
||||||
}
|
}
|
||||||
|
f->options |= want(O_COMPUTER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newline(out);
|
newline(out);
|
||||||
|
|
|
@ -1945,6 +1945,13 @@ static void eval_regions(struct opstack **stack, const void *userdata)
|
||||||
opush(stack, var);
|
opush(stack, var);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *get_mailcmd(const struct locale *loc)
|
||||||
|
{
|
||||||
|
static char result[64]; // FIXME: static return buffer
|
||||||
|
snprintf(result, sizeof(result), "%s %d %s", game_name_upper(), game_id(), LOC(loc, "mailcmd"));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
static void eval_trail(struct opstack **stack, const void *userdata)
|
static void eval_trail(struct opstack **stack, const void *userdata)
|
||||||
{ /* order -> string */
|
{ /* order -> string */
|
||||||
const faction *report = (const faction *)userdata;
|
const faction *report = (const faction *)userdata;
|
||||||
|
|
|
@ -129,6 +129,7 @@ extern "C" {
|
||||||
int stream_printf(struct stream * out, const char *format, ...);
|
int stream_printf(struct stream * out, const char *format, ...);
|
||||||
|
|
||||||
int count_travelthru(struct region *r, const struct faction *f);
|
int count_travelthru(struct region *r, const struct faction *f);
|
||||||
|
const char *get_mailcmd(const struct locale *loc);
|
||||||
|
|
||||||
#define GR_PLURAL 0x01 /* grammar: plural */
|
#define GR_PLURAL 0x01 /* grammar: plural */
|
||||||
#define MAX_INVENTORY 128 /* maimum number of different items in an inventory */
|
#define MAX_INVENTORY 128 /* maimum number of different items in an inventory */
|
||||||
|
|
Loading…
Reference in New Issue