fix astral space special direction, vortex (translation issue).

This commit is contained in:
Enno Rehling 2014-09-29 21:19:07 +02:00
parent cbf9bb8985
commit 68730749fb
9 changed files with 29 additions and 28 deletions

View File

@ -4771,6 +4771,10 @@
Strudel, einen Mahlstrom, welcher alle Schiffe, die ihn passieren, Strudel, einen Mahlstrom, welcher alle Schiffe, die ihn passieren,
schwer beschädigen kann. schwer beschädigen kann.
</text> </text>
<text locale="en">
This ritual summons a mighty water elemental from the depths of the ocean.
The elemental creates an enormous maelstrom which damages any passing ships.
</text>
</string> </string>
<string name="wyrm_transformation"> <string name="wyrm_transformation">
<text locale="de"> <text locale="de">

View File

@ -1,6 +1,7 @@
#include <platform.h> #include <platform.h>
#include <kernel/config.h> #include <kernel/config.h>
#include "direction.h" #include "direction.h"
#include "vortex.h"
#include "util/language.h" #include "util/language.h"
#include "util/umlaut.h" #include "util/umlaut.h"
@ -14,7 +15,7 @@ void init_direction(const struct locale *lang, direction_t dir, const char *str)
addtoken(tokens, str, token); addtoken(tokens, str, token);
} }
void init_directions(const struct locale *lang) { void init_directions(struct locale *lang) {
/* mit dieser routine kann man mehrere namen für eine direction geben, /* mit dieser routine kann man mehrere namen für eine direction geben,
* das ist für die hexes ideal. */ * das ist für die hexes ideal. */
const struct { const struct {
@ -39,6 +40,8 @@ void init_directions(const struct locale *lang) {
int i; int i;
void **tokens = get_translations(lang, UT_DIRECTIONS); void **tokens = get_translations(lang, UT_DIRECTIONS);
register_special_direction(lang, "vortex");
for (i = 0; dirs[i].direction != NODIRECTION; ++i) { for (i = 0; dirs[i].direction != NODIRECTION; ++i) {
const char *str = locale_string(lang, dirs[i].name); const char *str = locale_string(lang, dirs[i].name);
if (str) { if (str) {

View File

@ -22,7 +22,7 @@ typedef enum {
} direction_t; } direction_t;
direction_t get_direction(const char *s, const struct locale *); direction_t get_direction(const char *s, const struct locale *);
void init_directions(const struct locale *lang); void init_directions(struct locale *lang);
void init_direction(const struct locale *lang, direction_t dir, const char *str); void init_direction(const struct locale *lang, direction_t dir, const char *str);
direction_t finddirection(const char *str); direction_t finddirection(const char *str);

View File

@ -1779,7 +1779,7 @@ void init_options_translation(const struct locale * lang) {
} }
} }
void init_locale(const struct locale *lang) void init_locale(struct locale *lang)
{ {
variant var; variant var;
int i; int i;
@ -1982,7 +1982,7 @@ void init_locales(void)
{ {
int l; int l;
for (l = 0; localenames[l]; ++l) { for (l = 0; localenames[l]; ++l) {
const struct locale *lang = get_or_create_locale(localenames[l]); struct locale *lang = get_or_create_locale(localenames[l]);
init_locale(lang); init_locale(lang);
} }
} }

View File

@ -177,7 +177,7 @@ extern "C" {
int distribute(int old, int new_value, int n); int distribute(int old, int new_value, int n);
void init_locales(void); void init_locales(void);
void init_locale(const struct locale *lang); void init_locale(struct locale *lang);
int newunitid(void); int newunitid(void);
int forbiddenid(int id); int forbiddenid(int id);

View File

@ -6868,7 +6868,6 @@ void register_spells(void)
register_function((pf_generic)sp_kampfzauber, "combat_spell"); register_function((pf_generic)sp_kampfzauber, "combat_spell");
register_spelldata(); register_spelldata();
register_special_direction("vortex");
register_unitcurse(); register_unitcurse();
register_regioncurse(); register_regioncurse();

View File

@ -26,33 +26,29 @@ typedef struct dir_lookup {
static dir_lookup *dir_name_lookup; static dir_lookup *dir_name_lookup;
void register_special_direction(const char *name) void register_special_direction(struct locale *lang, const char *name)
{ {
struct locale *lang; const char *token = LOC(lang, name);
char *str = _strdup(name);
for (lang = locales; lang; lang = nextlocale(lang)) { if (token) {
void **tokens = get_translations(lang, UT_SPECDIR); void **tokens = get_translations(lang, UT_SPECDIR);
const char *token = LOC(lang, name); variant var;
char *str = _strdup(name);
if (token) { var.v = str;
variant var; addtoken(tokens, token, var);
var.v = str; if (lang == locales) {
addtoken(tokens, token, var); dir_lookup *dl = malloc(sizeof(dir_lookup));
dl->name = str;
if (lang == locales) { dl->oldname = token;
dir_lookup *dl = malloc(sizeof(dir_lookup)); dl->next = dir_name_lookup;
dl->name = str; dir_name_lookup = dl;
dl->oldname = token;
dl->next = dir_name_lookup;
dir_name_lookup = dl;
}
}
else {
log_error("no translation for spec_direction '%s' in locale '%s'\n", name, locale_name(lang));
} }
} }
else {
log_error("no translation for spec_direction '%s' in locale '%s'\n", name, locale_name(lang));
}
} }
/********************/ /********************/

View File

@ -19,7 +19,7 @@ extern "C" {
struct region *find_special_direction(const struct region *r, struct region *find_special_direction(const struct region *r,
const char *token); const char *token);
void register_special_direction(const char *name); void register_special_direction(struct locale *lang, const char *name);
struct spec_direction *special_direction(const struct region * from, struct spec_direction *special_direction(const struct region * from,
const struct region * to); const struct region * to);
struct attrib *create_special_direction(struct region *r, struct region *rt, struct attrib *create_special_direction(struct region *r, struct region *rt,

View File

@ -25,7 +25,6 @@ static void test_move_to_vortex(CuTest *tc) {
lang = get_or_create_locale("en"); lang = get_or_create_locale("en");
locale_setstring(lang, "vortex", "wirbel"); locale_setstring(lang, "vortex", "wirbel");
init_locale(lang); init_locale(lang);
register_special_direction("vortex");
t_plain = test_create_terrain("plain", LAND_REGION | FOREST_REGION | WALK_INTO | CAVALRY_REGION); t_plain = test_create_terrain("plain", LAND_REGION | FOREST_REGION | WALK_INTO | CAVALRY_REGION);
r1 = test_create_region(0, 0, t_plain); r1 = test_create_region(0, 0, t_plain);
r2 = test_create_region(5, 0, t_plain); r2 = test_create_region(5, 0, t_plain);