summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base
diff options
context:
space:
mode:
Diffstat (limited to 'modules/luci-base')
-rw-r--r--modules/luci-base/src/template_utils.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/modules/luci-base/src/template_utils.c b/modules/luci-base/src/template_utils.c
index 80542bd4f..6c4baa669 100644
--- a/modules/luci-base/src/template_utils.c
+++ b/modules/luci-base/src/template_utils.c
@@ -477,18 +477,8 @@ void luastr_translate(struct template_buffer *out, const char *s, unsigned int l
char *tr;
int trlen;
- switch (lmo_translate(s, l, &tr, &trlen))
- {
- case 0:
- luastr_escape(out, tr, trlen, escape_xml);
- break;
-
- case -1:
- luastr_escape(out, s, l, escape_xml);
- break;
-
- default:
- /* no catalog loaded */
- break;
- }
+ if (!lmo_translate(s, l, &tr, &trlen))
+ luastr_escape(out, tr, trlen, escape_xml);
+ else
+ luastr_escape(out, s, l, escape_xml);
}