core/smn_lang.cpp
author David Anderson <dvander@alliedmods.net>
Sun Jun 17 07:32:31 2007 +0000 (2007-06-17)
changeset 969 0cd7fc27e054
parent 653 ef60870067ff
child 1014 26aab5a1e2ba
permissions -rw-r--r--
fixed a state bug in the gameconf parser that would break parsing after a signature section was done
faluco@389
     1
/**
ds@653
     2
 * vim: set ts=4 :
faluco@389
     3
 * ===============================================================
faluco@389
     4
 * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
faluco@389
     5
 * ===============================================================
faluco@389
     6
 *
faluco@389
     7
 * This file is not open source and may not be copied without explicit
faluco@389
     8
 * written permission of AlliedModders LLC.  This file may not be redistributed 
faluco@389
     9
 * in whole or significant part.
faluco@389
    10
 * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
faluco@389
    11
 *
faluco@389
    12
 * Version: $Id$
faluco@389
    13
 */
faluco@389
    14
faluco@389
    15
#include "PluginSys.h"
dvander@591
    16
#include "Translator.h"
faluco@389
    17
faluco@389
    18
static cell_t sm_LoadTranslations(IPluginContext *pCtx, const cell_t *params)
faluco@389
    19
{
faluco@389
    20
	char *filename;
faluco@389
    21
	unsigned int index;
faluco@389
    22
	CPlugin *pl = (CPlugin *)g_PluginSys.FindPluginByContext(pCtx->GetContext());
faluco@389
    23
faluco@389
    24
	pCtx->LocalToString(params[1], &filename);
faluco@389
    25
faluco@389
    26
	index = g_Translator.FindOrAddPhraseFile(filename);
faluco@389
    27
	pl->AddLangFile(index);
faluco@389
    28
faluco@389
    29
	return 1;
faluco@389
    30
}
dvander@396
    31
dvander@396
    32
REGISTER_NATIVES(langNativeS)
dvander@396
    33
{
dvander@396
    34
	{"LoadTranslations",			sm_LoadTranslations},
dvander@396
    35
	{NULL,							NULL},
dvander@396
    36
};