/*
 * Copyright (c) 2002, 2003, 2004 - Aleksander Naszko, Julien Laurent
 *
 *    This file is part of AMX Mod.
 *
 *    AMX Mod is free software; you can redistribute it and/or modify it
 *    under the terms of the GNU General Public License as published by the
 *    Free Software Foundation; either version 2 of the License, or (at
 *    your option) any later version.
 *
 *    AMX Mod is distributed in the hope that it will be useful, but
 *    WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with AMX Mod; if not, write to the Free Software Foundation,
 *    Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 *    In addition, as a special exception, the author gives permission to
 *    link the code of this program with the Half-Life Game Engine ("HL
 *    Engine") and Modified Game Libraries ("MODs") developed by Valve,
 *    L.L.C ("Valve").  You must obey the GNU General Public License in all
 *    respects for all of the code used other than the HL Engine and MODs
 *    from Valve.  If you modify this file, you may extend this exception
 *    to your version of the file, but you are not obligated to do so.  If
 *    you do not wish to do so, delete this exception statement from your
 *    version.
 *
 *    Version: $Id: translator.inc,v 1.1 2004/08/11 03:09:29 djeyl Exp $
 */

#if defined _translator_included
  #endinput
#endif
#define _translator_included


/* We want this file to be included first */
#assert !defined _amxmod_included
#assert !defined _amxmisc_included
#assert !defined _string_included


/* Must be called by plugins before using _T (generally in plugin_init) */
native load_translations(const file[]);


/* Translation backend, used by _T (since natives can't return arrays). */
native translate(const string[],destid=-1);


/* The magical translation function: _T
*
* destid sets the destination so that the string can be translated to the
* server's (destid=0) or client's (destid=1 to 32) language.
*
* destid MUST be omitted (anyway it will be ignored) with:
*   register_plugin (in plugin name)
*   register_srvcmd, register_clcmd, register_concmd (in command info)
*
* destid CAN be omitted (recommended btw) with:
*   client_print, engclient_print, console_print, server_print, show_hudmessage, client_cmd
*
* destid CANNOT be omitted (it would generate errors) with:
*   format, copy, add (of course _T can't be used as the destination for these functions)
*   equal, equali (_T can be used both for the 1st and the 2nd strings)
*                 (destid MUST be specified even if you use _T twice)
*
* _T cannot be used in other functions (you'll get weird things otherwise, don't even try :P)
*
*/
new TranslationResult[2] = {0, 0}
stock _T(const string[], destid=-1)
{
	TranslationResult[0] = translate(string,destid)
	return TranslationResult
}
