+ return 0;
+}
+
+int template_L_striptags(lua_State *L)
+{
+ size_t len = 0;
+ const char *str = luaL_checklstring(L, 1, &len);
+ char *res = striptags(str, len);
+
+ if (res != NULL)
+ {
+ lua_pushstring(L, res);
+ free(res);
+
+ return 1;
+ }
+
+ return 0;
+}
+
+static int template_L_load_catalog(lua_State *L) {
+ const char *lang = luaL_optstring(L, 1, "en");
+ const char *dir = luaL_optstring(L, 2, NULL);
+ lua_pushboolean(L, !lmo_load_catalog(lang, dir));
+ return 1;
+}
+
+static int template_L_close_catalog(lua_State *L) {
+ const char *lang = luaL_optstring(L, 1, "en");
+ lmo_close_catalog(lang);
+ return 0;
+}
+
+static int template_L_change_catalog(lua_State *L) {
+ const char *lang = luaL_optstring(L, 1, "en");
+ lua_pushboolean(L, !lmo_change_catalog(lang));
+ return 1;
+}
+
+static int template_L_translate(lua_State *L) {
+ size_t len;
+ char *tr;
+ int trlen;
+ const char *key = luaL_checklstring(L, 1, &len);
+
+ switch (lmo_translate(key, len, &tr, &trlen))
+ {
+ case 0:
+ lua_pushlstring(L, tr, trlen);