Exposed GetLanguageInfo in ITranslator interface (bug 5249, r=asherkin).
authorRyan Stecker <voidedweasel@gmail.com>
Mon May 28 00:58:59 2012 +0100 (2012-05-28)
changeset 353288a0d2c30bc3
parent 3531 1fccac8685a8
child 3533 f35b66137b06
Exposed GetLanguageInfo in ITranslator interface (bug 5249, r=asherkin).
core/logic/Translator.h
public/ITranslator.h
     1.1 --- a/core/logic/Translator.h	Mon May 28 00:52:59 2012 +0100
     1.2 +++ b/core/logic/Translator.h	Mon May 28 00:58:59 2012 +0100
     1.3 @@ -119,7 +119,6 @@
     1.4  	unsigned int FindOrAddPhraseFile(const char *phrase_file);
     1.5  	BaseStringTable *GetStringTable();
     1.6  	unsigned int GetLanguageCount();
     1.7 -	bool GetLanguageInfo(unsigned int number, const char **code, const char **name);
     1.8  	bool GetLanguageByCode(const char *code, unsigned int *index);
     1.9  	bool GetLanguageByName(const char *name, unsigned int *index);
    1.10  	CPhraseFile *GetFileByIndex(unsigned int index);
    1.11 @@ -146,6 +145,7 @@
    1.12  		unsigned int numparams,
    1.13  		size_t *pOutLength,
    1.14  		const char **pFailPhrase);
    1.15 +	bool GetLanguageInfo(unsigned int number, const char **code, const char **name);
    1.16  private:
    1.17  	bool AddLanguage(const char *langcode, const char *description);
    1.18  private:
     2.1 --- a/public/ITranslator.h	Mon May 28 00:52:59 2012 +0100
     2.2 +++ b/public/ITranslator.h	Mon May 28 00:58:59 2012 +0100
     2.3 @@ -35,7 +35,7 @@
     2.4  #include <IShareSys.h>
     2.5  
     2.6  #define SMINTERFACE_TRANSLATOR_NAME		"ITranslator"
     2.7 -#define SMINTERFACE_TRANSLATOR_VERSION	2
     2.8 +#define SMINTERFACE_TRANSLATOR_VERSION	3
     2.9  
    2.10  #define MAX_TRANSLATE_PARAMS		32
    2.11  #define CORELANG_ENGLISH			0
    2.12 @@ -341,6 +341,16 @@
    2.13  		 * @return                  True if found, false otherwise.
    2.14  		 */
    2.15  		virtual bool GetLanguageByName(const char *name, unsigned int *index) =0;
    2.16 +
    2.17 +		/**
    2.18 +		 * @brief Retrieves info about a given language number.
    2.19 +		 *
    2.20 +		 * @param number            Language number.
    2.21 +		 * @param code              Pointer to store the language code.
    2.22 +		 * @param name              Pointer to store language name.
    2.23 +		 * @return                  True if language number is valid, false otherwise.
    2.24 +		 */
    2.25 +		virtual bool GetLanguageInfo(unsigned int number, const char **code, const char **name) =0;
    2.26  	};
    2.27  }
    2.28