summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-06-11 20:05:07 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-06-11 20:05:07 +0000
commita0cef1d43a718ea27333293280347a19a914c9a3 (patch)
treec3ddad4a0a903bd8650c9ac710e663ff26fa00fb /plugins
parent6b3a5807538dd07708b49ffaa73e2bd66542db01 (diff)
MirLua: added Translate to core module
git-svn-id: http://svn.miranda-ng.org/main/trunk@14123 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/MirLua/src/m_core.cpp12
-rw-r--r--plugins/MirLua/src/mlua.h2
2 files changed, 13 insertions, 1 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 }
};
diff --git a/plugins/MirLua/src/mlua.h b/plugins/MirLua/src/mlua.h
index 8abc839bd0..3f897e085a 100644
--- a/plugins/MirLua/src/mlua.h
+++ b/plugins/MirLua/src/mlua.h
@@ -5,7 +5,7 @@ class CMLua
{
private:
lua_State *L;
- static luaL_Reg coreLib[12];
+ static luaL_Reg coreLib[13];
void Preload(const char *name, lua_CFunction func);