diff --git a/core/logic/Translator.h b/core/logic/Translator.h index ccb4001f..0780f411 100644 --- a/core/logic/Translator.h +++ b/core/logic/Translator.h @@ -119,7 +119,6 @@ public: unsigned int FindOrAddPhraseFile(const char *phrase_file); BaseStringTable *GetStringTable(); unsigned int GetLanguageCount(); - bool GetLanguageInfo(unsigned int number, const char **code, const char **name); bool GetLanguageByCode(const char *code, unsigned int *index); bool GetLanguageByName(const char *name, unsigned int *index); CPhraseFile *GetFileByIndex(unsigned int index); @@ -146,6 +145,7 @@ public: //ITranslator unsigned int numparams, size_t *pOutLength, const char **pFailPhrase); + bool GetLanguageInfo(unsigned int number, const char **code, const char **name); private: bool AddLanguage(const char *langcode, const char *description); private: diff --git a/public/ITranslator.h b/public/ITranslator.h index 74840728..79aefec1 100644 --- a/public/ITranslator.h +++ b/public/ITranslator.h @@ -35,7 +35,7 @@ #include #define SMINTERFACE_TRANSLATOR_NAME "ITranslator" -#define SMINTERFACE_TRANSLATOR_VERSION 2 +#define SMINTERFACE_TRANSLATOR_VERSION 3 #define MAX_TRANSLATE_PARAMS 32 #define CORELANG_ENGLISH 0 @@ -341,6 +341,16 @@ namespace SourceMod * @return True if found, false otherwise. */ virtual bool GetLanguageByName(const char *name, unsigned int *index) =0; + + /** + * @brief Retrieves info about a given language number. + * + * @param number Language number. + * @param code Pointer to store the language code. + * @param name Pointer to store language name. + * @return True if language number is valid, false otherwise. + */ + virtual bool GetLanguageInfo(unsigned int number, const char **code, const char **name) =0; }; }