deTranslatorSection Class Reference

Language Pack Translator Section. More...

#include <deTranslatorSection.h>

List of all members.

Public Member Functions

Constructors and Destructors
 deTranslatorSection (const char *name)
 Creates a new translator section object.
 ~deTranslatorSection ()
 Cleans up the translator section.
Management
const char * GetName () const
 Retrieves the name of the section.
void UpdateTranslations (deLanguagePack *languagePack)
 Updates the translations in this section.
Entries
int GetEntryCount () const
 Retrieves the number of entries.
deTranslatorEntryGetEntryAt (int index) const
 Retrieves the entry at the given index.
deTranslatorEntryGetEntryNamed (const char *name) const
 Retrieves the entry with the given name.
int FindEntry (deTranslatorEntry *entry) const
 Retrieves the index of the entry or -1 if not part of this translator.
int FindEntryNamed (const char *name) const
 Retrieves the index of the entry or -1 if not part of this translator.
bool HasEntry (deTranslatorEntry *entry) const
 Determines if the entry is part of this translator.
void AddEntry (deTranslatorEntry *entry)
 Adds a new entry.
void RemoveEntry (deTranslatorEntry *entry)
 Removes a entry.
void RemoveAllEntries ()
 Removes all entries.

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.

Author:
Plüss Roland
Version:
1.0
Date:
2008

Constructor & Destructor Documentation

deTranslatorSection::deTranslatorSection ( const char *  name )

Creates a new translator section object.

deTranslatorSection::~deTranslatorSection (  )

Cleans up the translator section.


Member Function Documentation

void deTranslatorSection::AddEntry ( deTranslatorEntry entry )

Adds a new entry.

int deTranslatorSection::FindEntry ( deTranslatorEntry entry ) const

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

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

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

deTranslatorEntry* deTranslatorSection::GetEntryAt ( int  index ) const

Retrieves the entry at the given index.

int deTranslatorSection::GetEntryCount (  ) const [inline]

Retrieves the number of entries.

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

Retrieves the entry with the given name.

const char* deTranslatorSection::GetName (  ) const [inline]

Retrieves the name of the section.

bool deTranslatorSection::HasEntry ( deTranslatorEntry entry ) const

Determines if the entry is part of this translator.

void deTranslatorSection::RemoveAllEntries (  )

Removes all entries.

void deTranslatorSection::RemoveEntry ( deTranslatorEntry entry )

Removes a entry.

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.


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