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

Any text displayed to the user should be defined as a TranslatedString which allows the program to look up a translation, if available. More...

#include <TranslatedString.h>

Collaboration diagram for TranslatedString:
[legend]

Public Member Functions

const StringenglishTranslation () const
 
bool hasReplacements () const
 
String internalValue () const
 
bool isEmpty () const
 
bool isTranslatable () const
 
bool operator!= (const TranslatedString &translation) const
 
bool operator< (const TranslatedString &value) const
 
TranslatedStringoperator= (const TranslatedString &translation) noexcept
 
TranslatedStringoperator= (TranslatedString &&translation) noexcept
 
bool operator== (const TranslatedString &translation) const
 
bool operator> (const TranslatedString &value) const
 
TranslatedStringreplace (const String &sub_string, const String &replacement)
 
TranslatedStringreplace (const String &sub_string, const TranslatedString &replacement)
 
void retranslate ()
 
 TranslatedString ()
 
 TranslatedString (const char *const raw_string)
 
 TranslatedString (const String &raw_string)
 
 TranslatedString (const String &translation_id, const String &english)
 
 TranslatedString (const TranslatedString &translation)
 
 TranslatedString (TranslatedString &&translation) noexcept
 
const Stringtranslation () const
 
String translation (const String &translation_id) const
 
const StringtranslationID () const
 
 ~TranslatedString ()
 

Protected Member Functions

void calculateEnglishString ()
 

Protected Attributes

String m_english_string
 
bool m_is_translated
 
Dictionary< String, TranslatedString * > m_replacements
 
String m_translation
 
String m_translation_id
 

Detailed Description

Any text displayed to the user should be defined as a TranslatedString which allows the program to look up a translation, if available.


Constructor & Destructor Documentation

◆ TranslatedString() [1/6]

◆ ~TranslatedString()

~TranslatedString ( )
inline

◆ TranslatedString() [2/6]

TranslatedString ( const TranslatedString & translation)

◆ TranslatedString() [3/6]

TranslatedString ( TranslatedString && translation)
noexcept

◆ TranslatedString() [4/6]

TranslatedString ( const char *const raw_string)
explicit

◆ TranslatedString() [5/6]

TranslatedString ( const String & raw_string)
explicit

◆ TranslatedString() [6/6]

TranslatedString ( const String & translation_id,
const String & english )

Member Function Documentation

◆ calculateEnglishString()

void calculateEnglishString ( )
protected

◆ englishTranslation()

const String & englishTranslation ( ) const

◆ hasReplacements()

bool hasReplacements ( ) const

◆ internalValue()

String internalValue ( ) const

◆ isEmpty()

bool isEmpty ( ) const

◆ isTranslatable()

bool isTranslatable ( ) const

◆ operator!=()

bool operator!= ( const TranslatedString & translation) const

◆ operator<()

bool operator< ( const TranslatedString & value) const

◆ operator=() [1/2]

TranslatedString & operator= ( const TranslatedString & translation)
noexcept

◆ operator=() [2/2]

TranslatedString & operator= ( TranslatedString && translation)
noexcept

◆ operator==()

bool operator== ( const TranslatedString & translation) const

◆ operator>()

bool operator> ( const TranslatedString & value) const

◆ replace() [1/2]

TranslatedString & replace ( const String & sub_string,
const String & replacement )

◆ replace() [2/2]

TranslatedString & replace ( const String & sub_string,
const TranslatedString & replacement )

◆ retranslate()

void retranslate ( )

◆ translation() [1/2]

const String & translation ( ) const

◆ translation() [2/2]

String translation ( const String & translation_id) const

◆ translationID()

const String & translationID ( ) const

Member Data Documentation

◆ m_english_string

String m_english_string
mutableprotected

◆ m_is_translated

bool m_is_translated
mutableprotected

◆ m_replacements

Dictionary<String, TranslatedString*> m_replacements
protected

◆ m_translation

String m_translation
mutableprotected

◆ m_translation_id

String m_translation_id
mutableprotected

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