forked from github/server
fix astral space special direction, vortex (translation issue).
This commit is contained in:
parent
cbf9bb8985
commit
68730749fb
|
@ -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">
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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();
|
||||||
|
|
10
src/vortex.c
10
src/vortex.c
|
@ -26,17 +26,14 @@ 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;
|
|
||||||
char *str = _strdup(name);
|
|
||||||
|
|
||||||
for (lang = locales; lang; lang = nextlocale(lang)) {
|
|
||||||
void **tokens = get_translations(lang, UT_SPECDIR);
|
|
||||||
const char *token = LOC(lang, name);
|
const char *token = LOC(lang, name);
|
||||||
|
|
||||||
if (token) {
|
if (token) {
|
||||||
|
void **tokens = get_translations(lang, UT_SPECDIR);
|
||||||
variant var;
|
variant var;
|
||||||
|
char *str = _strdup(name);
|
||||||
|
|
||||||
var.v = str;
|
var.v = str;
|
||||||
addtoken(tokens, token, var);
|
addtoken(tokens, token, var);
|
||||||
|
@ -52,7 +49,6 @@ void register_special_direction(const char *name)
|
||||||
else {
|
else {
|
||||||
log_error("no translation for spec_direction '%s' in locale '%s'\n", name, locale_name(lang));
|
log_error("no translation for spec_direction '%s' in locale '%s'\n", name, locale_name(lang));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************/
|
/********************/
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue