Fix broken translating in some plugins and natives (bug 5612, r=psychonic).

This commit is contained in:
Kyle Sanderson 2013-08-25 10:15:35 -04:00
parent 2b6257e94e
commit 7e2afacf34
6 changed files with 11 additions and 9 deletions

View File

@ -1106,6 +1106,8 @@ static cell_t FakeClientCommand(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Client %d is not connected", params[1]);
}
g_SourceMod.SetGlobalTarget(params[1]);
char buffer[256];
g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 2);
@ -1137,6 +1139,8 @@ static cell_t FakeClientCommandEx(IPluginContext *pContext, const cell_t *params
return pContext->ThrowNativeError("Client %d is not connected", params[1]);
}
g_SourceMod.SetGlobalTarget(params[1]);
char buffer[256];
g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 2);
@ -1185,8 +1189,6 @@ static cell_t ReplyToCommand(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Client %d is not connected", params[1]);
}
g_SourceMod.SetGlobalTarget(params[1]);
unsigned int replyto = g_ChatTriggers.GetReplyTo();
if (replyto == SM_REPLY_CONSOLE)
{

View File

@ -414,6 +414,7 @@ static cell_t ShowSyncHudText(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Client %d is not in-game", client);
}
g_SourceMod.SetGlobalTarget(client);
g_SourceMod.FormatString(message_buffer, sizeof(message_buffer), pContext, params, 3);
if (pContext->GetLastNativeError() != SP_ERROR_NONE)
{
@ -486,6 +487,7 @@ static cell_t ShowHudText(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Client %d is not in-game", client);
}
g_SourceMod.SetGlobalTarget(client);
g_SourceMod.FormatString(message_buffer, sizeof(message_buffer), pContext, params, 3);
if (pContext->GetLastNativeError() != SP_ERROR_NONE)
{

View File

@ -844,8 +844,6 @@ static cell_t SetMenuTitle(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Menu handle %x is invalid (error %d)", hndl, err);
}
g_SourceMod.SetGlobalTarget(SOURCEMOD_SERVER_LANGUAGE);
char buffer[1024];
g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 2);

View File

@ -82,7 +82,7 @@ public Action:HelpCmd(client, args)
new Flags;
new Handle:CmdIter = GetCommandIterator();
FormatEx(NoDesc, sizeof(NoDesc), "%t", "No description available");
FormatEx(NoDesc, sizeof(NoDesc), "%T", "No description available", client);
if (DoSearch)
{

View File

@ -175,9 +175,9 @@ public Action:Command_Who(client, args)
{
/* Display header */
decl String:t_access[16], String:t_name[16], String:t_username[16];
Format(t_access, sizeof(t_access), "%t", "Admin access", client);
Format(t_name, sizeof(t_name), "%t", "Name", client);
Format(t_username, sizeof(t_username), "%t", "Username", client);
Format(t_access, sizeof(t_access), "%T", "Admin access", client);
Format(t_name, sizeof(t_name), "%T", "Name", client);
Format(t_username, sizeof(t_username), "%T", "Username", client);
if (is_admin)
{

View File

@ -260,7 +260,7 @@ public Action:Command_Nominate(client, args)
AttemptNominate(client)
{
SetMenuTitle(g_MapMenu, "%t", "Nominate Title", client);
SetMenuTitle(g_MapMenu, "%T", "Nominate Title", client);
DisplayMenu(g_MapMenu, client, MENU_TIME_FOREVER);
return;