22 #ifndef COMMON_TRANSLATION_H 23 #define COMMON_TRANSLATION_H 25 #include "common/array.h" 26 #include "common/fs.h" 27 #include "common/str.h" 28 #include "common/singleton.h" 29 #include "common/str-array.h" 30 #include "common/language.h" 32 #ifdef USE_TRANSLATION 104 String getLangById(
int id)
const;
115 void setLanguage(
const String &lang);
124 setLanguage(getLangById(
id));
143 U32String getTranslation(
const char *message)
const;
163 U32String getTranslation(
const char *message,
const char *context)
const;
182 const TLangArray getSupportedLanguageNames()
const;
187 String getCurrentLanguage()
const;
192 int getCurrentLanguageId()
const;
197 bool currentIsBuiltinLanguage()
const;
208 int32 findMatchingLanguage(
const String &lang);
216 bool openTranslationsFile(
File &);
223 bool openTranslationsFile(
const FSNode &node,
File &,
int depth = -1);
235 void loadLanguageDat(
int index);
240 bool checkHeader(
File &in);
261 #define TransMan Common::MainTranslationManager::instance() 263 #define _(str) TransMan.getTranslation(str) 264 #define _c(str, context) TransMan.getTranslation(str, context) 266 #else // !USE_TRANSLATION 268 #define _(str) Common::U32String(str) 269 #define _c(str, context) Common::U32String(str) 271 #endif // USE_TRANSLATION 274 #define _sc(str, ctxt) str 275 #define DECLARE_TRANSLATION_ADDITIONAL_CONTEXT(str, ctxt) 277 #endif // COMMON_TRANSLATION_H U32String name
Definition: translation.h:59
int msgid
Definition: translation.h:78
Language parseLanguage(const String &str)
String msgstr
Definition: translation.h:81
Definition: translation.h:52
Definition: translation.h:77
void setLanguage(int id)
Definition: translation.h:123
Definition: translation.h:51
Definition: noncopyable.h:39
Definition: translation.h:58
Definition: algorithm.h:29
Definition: translation.h:87
String msgctxt
Definition: translation.h:79
Definition: translation.h:251
int id
Definition: translation.h:60
TLanguage(const U32String &n, int i)
Definition: translation.h:67
Definition: singleton.h:42
TranslationIDs
Definition: translation.h:50