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.","")"