From b3b1978d102301a677faea606a84342c6e28c6d6 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 27 Jan 2007 04:21:11 +0000 Subject: [PATCH] exposed translation natives and fixed build --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40402 --- core/CTranslator.cpp | 10 ++++++++++ core/smn_lang.cpp | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/core/CTranslator.cpp b/core/CTranslator.cpp index bf4369df..059f1366 100644 --- a/core/CTranslator.cpp +++ b/core/CTranslator.cpp @@ -737,6 +737,16 @@ SMCParseResult CTranslator::ReadSMC_KeyValue(const char *key, const char *value, return SMCParse_Continue; } +CPhraseFile *CTranslator::GetFileByIndex(unsigned int index) +{ + if (index >= m_Files.size()) + { + return NULL; + } + + return m_Files[index]; +} + size_t CTranslator::Translate(char *buffer, size_t maxlength, void **params, const Translation *pTrans) { void *new_params[MAX_TRANSLATE_PARAMS]; diff --git a/core/smn_lang.cpp b/core/smn_lang.cpp index f6d3728f..a0eefde3 100644 --- a/core/smn_lang.cpp +++ b/core/smn_lang.cpp @@ -27,3 +27,9 @@ static cell_t sm_LoadTranslations(IPluginContext *pCtx, const cell_t *params) return 1; } + +REGISTER_NATIVES(langNativeS) +{ + {"LoadTranslations", sm_LoadTranslations}, + {NULL, NULL}, +};