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);
262 #define TransMan Common::MainTranslationManager::instance() 264 #define _(str) TransMan.getTranslation(str) 265 #define _c(str, context) TransMan.getTranslation(str, context) 267 #else // !USE_TRANSLATION 269 #define _(str) Common::U32String(str) 270 #define _c(str, context) Common::U32String(str) 272 #endif // USE_TRANSLATION 275 #define _sc(str, ctxt) str 276 #define DECLARE_TRANSLATION_ADDITIONAL_CONTEXT(str, ctxt) 278 #endif // COMMON_TRANSLATION_H U32String name
Definition: translation.h:59
int msgid
Definition: translation.h:78
Language parseLanguage(const String &str)
U32String 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:252
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