core/CTranslator.h
changeset 382 65a7ea52f5b0
parent 370 d3a484f98f6d
child 515 643240c66787
     1.1 --- a/core/CTranslator.h	Fri Jan 26 19:35:33 2007 +0000
     1.2 +++ b/core/CTranslator.h	Fri Jan 26 22:37:54 2007 +0000
     1.3 @@ -43,10 +43,17 @@
     1.4  
     1.5  struct Translation
     1.6  {
     1.7 -	const char *szPhrase;
     1.8 -	unsigned int lang_id;
     1.9 -	unsigned int file_id;
    1.10 -	void **params;
    1.11 +	const char *szPhrase;		/**< Translated phrase. */
    1.12 +	unsigned int fmt_count;		/**< Number of format parameters. */
    1.13 +	int *fmt_order;				/**< Format phrase order. */
    1.14 +};
    1.15 +
    1.16 +enum TransError
    1.17 +{
    1.18 +	Trans_Okay = 0,
    1.19 +	Trans_BadLanguage = 1,
    1.20 +	Trans_BadPhrase = 2,
    1.21 +	Trans_BadPhraseLanguage = 3
    1.22  };
    1.23  
    1.24  class CPhraseFile : public ITextListener_SMC
    1.25 @@ -57,7 +64,7 @@
    1.26  public:
    1.27  	void ReparseFile();
    1.28  	const char *GetFilename();
    1.29 -	const char *GetTranslation(const Translation *pTrans, int **fmt_order, unsigned int *fmt_count);
    1.30 +	TransError GetTranslation(const char *szPhrase, unsigned int lang_id, Translation *pTrans);
    1.31  public: //ITextListener_SMC
    1.32  	void ReadSMC_ParseStart();
    1.33  	void ReadSMC_ParseEnd(bool halted, bool failed);
    1.34 @@ -99,7 +106,8 @@
    1.35  	BaseStringTable *GetStringTable();
    1.36  	unsigned int GetLanguageCount();
    1.37  	bool GetLanguageByCode(const char *code, unsigned int *index);
    1.38 -	size_t Translate(char *buffer, size_t maxlength, const Translation *pTrans);
    1.39 +	size_t Translate(char *buffer, size_t maxlength, void **params, const Translation *pTrans);
    1.40 +	CPhraseFile *GetFileByIndex(unsigned int index);
    1.41  private:
    1.42  	CVector<Language *> m_Languages;
    1.43  	CVector<CPhraseFile *> m_Files;