Files
wagic/projects/mtg/include/Translate.h
wagic.the.homebrew@gmail.com 8390a94440 Erwan
- Language is now an option at startup
- "text" line translation for cards made easier, check Res/lang/xx_cards.txt
- TODO: test on PSP/Linux, performance issues ? Allow possibility to change language in options menu
2009-11-13 16:10:06 +00:00

40 lines
739 B
C++

#ifndef _TRANSLATE_H_
#define _TRANSLATE_H_
#include <string>
#include <map>
#if defined WIN32
#define DEBUG_TRANSLATE
#endif
using namespace std;
class Translator{
protected:
static Translator * mInstance;
bool initDone;
void load(string filename, map<string,string> * dictionary);
public:
map<string,string> values;
map<string,string> tempValues;
#if defined DEBUG_TRANSLATE
map<string,int> missingValues;
map<string,int> dontCareValues;
int checkMisses;
#endif
string translate(string toTranslate);
Translator();
~Translator();
int Add(string from, string to);
void initCards();
void init();
static Translator * GetInstance();
static void EndInstance();
};
string _(string toTranslate);
#endif