faluco@389: /**
ds@475: * vim: set ts=4 :
ds@1330: * =============================================================================
ds@1947: * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
ds@1330: * =============================================================================
ds@1330: *
ds@1330: * This file is part of the SourceMod/SourcePawn SDK.
faluco@389: *
ds@1330: * This program is free software; you can redistribute it and/or modify it under
ds@1330: * the terms of the GNU General Public License, version 3.0, as published by the
ds@1330: * Free Software Foundation.
ds@1330: *
ds@1330: * This program is distributed in the hope that it will be useful, but WITHOUT
ds@1330: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
ds@1330: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
ds@1330: * details.
ds@1330: *
ds@1330: * You should have received a copy of the GNU General Public License along with
ds@1330: * this program. If not, see .
ds@1330: *
ds@1330: * As a special exception, AlliedModders LLC gives you permission to link the
ds@1330: * code of this program (as well as its derivative works) to "Half-Life 2," the
ds@1330: * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
ds@1330: * by the Valve Corporation. You must obey the GNU General Public License in
ds@1330: * all respects for all other code used. Additionally, AlliedModders LLC grants
ds@1330: * this exception to all derivative works. AlliedModders LLC defines further
ds@1330: * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
ds@1330: * or .
faluco@389: *
faluco@389: * Version: $Id$
faluco@389: */
faluco@389:
faluco@389: #if defined _lang_included
faluco@389: #endinput
faluco@389: #endif
faluco@389: #define _lang_included
faluco@389:
ds@672: #define LANG_SERVER 0 /**< Translate using the server's language */
ds@672:
faluco@389: /**
dvander@812: * Loads a translation file for the plugin calling this native.
dvander@1014: * If no extension is specified, .txt is assumed.
faluco@389: *
faluco@389: * @param path Translation file.
faluco@389: * @noreturn
faluco@389: */
ds@475: native LoadTranslations(const String:file[]);
dvander@1034:
dvander@1034: /**
dvander@1034: * Sets the global language target. This is useful for creating functions
dvander@1034: * that will be compatible with the %t format specifier. Note that invalid
dvander@1034: * indexes can be specified but the error will occur during translation,
dvander@1034: * not during this function call.
dvander@1034: *
dvander@1034: * @param client Client index or LANG_SERVER.
dvander@1034: * @noreturn
dvander@1034: */
dvander@1034: native SetGlobalTransTarget(client);
dvander@1105:
dvander@1105: /**
dvander@1105: * Retrieves the language number of a client.
dvander@1105: * Currently this simply returns the server language index.
dvander@1105: *
dvander@1105: * @param client Client index.
dvander@1105: * @return Language number client is using.
aangione@3413: * @error Invalid client index or client not connected.
dvander@1105: */
dvander@1105: native GetClientLanguage(client);
dvander@1105:
dvander@1105: /**
dvander@1105: * Retrieves the server's language.
dvander@1105: *
dvander@1105: * @return Language number server is using.
dvander@1105: */
ds@1126: native GetServerLanguage();
dvander@1105:
dvander@1105: /**
dvander@1105: * Returns the number of languages known in languages.cfg.
dvander@1105: *
dvander@1105: * @return Language count.
dvander@1105: */
dvander@1105: native GetLanguageCount();
dvander@1105:
dvander@1105: /**
dvander@1105: * Retrieves info about a given language number.
dvander@1105: *
dvander@1105: * @param language Language number.
dvander@1105: * @param code Language code buffer (2-3 characters usually).
dvander@1105: * @param codeLen Maximum length of the language code buffer.
dvander@1105: * @param name Language name buffer.
dvander@1105: * @param nameLen Maximum length of the language name buffer.
dvander@1105: * @noreturn
dvander@1105: * @error Invalid language number.
dvander@1105: */
dvander@1105: native GetLanguageInfo(language, String:code[]="", codeLen=0, String:name[]="", nameLen=0);
dvander@1105:
GoD-Tony@3208: /**
GoD-Tony@3208: * Sets the language number of a client.
GoD-Tony@3208: *
GoD-Tony@3208: * @param client Client index.
GoD-Tony@3208: * @param language Language number.
GoD-Tony@3208: * @noreturn
aangione@3413: * @error Invalid client index or client not connected.
GoD-Tony@3208: */
GoD-Tony@3208: native SetClientLanguage(client, language);
GoD-Tony@3208:
GoD-Tony@3208: /**
GoD-Tony@3208: * Retrieves the language number from a language code.
GoD-Tony@3208: *
GoD-Tony@3208: * @param code Language code (2-3 characters usually).
GoD-Tony@3208: * @return Language number. -1 if not found.
GoD-Tony@3208: */
GoD-Tony@3208: native GetLanguageByCode(const String:code[]);
GoD-Tony@3208:
GoD-Tony@3208: /**
GoD-Tony@3208: * Retrieves the language number from a language name.
GoD-Tony@3208: *
GoD-Tony@3208: * @param name Language name (case insensitive).
GoD-Tony@3208: * @return Language number. -1 if not found.
GoD-Tony@3208: */
GoD-Tony@3208: native GetLanguageByName(const String:name[]);