deTranslator Class Reference

Language Pack Translator. More...

#include <deTranslator.h>

List of all members.

Public Member Functions

Constructors and Destructors
 deTranslator ()
 Creates a new translator object with the given language pack.
 ~deTranslator ()
 Cleans up the translator.
Management
deLanguagePackGetLanguagePack () const
 Retrieves the language pack.
void SetLanguagePack (deLanguagePack *languagePack)
 Sets the language pack.
void UpdateTranslations ()
 Updates all translations.
Sections
int GetSectionCount () const
 Retrieves the number of sections.
deTranslatorSectionGetSectionAt (int index) const
 Retrieves the section at the given index.
deTranslatorSectionGetSectionNamed (const char *name) const
 Retrieves the section with the given name or null if not found.
int FindSection (deTranslatorSection *section) const
 Retrieves the index of the section or -1 if not part of this translator.
int FindSectionNamed (const char *name) const
 Retrieves the index of the section or -1 if not part of this translator.
bool HasSection (deTranslatorSection *section) const
 Determines if the section is part of this translator.
void AddSection (deTranslatorSection *section)
 Adds a new section.
void RemoveSection (deTranslatorSection *section)
 Removes a section.
void RemoveAllSections ()
 Removes all sections.

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.

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

Constructor & Destructor Documentation

deTranslator::deTranslator (  )

Creates a new translator object with the given language pack.

deTranslator::~deTranslator (  )

Cleans up the translator.


Member Function Documentation

void deTranslator::AddSection ( deTranslatorSection section )

Adds a new section.

The section is translated right after beeing added.

int deTranslator::FindSection ( deTranslatorSection section ) const

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

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

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

deLanguagePack* deTranslator::GetLanguagePack (  ) const [inline]

Retrieves the language pack.

deTranslatorSection* deTranslator::GetSectionAt ( int  index ) const

Retrieves the section at the given index.

int deTranslator::GetSectionCount (  ) const [inline]

Retrieves the number of sections.

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

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

bool deTranslator::HasSection ( deTranslatorSection section ) const

Determines if the section is part of this translator.

void deTranslator::RemoveAllSections (  )

Removes all sections.

void deTranslator::RemoveSection ( deTranslatorSection section )

Removes a section.

void deTranslator::SetLanguagePack ( deLanguagePack languagePack )

Sets the language pack.

All translations are updated after the language pack has changed.

void deTranslator::UpdateTranslations (  )

Updates all translations.


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