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;
184 U32String getTranslation(uint32 index)
const;
198 const TLangArray getSupportedLanguageNames()
const;
203 String getCurrentLanguage()
const;
208 int getCurrentLanguageId()
const;
213 bool currentIsBuiltinLanguage()
const;
224 int32 findMatchingLanguage(
const String &lang);
232 bool openTranslationsFile(
File &);
239 bool openTranslationsFile(
const FSNode &node,
File &,
int depth = -1);
251 void loadLanguageDat(
int index);
256 bool checkHeader(
File &in);
277 #define TransMan Common::MainTranslationManager::instance() 279 #define _(str) TransMan.getTranslation(str) 280 #define _c(str, context) TransMan.getTranslation(str, context) 282 #else // !USE_TRANSLATION 284 #define _(str) Common::U32String(str) 285 #define _c(str, context) Common::U32String(str) 287 #endif // USE_TRANSLATION 290 #define _sc(str, ctxt) str 291 #define DECLARE_TRANSLATION_ADDITIONAL_CONTEXT(str, ctxt) 293 #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:267
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