Drag[en]gine Game Engine  1.0
deTranslatorSection Class Reference

Language Pack Translator Section. More...

#include <deTranslatorSection.h>

Public Member Functions

Constructors and Destructors
 deTranslatorSection (const char *name)
 ~deTranslatorSection ()
const char * GetName () const
void UpdateTranslations (deLanguagePack *languagePack)
int GetEntryCount () const
deTranslatorEntryGetEntryAt (int index) const
deTranslatorEntryGetEntryNamed (const char *name) const
int FindEntry (deTranslatorEntry *entry) const
int FindEntryNamed (const char *name) const
bool HasEntry (deTranslatorEntry *entry) const
void AddEntry (deTranslatorEntry *entry)
void RemoveEntry (deTranslatorEntry *entry)
void RemoveAllEntries ()

Detailed Description

Language Pack Translator Section.

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 up to two language packs. One is declared the default ( or fallback ) language pack whereas the other is the current language pack. If a string has no translation in the current language pack the same string in the default language pack is used instead. At least the default language pack has to be set before a translation can be done.

Pl├╝ss Roland

Constructor & Destructor Documentation

◆ deTranslatorSection()

deTranslatorSection::deTranslatorSection ( const char *  name)

Creates a new translator section object.

◆ ~deTranslatorSection()

deTranslatorSection::~deTranslatorSection ( )

Cleans up the translator section.

Member Function Documentation

◆ AddEntry()

void deTranslatorSection::AddEntry ( deTranslatorEntry entry)

Adds a new entry.

Referenced by GetEntryCount().

◆ FindEntry()

int deTranslatorSection::FindEntry ( deTranslatorEntry entry) const

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

Referenced by GetEntryCount().

◆ FindEntryNamed()

int deTranslatorSection::FindEntryNamed ( const char *  name) const

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

Referenced by GetEntryCount().

◆ GetEntryAt()

deTranslatorEntry* deTranslatorSection::GetEntryAt ( int  index) const

Retrieves the entry at the given index.

Referenced by GetEntryCount().

◆ GetEntryCount()

int deTranslatorSection::GetEntryCount ( ) const

◆ GetEntryNamed()

deTranslatorEntry* deTranslatorSection::GetEntryNamed ( const char *  name) const

Retrieves the entry with the given name.

Referenced by GetEntryCount().

◆ GetName()

const char* deTranslatorSection::GetName ( ) const

Retrieves the name of the section.

References UpdateTranslations().

◆ HasEntry()

bool deTranslatorSection::HasEntry ( deTranslatorEntry entry) const

Determines if the entry is part of this translator.

Referenced by GetEntryCount().

◆ RemoveAllEntries()

void deTranslatorSection::RemoveAllEntries ( )

Removes all entries.

Referenced by GetEntryCount().

◆ RemoveEntry()

void deTranslatorSection::RemoveEntry ( deTranslatorEntry entry)

Removes a entry.

Referenced by GetEntryCount().

◆ UpdateTranslations()

void deTranslatorSection::UpdateTranslations ( deLanguagePack languagePack)

Updates the translations in this section. Call this function after you have made changes to the section in any way.

Referenced by GetName().

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