core/smn_lang.cpp
author David Anderson <dvander@alliedmods.net>
Thu Feb 08 01:11:45 2007 +0000 (2007-02-08)
changeset 453 7611078f11cd
parent 396 c0af59ee9ca4
child 591 86e97f3eda1f
permissions -rw-r--r--
added gameevents to the publicly available interfaces
faluco@389
     1
/**
faluco@389
     2
 * ===============================================================
faluco@389
     3
 * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
faluco@389
     4
 * ===============================================================
faluco@389
     5
 *
faluco@389
     6
 * This file is not open source and may not be copied without explicit
faluco@389
     7
 * written permission of AlliedModders LLC.  This file may not be redistributed 
faluco@389
     8
 * in whole or significant part.
faluco@389
     9
 * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
faluco@389
    10
 *
faluco@389
    11
 * Version: $Id$
faluco@389
    12
 */
faluco@389
    13
faluco@389
    14
#include "PluginSys.h"
faluco@389
    15
#include "CTranslator.h"
faluco@389
    16
faluco@389
    17
static cell_t sm_LoadTranslations(IPluginContext *pCtx, const cell_t *params)
faluco@389
    18
{
faluco@389
    19
	char *filename;
faluco@389
    20
	unsigned int index;
faluco@389
    21
	CPlugin *pl = (CPlugin *)g_PluginSys.FindPluginByContext(pCtx->GetContext());
faluco@389
    22
faluco@389
    23
	pCtx->LocalToString(params[1], &filename);
faluco@389
    24
faluco@389
    25
	index = g_Translator.FindOrAddPhraseFile(filename);
faluco@389
    26
	pl->AddLangFile(index);
faluco@389
    27
faluco@389
    28
	return 1;
faluco@389
    29
}
dvander@396
    30
dvander@396
    31
REGISTER_NATIVES(langNativeS)
dvander@396
    32
{
dvander@396
    33
	{"LoadTranslations",			sm_LoadTranslations},
dvander@396
    34
	{NULL,							NULL},
dvander@396
    35
};