From 7e2afacf347125f314661d631b5ffda13020f236 Mon Sep 17 00:00:00 2001 From: Kyle Sanderson Date: Sun, 25 Aug 2013 10:15:35 -0400 Subject: [PATCH] Fix broken translating in some plugins and natives (bug 5612, r=psychonic). --- core/smn_console.cpp | 6 ++++-- core/smn_hudtext.cpp | 2 ++ core/smn_menus.cpp | 2 -- plugins/adminhelp.sp | 2 +- plugins/basecommands/who.sp | 6 +++--- plugins/nominations.sp | 2 +- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/core/smn_console.cpp b/core/smn_console.cpp index e4a4e039..36493dd5 100644 --- a/core/smn_console.cpp +++ b/core/smn_console.cpp @@ -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) { diff --git a/core/smn_hudtext.cpp b/core/smn_hudtext.cpp index d7eb30d2..d1188e51 100644 --- a/core/smn_hudtext.cpp +++ b/core/smn_hudtext.cpp @@ -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) { diff --git a/core/smn_menus.cpp b/core/smn_menus.cpp index c863bd79..9bae9f1b 100644 --- a/core/smn_menus.cpp +++ b/core/smn_menus.cpp @@ -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); diff --git a/plugins/adminhelp.sp b/plugins/adminhelp.sp index a13269f1..3e927229 100644 --- a/plugins/adminhelp.sp +++ b/plugins/adminhelp.sp @@ -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) { diff --git a/plugins/basecommands/who.sp b/plugins/basecommands/who.sp index 2897d14b..6011406c 100644 --- a/plugins/basecommands/who.sp +++ b/plugins/basecommands/who.sp @@ -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) { diff --git a/plugins/nominations.sp b/plugins/nominations.sp index b6554341..c00e1e6f 100644 --- a/plugins/nominations.sp +++ b/plugins/nominations.sp @@ -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;