跳轉到主要內容

Texts

touchgfx/Texts.hpp

Class for setting language and getting texts. The language set will determine which texts will be used in the application.

Public Functions

LanguageIdgetLanguage()
Gets the current language.
voidsetLanguage(LanguageId id)
Sets the current language for texts.
voidsetTranslation(LanguageId id, const void * translation)
Adds or replaces a translation.
const Unicode::UnicodeChar *getText(TypedTextId id) const
Get text in the set language.

Public Functions Documentation

getLanguage

static LanguageId getLanguage()

Gets the current language.

Returns:

The id of the language.

setLanguage

static void setLanguage(LanguageIdid)

Sets the current language for texts.

Parameters:
idThe id of the language.

setTranslation

static void setTranslation(LanguageIdid ,
const void *translation
)

Adds or replaces a translation.

This function allows an application to add a translation at runtime.

Parameters:
idThe id of the language to add or replace.
translationA pointer to the translation in flash or RAM.

getText

const Unicode::UnicodeChar * getText(TypedTextIdid)

Get text in the set language.

Parameters:
idThe id of the text to lookup.
Returns:

The text.

See also: