summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/m_core.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-06-11 21:40:06 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-06-11 21:40:06 +0000
commit42e279369af861f61b08919650c10749191328cb (patch)
treefe7a574fc7a2d38efbf808ad65b114175751ebb1 /plugins/MirLua/src/m_core.cpp
parent11273c19170670e042fc1deebef7a3efbc31d5cf (diff)
MirLua: added MirLua: added ReplaceVariables to core module
git-svn-id: http://svn.miranda-ng.org/main/trunk@14128 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/m_core.cpp')
-rw-r--r--plugins/MirLua/src/m_core.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp
index 25d43a4964..e4c90da074 100644
--- a/plugins/MirLua/src/m_core.cpp
+++ b/plugins/MirLua/src/m_core.cpp
@@ -187,10 +187,20 @@ static int lua_CallService(lua_State *L)
static int lua_Translate(lua_State *L)
{
- char *value = (char*)luaL_checkstring(L, 1);
+ char *what = (char*)luaL_checkstring(L, 1);
- ptrT string(mir_utf8decodeT(value, NULL));
- lua_pushstring(L, T2Utf(TranslateTS(string)));
+ ptrT value(mir_utf8decodeT(what, NULL));
+ lua_pushstring(L, T2Utf(TranslateTS(value)));
+
+ return 1;
+}
+
+static int lua_ReplaceVariables(lua_State *L)
+{
+ char *what = (char*)luaL_checkstring(L, 1);
+
+ ptrT value(mir_utf8decodeT(what, NULL));
+ lua_pushstring(L, T2Utf(VARST(value)));
return 1;
}
@@ -214,6 +224,7 @@ luaL_Reg CMLua::coreLib[] =
{ "CallService", lua_CallService },
{ "Translate", lua_Translate },
+ { "ReplaceVariables", lua_ReplaceVariables },
{ NULL, NULL }
};