32 #ifndef _INCLUDE_SOURCEMOD_TRANSLATOR_INTERFACE_H_
33 #define _INCLUDE_SOURCEMOD_TRANSLATOR_INTERFACE_H_
37 #define SMINTERFACE_TRANSLATOR_NAME "ITranslator"
38 #define SMINTERFACE_TRANSLATOR_VERSION 4
40 #define MAX_TRANSLATE_PARAMS 32
41 #define CORELANG_ENGLISH 0
55 #define SOURCEMOD_LANGUAGE_ENGLISH 0
61 #define SOURCEMOD_SERVER_LANGUAGE 0
69 Trans_BadLanguage = 1,
71 Trans_BadPhraseLanguage = 3,
72 Trans_BadPhraseFile = 4,
106 const char *szPhrase,
107 unsigned int lang_id,
221 unsigned int numparams,
223 const char **pFailPhrase) =0;
325 unsigned int numparams,
327 const char **pFailPhrase) =0;
353 virtual bool GetLanguageInfo(
unsigned int number,
const char **code,
const char **name) =0;
362 #endif //_INCLUDE_SOURCEMOD_TRANSLATOR_INTERFACE_H_
virtual bool FormatString(char *buffer, size_t maxlength, const char *format, void **params, unsigned int numparams, size_t *pOutLength, const char **pFailPhrase)=0
Formats a phrase given a parameter stack. The parameter stack size must exactly match the expected pa...
virtual IPhraseFile * AddPhraseFile(const char *filename)=0
Adds a phrase file to the collection, using a cached one if already found. The return value is provid...
virtual const char * GetInterfaceName()=0
Must return a string defining the interface's unique name.
const char * szPhrase
Definition: ITranslator.h:80
virtual unsigned int GetInterfaceVersion()=0
Must return an integer defining the interface's version.
virtual int SetGlobalTarget(int index)=0
Sets the global client SourceMod will use for assisted translations (that is, t). ...
virtual unsigned int GetLanguageCount()=0
Get number of languages.
unsigned int fmt_count
Definition: ITranslator.h:81
virtual unsigned int GetServerLanguage()=0
Returns the server language.
virtual unsigned int GetClientLanguage(int client)=0
Returns a client's language.
virtual int GetGlobalTarget() const =0
Returns the global client SourceMod is currently using for assisted translations (that is...
Defines the Share System, responsible for shared resources and dependencies.
Defines the base functionality required by a shared interface.
Definition: IShareSys.h:92
virtual unsigned int GetFileCount()=0
Returns the number of contained phrase files.
virtual const char * GetFilename()=0
Returns the file name of this translation file.
Provides functions for translation.
Definition: ITranslator.h:229
virtual bool GetLanguageByName(const char *name, unsigned int *index)=0
Find a language number by name.
Definition: ITranslator.h:121
virtual bool FormatString(char *buffer, size_t maxlength, const char *format, IPhraseCollection *pPhrases, void **params, unsigned int numparams, size_t *pOutLength, const char **pFailPhrase)=0
Formats a phrase given a parameter stack. The parameter stack size must exactly match the expected pa...
virtual void Destroy()=0
Destroys the phrase collection, freeing all internal resources and invalidating the object...
virtual void RebuildLanguageDatabase()=0
Reparses all loaded translations files.
virtual IPhraseFile * GetFile(unsigned int file)=0
Returns the pointer to a contained phrase file.
Definition: IAdminSystem.h:63
virtual bool GetLanguageInfo(unsigned int number, const char **code, const char **name)=0
Retrieves info about a given language number.
Contains information about a translation phrase.
Definition: ITranslator.h:78
virtual TransError FindTranslation(const char *key, unsigned int langid, Translation *pTrans)=0
Attempts a translation across a given language. All contained files are searched for an appropriate m...
int * fmt_order
Definition: ITranslator.h:82
virtual IPhraseCollection * CreatePhraseCollection()=0
Creates a new phrase collection object.
Represents a phrase file from SourceMod's "translations" folder.
Definition: ITranslator.h:92
virtual TransError GetTranslation(const char *szPhrase, unsigned int lang_id, Translation *pTrans)=0
Attempts to find a translation phrase in a phrase file.