plugins/include/lang.inc
author Scott Ehlert <ds@alliedmods.net>
Sun Mar 30 07:00:22 2008 +0000 (2008-03-30)
changeset 1952 b7aa2b626807
child 2289 44045ead61cd
permissions -rw-r--r--
Spring Cleaning, Part Ichi (1)
Various minor things done to project files
Updated sample extension project file and updated makefile to the new unified version (more changes likely on the way)
Updated regex project file and makefile
     1 /**
     2  * vim: set ts=4 :
     3  * =============================================================================
     4  * SourceMod (C)2004-2008 AlliedModders LLC.  All rights reserved.
     5  * =============================================================================
     6  *
     7  * This file is part of the SourceMod/SourcePawn SDK.
     8  *
     9  * This program is free software; you can redistribute it and/or modify it under
    10  * the terms of the GNU General Public License, version 3.0, as published by the
    11  * Free Software Foundation.
    12  * 
    13  * This program is distributed in the hope that it will be useful, but WITHOUT
    14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    15  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
    16  * details.
    17  *
    18  * You should have received a copy of the GNU General Public License along with
    19  * this program.  If not, see <http://www.gnu.org/licenses/>.
    20  *
    21  * As a special exception, AlliedModders LLC gives you permission to link the
    22  * code of this program (as well as its derivative works) to "Half-Life 2," the
    23  * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
    24  * by the Valve Corporation.  You must obey the GNU General Public License in
    25  * all respects for all other code used.  Additionally, AlliedModders LLC grants
    26  * this exception to all derivative works.  AlliedModders LLC defines further
    27  * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
    28  * or <http://www.sourcemod.net/license.php>.
    29  *
    30  * Version: $Id$
    31  */
    32 
    33 #if defined _lang_included
    34  #endinput
    35 #endif
    36 #define _lang_included
    37 
    38 #define LANG_SERVER		0		/**< Translate using the server's language */
    39 
    40 /**
    41  * Loads a translation file for the plugin calling this native.
    42  * If no extension is specified, .txt is assumed.
    43  *
    44  * @param path		Translation file.
    45  * @noreturn
    46  */
    47 native LoadTranslations(const String:file[]);
    48 
    49 /**
    50  * Sets the global language target.  This is useful for creating functions
    51  * that will be compatible with the %t format specifier.  Note that invalid
    52  * indexes can be specified but the error will occur during translation,
    53  * not during this function call.
    54  *
    55  * @param client	Client index or LANG_SERVER.
    56  * @noreturn
    57  */
    58 native SetGlobalTransTarget(client);
    59 
    60 /**
    61  * Retrieves the language number of a client.
    62  * Currently this simply returns the server language index.
    63  *
    64  * @param client	Client index.
    65  * @return			Language number client is using.
    66  * @error			Invalid client index or client not in game.
    67  */
    68 native GetClientLanguage(client);
    69 
    70 /**
    71  * Retrieves the server's language.
    72  *
    73  * @return			Language number server is using.
    74  */
    75 native GetServerLanguage();
    76 
    77 /**
    78  * Returns the number of languages known in languages.cfg.
    79  *
    80  * @return			Language count.
    81  */
    82 native GetLanguageCount();
    83 
    84 /**
    85  * Retrieves info about a given language number.
    86  *
    87  * @param language	Language number.
    88  * @param code		Language code buffer (2-3 characters usually).
    89  * @param codeLen	Maximum length of the language code buffer.
    90  * @param name		Language name buffer.
    91  * @param nameLen	Maximum length of the language name buffer.
    92  * @noreturn
    93  * @error			Invalid language number.
    94  */
    95 native GetLanguageInfo(language, String:code[]="", codeLen=0, String:name[]="", nameLen=0);
    96