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,
schwer beschädigen kann.
</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 name="wyrm_transformation">
<text locale="de">

View File

@ -1,6 +1,7 @@
#include <platform.h>
#include <kernel/config.h>
#include "direction.h"
#include "vortex.h"
#include "util/language.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);
}
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,
* das ist für die hexes ideal. */
const struct {
@ -39,6 +40,8 @@ void init_directions(const struct locale *lang) {
int i;
void **tokens = get_translations(lang, UT_DIRECTIONS);
register_special_direction(lang, "vortex");
for (i = 0; dirs[i].direction != NODIRECTION; ++i) {
const char *str = locale_string(lang, dirs[i].name);
if (str) {

View File

@ -22,7 +22,7 @@ typedef enum {
} direction_t;
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);
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;
int i;
@ -1982,7 +1982,7 @@ void init_locales(void)
{
int 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);
}
}

View File

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

View File

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

View File

@ -26,33 +26,29 @@ typedef struct dir_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;
char *str = _strdup(name);
const char *token = LOC(lang, name);
for (lang = locales; lang; lang = nextlocale(lang)) {
if (token) {
void **tokens = get_translations(lang, UT_SPECDIR);
const char *token = LOC(lang, name);
variant var;
char *str = _strdup(name);
if (token) {
variant var;
var.v = str;
addtoken(tokens, token, var);
var.v = str;
addtoken(tokens, token, var);
if (lang == locales) {
dir_lookup *dl = malloc(sizeof(dir_lookup));
dl->name = str;
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));
if (lang == locales) {
dir_lookup *dl = malloc(sizeof(dir_lookup));
dl->name = str;
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));
}
}
/********************/

View File

@ -19,7 +19,7 @@ extern "C" {
struct region *find_special_direction(const struct region *r,
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,
const struct region * to);
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");
locale_setstring(lang, "vortex", "wirbel");
init_locale(lang);
register_special_direction("vortex");
t_plain = test_create_terrain("plain", LAND_REGION | FOREST_REGION | WALK_INTO | CAVALRY_REGION);
r1 = test_create_region(0, 0, t_plain);
r2 = test_create_region(5, 0, t_plain);