From d91c4e7831e9451fef646eba87609415b592cf2d Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 20 May 2001 07:55:07 +0000 Subject: [PATCH] sinnigere anzeige durchreiseregionen, funktion $strlen --- src/common/util/translation.c | 9 +++++++++ src/res/de/messages.xml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/common/util/translation.c b/src/common/util/translation.c index 8e4df9c34..bf65c92e0 100644 --- a/src/common/util/translation.c +++ b/src/common/util/translation.c @@ -400,6 +400,14 @@ eval_if(opstack ** stack, const void * userdata) /* (int, int) -> int */ unused(userdata); } +static void +eval_strlen(opstack ** stack, const void * userdata) /* string -> int */ +{ + const char * c = opop(stack, const char *); + opush(stack, c?strlen(c):0); + unused(userdata); +} + #include "base36.h" static void eval_int(opstack ** stack, const void * userdata) @@ -436,6 +444,7 @@ translation_init(void) add_function("eq", &eval_eq); add_function("int", &eval_int); add_function("add", &eval_add); + add_function("strlen", &eval_strlen); add_function("if", &eval_if); add_function("localize", &eval_localize); add_function("locale", &eval_locale); diff --git a/src/res/de/messages.xml b/src/res/de/messages.xml index 825c39ee8..e6a606060 100644 --- a/src/res/de/messages.xml +++ b/src/res/de/messages.xml @@ -4936,7 +4936,7 @@ - "$unit($unit) $int($mode) von $region($start) nach $region($end).$regions" + "$unit($unit) $int($mode) von $region($start) nach $region($end).$if($strlen($regions)," Dabei wurde $regions durchquert.","")"