|
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 |
* |
|
erik@3967
|
44 |
* @param file 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. |
|
aangione@3413
|
66 |
* @error Invalid client index or client not connected. |
|
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 |
|
|
GoD-Tony@3208
|
97 |
/** |
|
GoD-Tony@3208
|
98 |
* Sets the language number of a client. |
|
GoD-Tony@3208
|
99 |
* |
|
GoD-Tony@3208
|
100 |
* @param client Client index. |
|
GoD-Tony@3208
|
101 |
* @param language Language number. |
|
GoD-Tony@3208
|
102 |
* @noreturn |
|
aangione@3413
|
103 |
* @error Invalid client index or client not connected. |
|
GoD-Tony@3208
|
104 |
*/ |
|
GoD-Tony@3208
|
105 |
native SetClientLanguage(client, language); |
|
GoD-Tony@3208
|
106 |
|
|
GoD-Tony@3208
|
107 |
/** |
|
GoD-Tony@3208
|
108 |
* Retrieves the language number from a language code. |
|
GoD-Tony@3208
|
109 |
* |
|
GoD-Tony@3208
|
110 |
* @param code Language code (2-3 characters usually). |
|
GoD-Tony@3208
|
111 |
* @return Language number. -1 if not found. |
|
GoD-Tony@3208
|
112 |
*/ |
|
GoD-Tony@3208
|
113 |
native GetLanguageByCode(const String:code[]); |
|
GoD-Tony@3208
|
114 |
|
|
GoD-Tony@3208
|
115 |
/** |
|
GoD-Tony@3208
|
116 |
* Retrieves the language number from a language name. |
|
GoD-Tony@3208
|
117 |
* |
|
GoD-Tony@3208
|
118 |
* @param name Language name (case insensitive). |
|
GoD-Tony@3208
|
119 |
* @return Language number. -1 if not found. |
|
GoD-Tony@3208
|
120 |
*/ |
|
GoD-Tony@3208
|
121 |
native GetLanguageByName(const String:name[]); |