84 _langByID[languageDeclaration.
id] = languageDeclaration;
96 std::vector<Language> languages;
99 languages.push_back(l->first);
105 LanguageByLanguage::const_iterator l =
_langByLang.find(language);
113 LanguageByID::const_iterator l =
_langByID.find(
id);
230 return languageID * 2 + ((size_t) gender);
237 return languageID / 2;
251 return languageID ^ 1;
290 std::vector<byte> collect;
296 while (stream.
read(&b, 1) == 1) {
299 collect.push_back(b);
309 collect.push_back(b);
312 output.
write(&collect[0], collect.size());
321 if ((state == 2) || (state == 3) || (state == 4)) {
322 collect.push_back(b);
323 color[state - 2] = b;
339 output.
write(&collect[0], collect.size());
Language _currentLanguageVoice
Common::Encoding encoding
void setCurrentLanguageText(Language language)
Change the current language, for text only.
void setCurrentLanguage(Language language)
Change the current language, setting both text and voice to the same language.
A stream that dynamically grows as it's written to.
const Declaration * find(Language language) const
A class holding an UTF-8 string.
void writeString(const UString &str)
Write the given string to the stream, encoded as UTF-8.
LanguageByLanguage _langByLang
Implementing the reading stream interfaces for plain memory blocks.
The global language manager.
#define ARRAYSIZE(x)
Macro which determines the number of entries in a fixed size array.
static uint32 convertLanguageIDToGendered(uint32 languageID, LanguageGender gender)
Convert an ungendered language ID to a gendered language ID.
uint32 getLanguageID(Language language) const
Construct the internal language ID for an ungendered use of a language.
static Common::MemoryReadStream * preParseColorCodes(Common::SeekableReadStream &stream)
Pre-parse and fix color codes found in UI and dialogue strings in Aurora games.
LanguageGender getCurrentGender() const
Return the gender modulating the current language.
Common::Encoding getEncodingLocString(Language language) const
Return the encoding used for the given language, for reading an embedded LocString string...
size_t size() const
Return the number of bytes written to this stream in total.
Language getCurrentLanguageText() const
Return the current language for text.
Language getCurrentLanguageVoice() const
Return the current language for voices.
static Common::UString getLanguageName(Language language)
Return the human readable name of a language.
static LanguageGender getLanguageGender(uint32 languageID)
Return the gender of this gendered language ID.
static const LanguageStrings kLanguageStrings[]
static UString format(const char *s,...) GCC_PRINTF(1
Print formatted data into an UString object, similar to sprintf().
Language getLanguage(uint32 languageID) const
Decode the internal language ID for an ungendered use of a language.
Language <-> Language name mappings.
Implementing the writing stream interfaces for memory blocks.
#define DECLARE_SINGLETON(T)
Note that you need to use this macro from the global namespace.
void addLanguages(const Declaration *languageDeclarations, size_t count)
Add several supported language for the current game to the LanguageManager, together with their inter...
Types and functions related to language.
Language _currentLanguageText
virtual size_t read(void *dataPtr, size_t dataSize)=0
Read data from the stream.
Simple memory based 'stream', which implements the ReadStream interface for a plain memory block...
bool empty() const
Is the string empty?
static uint32 swapLanguageGender(uint32 languageID)
Swap the gender of this gendered language ID.
void setCurrentLanguageVoice(Language language)
Change the current language, for voice only.
void writeByte(byte value)
virtual size_t size() const =0
Obtains the total size of the stream, measured in bytes.
Common::Encoding getEncoding(Language language) const
Return the encoding used for the given language.
void addLanguage(Language language, uint32 id, Common::Encoding encoding)
Add a supported language for the current game to the LanguageManager, together with its internal (ung...
Common::Encoding getCurrentEncodingLocString() const
Return the encoding for the current text language, for reading an embedded LocString string...
static const char *const kLanguageNames[]
std::vector< Language > getLanguages() const
Return all declared supported languages for the current game.
LanguageGender _currentGender
size_t write(const void *dataPtr, size_t dataSize)
Write data into the stream.
Pseudo value that means the current language gender.
UString toLower() const
Return a lowercased copy of the string.
Common::Encoding getCurrentEncoding() const
Return the encoding for the current text language.
Pseudo value that means either traditional or simplified Chinese.
Common::Encoding encodingLocString
Language getLanguageGendered(uint32 languageID) const
Decode the internal language ID for a gendered use of a language (and ignore the language gender)...
void clear()
Clear all managed languages from the LanguageManager.
static Language parseLanguage(const Common::UString &str)
Parse this string into a language.
Interface for a seekable & readable data stream.
static uint32 convertLanguageIDToUngendered(uint32 languageID)
Convert a gendered language ID to an ungendered language ID.
void setCurrentGender(LanguageGender gender)
Change the gender modulating the current language.