API Documentation
Loading...
Searching...
No Matches
Translator Class Reference

Contains logic for translating a string into a defined language. More...

#include <Translator.h>

Inheritance diagram for Translator:
[legend]
Collaboration diagram for Translator:
[legend]

Public Member Functions

File activeTranslatorFile () const
 
String commonCharacters () const
 
virtual String convertNumber (const String &number_string, bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits) const
 
virtual String convertText (const String &text_string) const
 
virtual String convertText (const String &text_string, const String &default_text) const
 
void copyFrom (const Translator &trans, bool use_existing_ini_file)
 
void copyTranslationsFrom (const Translator &trans)
 
void getINI (INIFactory &factory) override
 
const Stringid () const
 
bool isLeftToRight () const
 
const Stringname () const
 
Translatoroperator= (const Translator &translation)
 
void saveTranslation (File location=File())
 
void setID (const String &id)
 
void setName (const String &name)
 
Dictionary< String, StringtranslatedStrings () const
 
INIFactorytranslationINI () const
 
 Translator ()
 
 Translator (const File &settings_file)
 
 Translator (const String &translation_id)
 
 Translator (const Translator &translator)
 
File translatorFile (bool user_file) const
 
- Public Member Functions inherited from INIInterface
virtual void finishReadingINI (INIFactory &)
 
 INIInterface (const File &default_ini)
 
virtual void prepareForINI (INIFactory &)
 
virtual bool readINIOptions ()
 
virtual bool readINIOptions (File &ini_file)
 
virtual bool saveINIOptions (bool multithead=false)
 
virtual bool saveINIOptions (File &ini_file, bool multithead=false)
 
void setDefaultINIFile (const File &file)
 
virtual void writeToLog (const String &title, ProgressInfo *log, uint01 log_level=2U)
 
virtual void writeToLog (ProgressInfo *log, uint01 log_level=2U)
 
virtual ~INIInterface ()
 

Static Public Member Functions

static String DefaultLabel (const String &text_string)
 
static Dictionary< String, TranslatorGetAvailableTranslations (File folder=File())
 
static TranslatorMainTranslator ()
 
static void SetMainTranslator (Translator *translator)
 

Static Public Attributes

static Resource< Translator * > main_translator
 

Protected Member Functions

void ensureLanguageLoaded () const
 
void init ()
 

Protected Attributes

String m_common_characters
 
char m_decimal_sep
 
bool m_has_loaded_language
 
INIFactory m_language_ini
 
String m_language_name
 
bool m_left_to_right
 
char m_number_sep
 
File m_translation_file
 
String m_translation_id
 
- Protected Attributes inherited from INIInterface
File m_default_ini
 

Detailed Description

Contains logic for translating a string into a defined language.


Constructor & Destructor Documentation

◆ Translator() [1/4]

◆ Translator() [2/4]

Translator ( const String & translation_id)

◆ Translator() [3/4]

Translator ( const File & settings_file)

◆ Translator() [4/4]

Translator ( const Translator & translator)

Member Function Documentation

◆ activeTranslatorFile()

File activeTranslatorFile ( ) const

◆ commonCharacters()

String commonCharacters ( ) const

◆ convertNumber()

virtual String convertNumber ( const String & number_string,
bool add_comma,
uint04 min_decimals,
uint04 max_decimals,
uint04 min_digits ) const
virtual

◆ convertText() [1/2]

virtual String convertText ( const String & text_string) const
virtual

◆ convertText() [2/2]

virtual String convertText ( const String & text_string,
const String & default_text ) const
virtual

◆ copyFrom()

void copyFrom ( const Translator & trans,
bool use_existing_ini_file )

◆ copyTranslationsFrom()

void copyTranslationsFrom ( const Translator & trans)

◆ DefaultLabel()

static String DefaultLabel ( const String & text_string)
static

◆ ensureLanguageLoaded()

void ensureLanguageLoaded ( ) const
protected

◆ GetAvailableTranslations()

static Dictionary< String, Translator > GetAvailableTranslations ( File folder = File())
static

◆ getINI()

void getINI ( INIFactory & factory)
overridevirtual

Implements INIInterface.

◆ id()

const String & id ( ) const
inline

◆ init()

void init ( )
protected

◆ isLeftToRight()

bool isLeftToRight ( ) const

◆ MainTranslator()

static Translator * MainTranslator ( )
static

◆ name()

const String & name ( ) const
inline

◆ operator=()

Translator & operator= ( const Translator & translation)

◆ saveTranslation()

void saveTranslation ( File location = File())

◆ setID()

void setID ( const String & id)

◆ SetMainTranslator()

static void SetMainTranslator ( Translator * translator)
static

◆ setName()

void setName ( const String & name)

◆ translatedStrings()

Dictionary< String, String > translatedStrings ( ) const

◆ translationINI()

INIFactory & translationINI ( ) const

◆ translatorFile()

File translatorFile ( bool user_file) const

Member Data Documentation

◆ m_common_characters

String m_common_characters
protected

◆ m_decimal_sep

char m_decimal_sep
protected

◆ m_has_loaded_language

bool m_has_loaded_language
mutableprotected

◆ m_language_ini

INIFactory m_language_ini
mutableprotected

◆ m_language_name

String m_language_name
protected

◆ m_left_to_right

bool m_left_to_right
protected

◆ m_number_sep

char m_number_sep
protected

◆ m_translation_file

File m_translation_file
protected

◆ m_translation_id

String m_translation_id
protected

◆ main_translator

Resource<Translator*> main_translator
static

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