diff options
Diffstat (limited to 'plugins/MirLua/src/m_core.cpp')
-rw-r--r-- | plugins/MirLua/src/m_core.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp index 99166d3236..25d43a4964 100644 --- a/plugins/MirLua/src/m_core.cpp +++ b/plugins/MirLua/src/m_core.cpp @@ -185,6 +185,16 @@ static int lua_CallService(lua_State *L) return 1;
}
+static int lua_Translate(lua_State *L)
+{
+ char *value = (char*)luaL_checkstring(L, 1);
+
+ ptrT string(mir_utf8decodeT(value, NULL));
+ lua_pushstring(L, T2Utf(TranslateTS(string)));
+
+ return 1;
+}
+
luaL_Reg CMLua::coreLib[] =
{
{ "CreateHookableEvent", lua_CreateHookableEvent },
@@ -203,5 +213,7 @@ luaL_Reg CMLua::coreLib[] = { "ServiceExists", lua_ServiceExists },
{ "CallService", lua_CallService },
+ { "Translate", lua_Translate },
+
{ NULL, NULL }
};
|