Drag[en]gine Game Engine  1.0
deTranslator Class Reference

Language Pack Translator. More...

#include <deTranslator.h>

Public Member Functions

Constructors and Destructors
 deTranslator ()
 ~deTranslator ()
deLanguagePackGetLanguagePack () const
void SetLanguagePack (deLanguagePack *languagePack)
void UpdateTranslations ()
int GetSectionCount () const
deTranslatorSectionGetSectionAt (int index) const
deTranslatorSectionGetSectionNamed (const char *name) const
int FindSection (deTranslatorSection *section) const
int FindSectionNamed (const char *name) const
bool HasSection (deTranslatorSection *section) const
void AddSection (deTranslatorSection *section)
void RemoveSection (deTranslatorSection *section)
void RemoveAllSections ()

Detailed Description

Language Pack Translator.

Provides a convenient way to retrieve text in language specific translations using language packs. The translator supports sections to organize the individual translation entries. Most of the time a game comes equiped with a large amount of objects with identical or very similar text strings. A section can be used for such individual objects to access them in a quick and easy way ( avoiding a huge index table ). Every translator stores a language pack to get the translations from. If a string has no translation in the current language pack a placeholder text is used.

Pl├╝ss Roland

Constructor & Destructor Documentation

◆ deTranslator()

deTranslator::deTranslator ( )

Creates a new translator object with the given language pack.

◆ ~deTranslator()

deTranslator::~deTranslator ( )

Cleans up the translator.

Member Function Documentation

◆ AddSection()

void deTranslator::AddSection ( deTranslatorSection section)

Adds a new section. The section is translated right after beeing added.

Referenced by GetSectionCount().

◆ FindSection()

int deTranslator::FindSection ( deTranslatorSection section) const

Retrieves the index of the section or -1 if not part of this translator.

Referenced by GetSectionCount().

◆ FindSectionNamed()

int deTranslator::FindSectionNamed ( const char *  name) const

Retrieves the index of the section or -1 if not part of this translator.

Referenced by GetSectionCount().

◆ GetLanguagePack()

deLanguagePack* deTranslator::GetLanguagePack ( ) const

Retrieves the language pack.

References SetLanguagePack(), and UpdateTranslations().

◆ GetSectionAt()

deTranslatorSection* deTranslator::GetSectionAt ( int  index) const

Retrieves the section at the given index.

Referenced by GetSectionCount().

◆ GetSectionCount()

int deTranslator::GetSectionCount ( ) const

◆ GetSectionNamed()

deTranslatorSection* deTranslator::GetSectionNamed ( const char *  name) const

Retrieves the section with the given name or null if not found.

Referenced by GetSectionCount().

◆ HasSection()

bool deTranslator::HasSection ( deTranslatorSection section) const

Determines if the section is part of this translator.

Referenced by GetSectionCount().

◆ RemoveAllSections()

void deTranslator::RemoveAllSections ( )

Removes all sections.

Referenced by GetSectionCount().

◆ RemoveSection()

void deTranslator::RemoveSection ( deTranslatorSection section)

Removes a section.

Referenced by GetSectionCount().

◆ SetLanguagePack()

void deTranslator::SetLanguagePack ( deLanguagePack languagePack)

Sets the language pack. All translations are updated after the language pack has changed.

Referenced by GetLanguagePack().

◆ UpdateTranslations()

void deTranslator::UpdateTranslations ( )

Updates all translations.

Referenced by GetLanguagePack().

The documentation for this class was generated from the following file: