/*
* LuCI Template - Utility functions
*
- * Copyright (C) 2010 Jo-Philipp Wich <xm@subsignal.org>
+ * Copyright (C) 2010 Jo-Philipp Wich <jow@openwrt.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
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);
}