EasyGUI  Version v1.0
Translation engine

String translation engine for widgets. More...

Data Structures

struct  gui_translate_language_t
 Translation language structure. More...
 
struct  gui_translate_t
 Basic translation structure for internal use. More...
 

Functions

const gui_chargui_translate_get (const gui_char *const src)
 Get translated entry from input string. More...
 
uint8_t gui_translate_setactivelanguage (const gui_translate_language_t *const lang)
 Set currently active language for translated entries. More...
 
uint8_t gui_translate_setsourcelanguage (const gui_translate_language_t *const lang)
 Set source language for translated entries. More...
 

Detailed Description

String translation engine for widgets.

Translation works between source and active languages

Both languages must contain the same array for entries in different languages. When translate is performed, index from source table (if found) is used to return string from active table.

Note
When translation language is changed, all widget must be manually redrawn to get effect

Function Documentation

◆ gui_translate_get()

const gui_char* gui_translate_get ( const gui_char *const  src)

Get translated entry from input string.

Parameters
[in]srcString to translate
Returns
Pointer to translated string or source string if translate not found

◆ gui_translate_setactivelanguage()

uint8_t gui_translate_setactivelanguage ( const gui_translate_language_t *const  lang)

Set currently active language for translated entries.

Note
These entries are returned when index matches the source string from source language
Parameters
[in]langLanguage with translation entries
Returns
1 on success, 0 otherwise

◆ gui_translate_setsourcelanguage()

uint8_t gui_translate_setsourcelanguage ( const gui_translate_language_t *const  lang)

Set source language for translated entries.

Note
These entries are compared with input string to get index for translated value
Parameters
[in]langLanguage with translation entries
Returns
1 on success, 0 otherwise