Base Framework
Public Member Functions | Static Public Member Functions | List of all members
Translation Class Reference

#include <base/Translation.h>

Inherits ReferenceCountedObject.

Public Member Functions

const Stringget (const String &text) const
 
const Stringget (const String &text, const String &context) const
 
void add (const String &text, const String &translated)
 
void add (const String &text, const String &context, const String &translated)
 
String translate (const String &text) const
 
String translate (const String &text, const String &context) const
 
- Public Member Functions inherited from ReferenceCountedObject
 ReferenceCountedObject () noexcept
 
 ReferenceCountedObject (const ReferenceCountedObject &copy) noexcept
 
 ReferenceCountedObject (ReferenceCountedObject &&move) noexcept
 
ReferenceCountedObjectoperator= (const ReferenceCountedObject &copy) noexcept
 
ReferenceCountedObjectoperator= (ReferenceCountedObject &&move) noexcept
 
MemorySize getNumberOfReferences_INTERNAL () const noexcept
 
virtual bool useGarbageCollector () const noexcept
 
- Public Member Functions inherited from DynamicObject
 DynamicObject () noexcept
 
bool isValidObject () const noexcept
 
virtual ~DynamicObject () noexcept(false)
 
 _COM_AZURE_DEV__BASE__OVERRIDE_ALLOC ()
 

Static Public Member Functions

static R< TranslationgetCurrent ()
 
static void makeCurrent (R< Translation > translation)
 
static void unsetTranslation ()
 

Detailed Description

Translation.

Member Function Documentation

◆ add() [1/2]

void Translation::add ( const String text,
const String context,
const String translated 
)

Adds translation. Null-terminator should not be used for translations and will be discarded.

◆ add() [2/2]

void Translation::add ( const String text,
const String translated 
)

Adds translation. Null-terminator should not be used for translations and will be discarded.

◆ get() [1/2]

const String* Translation::get ( const String text) const

Returns the translation for the given text. Returns nullptr if not defined.

◆ get() [2/2]

const String* Translation::get ( const String text,
const String context 
) const

Returns the translation for the given text. Returns nullptr if not defined.

◆ getCurrent()

static R<Translation> Translation::getCurrent ( )
static

Returns the current translaiton.

◆ makeCurrent()

static void Translation::makeCurrent ( R< Translation translation)
static

Makes the given translation current.

◆ translate() [1/2]

String Translation::translate ( const String text) const

Translates the given string.

◆ translate() [2/2]

String Translation::translate ( const String text,
const String context 
) const

Translates the given string and context.

◆ unsetTranslation()

static void Translation::unsetTranslation ( )
inlinestatic

Removes the current translation.