- renamed translation files from .cfg -> .txt

- renamed trans core file to core.phrases.txt
- renamed trans common file to common.phrases.txt
- added some backwards compat so this doesn't break everyone's plugins

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401019
This commit is contained in:
David Anderson 2007-06-24 21:14:06 +00:00
parent c5b593a275
commit 28d24a7f97
9 changed files with 15 additions and 6 deletions

View File

@ -105,10 +105,18 @@ void CPhraseFile::ReparseFile()
char path[PLATFORM_MAX_PATH];
g_SourceMod.BuildPath(Path_SM, path, PLATFORM_MAX_PATH, "translations/%s", m_File.c_str());
/* :HACKHACK: If we're looking for a .txt, see if a .cfg also exists if our .txt does not. */
//backwards compatibility shim
/* :HACKHACK: Change .cfg/.txt and vice versa for compatibility */
if (!g_LibSys.PathExists(path))
{
UTIL_ReplaceAll(path, sizeof(path), ".txt", ".cfg");
if (m_File.compare("common.cfg") == 0)
{
UTIL_ReplaceAll(path, sizeof(path), "common.cfg", "common.phrases.txt");
} else if (strstr(path, ".cfg")) {
UTIL_ReplaceAll(path, sizeof(path), ".cfg", ".txt");
} else if (strstr(path, ".txt")) {
UTIL_ReplaceAll(path, sizeof(path), ".txt", ".cfg");
}
}
unsigned int line=0, col=0;
@ -660,6 +668,7 @@ void Translator::OnSourceModAllInitialized()
unsigned int id;
//backwards compatibility shim
/* hack -- if core.cfg exists, exec it instead. */
char path[PLATFORM_MAX_PATH];
g_SourceMod.BuildPath(Path_SM, path, sizeof(path), "translations/core.cfg");

View File

@ -40,7 +40,7 @@ new Handle:sm_flood_time; /* Handle to sm_flood_time convar */
public OnPluginStart()
{
LoadTranslations("plugin.antiflood.cfg");
LoadTranslations("plugin.antiflood.txt");
RegConsoleCmd("say", CheckChatFlood);
RegConsoleCmd("say_team", CheckChatFlood);

View File

@ -39,8 +39,8 @@ new Handle:hBanRemoved = INVALID_HANDLE;
public OnPluginStart()
{
LoadTranslations("common.cfg");
LoadTranslations("plugin.basecommands.cfg");
LoadTranslations("common.phrases.txt");
LoadTranslations("plugin.basecommands.txt");
RegAdminCmd("sm_kick", Command_Kick, ADMFLAG_KICK, "sm_kick <#userid|name> [reason]");
RegAdminCmd("sm_map", Command_Map, ADMFLAG_CHANGEMAP, "sm_map <map>");
RegAdminCmd("sm_rcon", Command_Rcon, ADMFLAG_RCON, "sm_rcon <args>");

View File

@ -43,7 +43,7 @@ new Handle:sv_visiblemaxplayers;
public OnPluginStart()
{
LoadTranslations("plugin.reservedslots.cfg");
LoadTranslations("plugin.reservedslots.txt");
sm_reserved_slots = CreateConVar("sm_reserved_slots", "0", "Number of reserved player slots", 0, true, 0.0);
sm_hide_slots = CreateConVar("sm_hide_slots", "0", "If set to 1, reserved slots will hidden (subtracted from the max slot count)", 0, true, 0.0, true, 1.0);