#include <mmstranslator.h>
Public Member Functions | |
MMSTranslator () | |
~MMSTranslator () | |
void | translate (const std::string &source, std::string &dest) |
bool | setTargetLang (MMSLanguage lang) |
MMSLanguage | getTargetLang () |
Static Public Attributes | |
static sigc::signal< void, MMSLanguage > | onTargetLangChanged |
Private Types | |
typedef std::map< MMSLanguage, int > | MMSTRANSLATION_INDEX |
This maps country codes (i.e. | |
typedef std::vector< std::string > | MMSTRANSLATION_FILES |
Vector containing all processed translation files. | |
typedef std::map< std::string, vector< std::string > > | MMSTRANSLATION_MAP |
Map that associates a string to translate to a vector containing the translation of all processed languages. | |
Private Member Functions | |
void | loadTranslations () |
void | processFile (const string &file) |
void | addMissing (const string &phrase, const bool completemiss=false) |
Static Private Attributes | |
static bool | firsttime = true |
first time MMSTranslator will be constructed? | |
static MMSLanguage | sourcelang = MMSLANG_NONE |
static MMSLanguage | targetlang = MMSLANG_NONE |
static int | sourceIdx = -1 |
static int | targetIdx = -1 |
static MMSTRANSLATION_INDEX | transIdx |
static MMSTRANSLATION_MAP | transmap |
static bool | addtranslations |
static MMSTRANSLATION_FILES | files |
Definition at line 44 of file mmstranslator.h.
typedef std::map<MMSLanguage, int> MMSTranslator::MMSTRANSLATION_INDEX [private] |
This maps country codes (i.e.
de for germany) to an index for vectors in MMSTRANSLATION_FILES and MMSTRANSLATION_MAP.
Definition at line 52 of file mmstranslator.h.
typedef std::vector<std::string> MMSTranslator::MMSTRANSLATION_FILES [private] |
typedef std::map<std::string, vector<std::string> > MMSTranslator::MMSTRANSLATION_MAP [private] |
Map that associates a string to translate to a vector containing the translation of all processed languages.
Definition at line 63 of file mmstranslator.h.
MMSTranslator::MMSTranslator | ( | ) |
Definition at line 55 of file mmstranslator.cpp.
MMSTranslator::~MMSTranslator | ( | ) |
Definition at line 74 of file mmstranslator.cpp.
void MMSTranslator::loadTranslations | ( | ) | [private] |
Definition at line 78 of file mmstranslator.cpp.
void MMSTranslator::processFile | ( | const string & | file | ) | [private] |
Definition at line 215 of file mmstranslator.cpp.
void MMSTranslator::addMissing | ( | const string & | phrase, | |
const bool | completemiss = false | |||
) | [private] |
Definition at line 125 of file mmstranslator.cpp.
void MMSTranslator::translate | ( | const std::string & | source, | |
std::string & | dest | |||
) |
Definition at line 165 of file mmstranslator.cpp.
bool MMSTranslator::setTargetLang | ( | MMSLanguage | lang | ) |
Definition at line 199 of file mmstranslator.cpp.
MMSLanguage MMSTranslator::getTargetLang | ( | ) |
Definition at line 211 of file mmstranslator.cpp.
bool MMSTranslator::firsttime = true [static, private] |
MMSLanguage MMSTranslator::sourcelang = MMSLANG_NONE [static, private] |
Definition at line 68 of file mmstranslator.h.
MMSLanguage MMSTranslator::targetlang = MMSLANG_NONE [static, private] |
Definition at line 68 of file mmstranslator.h.
int MMSTranslator::sourceIdx = -1 [static, private] |
Definition at line 69 of file mmstranslator.h.
int MMSTranslator::targetIdx = -1 [static, private] |
Definition at line 69 of file mmstranslator.h.
MMSTranslator::MMSTRANSLATION_INDEX MMSTranslator::transIdx [static, private] |
Definition at line 70 of file mmstranslator.h.
MMSTranslator::MMSTRANSLATION_MAP MMSTranslator::transmap [static, private] |
Definition at line 71 of file mmstranslator.h.
bool MMSTranslator::addtranslations [static, private] |
Definition at line 72 of file mmstranslator.h.
MMSTranslator::MMSTRANSLATION_FILES MMSTranslator::files [static, private] |
Definition at line 73 of file mmstranslator.h.
sigc::signal< void, MMSLanguage > MMSTranslator::onTargetLangChanged [static] |
Definition at line 87 of file mmstranslator.h.