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