2008-10-04 22:59:11 +02:00
|
|
|
/**
|
|
|
|
* vim: set ts=4 :
|
|
|
|
* =============================================================================
|
2009-04-14 23:40:48 +02:00
|
|
|
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
|
2008-10-04 22:59:11 +02:00
|
|
|
* =============================================================================
|
|
|
|
*
|
|
|
|
* This file is part of the SourceMod/SourcePawn SDK.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it under
|
|
|
|
* the terms of the GNU General Public License, version 3.0, as published by the
|
|
|
|
* Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
|
|
* details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* As a special exception, AlliedModders LLC gives you permission to link the
|
|
|
|
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
|
|
|
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
|
|
|
* by the Valve Corporation. You must obey the GNU General Public License in
|
|
|
|
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
|
|
|
* this exception to all derivative works. AlliedModders LLC defines further
|
|
|
|
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
|
|
|
* or <http://www.sourcemod.net/license.php>.
|
|
|
|
*
|
2009-04-14 23:40:48 +02:00
|
|
|
* Version: $Id$
|
2008-10-04 22:59:11 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#if defined _lang_included
|
|
|
|
#endinput
|
|
|
|
#endif
|
|
|
|
#define _lang_included
|
|
|
|
|
|
|
|
#define LANG_SERVER 0 /**< Translate using the server's language */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Loads a translation file for the plugin calling this native.
|
|
|
|
* If no extension is specified, .txt is assumed.
|
|
|
|
*
|
2014-07-30 11:03:42 +02:00
|
|
|
* @param file Translation file.
|
2008-10-04 22:59:11 +02:00
|
|
|
*/
|
2016-08-23 15:34:00 +02:00
|
|
|
native void LoadTranslations(const char[] file);
|
2008-10-04 22:59:11 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the global language target. This is useful for creating functions
|
|
|
|
* that will be compatible with the %t format specifier. Note that invalid
|
|
|
|
* indexes can be specified but the error will occur during translation,
|
|
|
|
* not during this function call.
|
|
|
|
*
|
|
|
|
* @param client Client index or LANG_SERVER.
|
|
|
|
*/
|
2016-08-23 15:34:00 +02:00
|
|
|
native void SetGlobalTransTarget(int client);
|
2008-10-04 22:59:11 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieves the language number of a client.
|
|
|
|
*
|
|
|
|
* @param client Client index.
|
|
|
|
* @return Language number client is using.
|
2012-01-28 02:16:49 +01:00
|
|
|
* @error Invalid client index or client not connected.
|
2008-10-04 22:59:11 +02:00
|
|
|
*/
|
2016-08-23 15:34:00 +02:00
|
|
|
native int GetClientLanguage(int client);
|
2008-10-04 22:59:11 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieves the server's language.
|
|
|
|
*
|
|
|
|
* @return Language number server is using.
|
|
|
|
*/
|
2016-08-23 15:34:00 +02:00
|
|
|
native int GetServerLanguage();
|
2008-10-04 22:59:11 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the number of languages known in languages.cfg.
|
|
|
|
*
|
|
|
|
* @return Language count.
|
|
|
|
*/
|
2016-08-23 15:34:00 +02:00
|
|
|
native int GetLanguageCount();
|
2008-10-04 22:59:11 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieves info about a given language number.
|
|
|
|
*
|
|
|
|
* @param language Language number.
|
|
|
|
* @param code Language code buffer (2-3 characters usually).
|
|
|
|
* @param codeLen Maximum length of the language code buffer.
|
|
|
|
* @param name Language name buffer.
|
|
|
|
* @param nameLen Maximum length of the language name buffer.
|
|
|
|
* @error Invalid language number.
|
|
|
|
*/
|
2016-08-23 15:34:00 +02:00
|
|
|
native void GetLanguageInfo(int language, char[] code="", int codeLen=0, char[] name="", int nameLen=0);
|
2008-10-04 22:59:11 +02:00
|
|
|
|
2012-01-28 02:16:49 +01:00
|
|
|
/**
|
|
|
|
* Sets the language number of a client.
|
|
|
|
*
|
|
|
|
* @param client Client index.
|
|
|
|
* @param language Language number.
|
|
|
|
* @error Invalid client index or client not connected.
|
|
|
|
*/
|
2016-08-23 15:34:00 +02:00
|
|
|
native void SetClientLanguage(int client, int language);
|
2012-01-28 02:16:49 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieves the language number from a language code.
|
|
|
|
*
|
|
|
|
* @param code Language code (2-3 characters usually).
|
|
|
|
* @return Language number. -1 if not found.
|
|
|
|
*/
|
2016-08-23 15:34:00 +02:00
|
|
|
native int GetLanguageByCode(const char[] code);
|
2012-01-28 02:16:49 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieves the language number from a language name.
|
|
|
|
*
|
|
|
|
* @param name Language name (case insensitive).
|
|
|
|
* @return Language number. -1 if not found.
|
|
|
|
*/
|
2016-08-23 15:34:00 +02:00
|
|
|
native int GetLanguageByName(const char[] name);
|