plugins/include/lang.inc
author David Anderson <dvander@alliedmods.net>
Wed Aug 08 02:27:10 2007 +0000 (2007-08-08)
changeset 1269 27397584df9c
parent 1126 a21f31133894
child 1330 ab94316bb52b
permissions -rw-r--r--
- massive overhaul of the voting subsystem
- NOTE: menu API compatibility was COMPLETELY broken for C++!
- cleaned up various aspects of the menu API
- implemented new extended vote results callback
- extended the debug reporter a tiny bit
faluco@389
     1
/**
ds@475
     2
 * vim: set ts=4 :
faluco@389
     3
 * ===============================================================
faluco@389
     4
 * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
faluco@389
     5
 * ===============================================================
faluco@389
     6
 *
faluco@389
     7
 *  This file is part of the SourceMod/SourcePawn SDK.  This file may only be used 
faluco@389
     8
 * or modified under the Terms and Conditions of its License Agreement, which is found 
faluco@389
     9
 * in LICENSE.txt.  The Terms and Conditions for making SourceMod extensions/plugins 
faluco@389
    10
 * may change at any time.  To view the latest information, see:
faluco@389
    11
 *   http://www.sourcemod.net/license.php
faluco@389
    12
 *
faluco@389
    13
 * Version: $Id$
faluco@389
    14
 */
faluco@389
    15
faluco@389
    16
#if defined _lang_included
faluco@389
    17
 #endinput
faluco@389
    18
#endif
faluco@389
    19
#define _lang_included
faluco@389
    20
ds@672
    21
#define LANG_SERVER		0		/**< Translate using the server's language */
ds@672
    22
faluco@389
    23
/**
dvander@812
    24
 * Loads a translation file for the plugin calling this native.
dvander@1014
    25
 * If no extension is specified, .txt is assumed.
faluco@389
    26
 *
faluco@389
    27
 * @param path		Translation file.
faluco@389
    28
 * @noreturn
faluco@389
    29
 */
ds@475
    30
native LoadTranslations(const String:file[]);
dvander@1034
    31
dvander@1034
    32
/**
dvander@1034
    33
 * Sets the global language target.  This is useful for creating functions
dvander@1034
    34
 * that will be compatible with the %t format specifier.  Note that invalid
dvander@1034
    35
 * indexes can be specified but the error will occur during translation,
dvander@1034
    36
 * not during this function call.
dvander@1034
    37
 *
dvander@1034
    38
 * @param client	Client index or LANG_SERVER.
dvander@1034
    39
 * @noreturn
dvander@1034
    40
 */
dvander@1034
    41
native SetGlobalTransTarget(client);
dvander@1105
    42
dvander@1105
    43
/**
dvander@1105
    44
 * Retrieves the language number of a client.
dvander@1105
    45
 * Currently this simply returns the server language index.
dvander@1105
    46
 *
dvander@1105
    47
 * @param client	Client index.
dvander@1105
    48
 * @return			Language number client is using.
dvander@1105
    49
 * @error			Invalid client index or client not in game.
dvander@1105
    50
 */
dvander@1105
    51
native GetClientLanguage(client);
dvander@1105
    52
dvander@1105
    53
/**
dvander@1105
    54
 * Retrieves the server's language.
dvander@1105
    55
 *
dvander@1105
    56
 * @return			Language number server is using.
dvander@1105
    57
 */
ds@1126
    58
native GetServerLanguage();
dvander@1105
    59
dvander@1105
    60
/**
dvander@1105
    61
 * Returns the number of languages known in languages.cfg.
dvander@1105
    62
 *
dvander@1105
    63
 * @return			Language count.
dvander@1105
    64
 */
dvander@1105
    65
native GetLanguageCount();
dvander@1105
    66
dvander@1105
    67
/**
dvander@1105
    68
 * Retrieves info about a given language number.
dvander@1105
    69
 *
dvander@1105
    70
 * @param language	Language number.
dvander@1105
    71
 * @param code		Language code buffer (2-3 characters usually).
dvander@1105
    72
 * @param codeLen	Maximum length of the language code buffer.
dvander@1105
    73
 * @param name		Language name buffer.
dvander@1105
    74
 * @param nameLen	Maximum length of the language name buffer.
dvander@1105
    75
 * @noreturn
dvander@1105
    76
 * @error			Invalid language number.
dvander@1105
    77
 */
dvander@1105
    78
native GetLanguageInfo(language, String:code[]="", codeLen=0, String:name[]="", nameLen=0);
dvander@1105
    79