Skip to main content
Senior
November 26, 2024
Solved

Adding Language Dynamically

  • November 26, 2024
  • 2 replies
  • 615 views

Hi, I know this is a bit of an off question. Is it possible to add a language dynamically? Without filling out the dictionary in the TouchGFX application? 

Best answer by LouisB

Hello @Priyank ,

You can't add dynamic languages but you can add dynamic translations.

 

Best regards,

2 replies

Senior
November 26, 2024

The language portion of the HAL from TouchGFX hints at dynamic loading.
I didn't fully study it yet but check the following sections of the framework.

HAL& touchgfx_generic_init(...){
 Texts::setLanguage(0);// PreBuilt Text Bin 
}

// Generated by TouchGFX
void touchgfx::Texts::setLanguage(touchgfx::LanguageId id)
{
 const touchgfx::TypedText::TypedTextData* currentLanguageTypedText = 0;
 if (id < 2)
 {
 if (languagesArray[id] != 0)
 {
 // Dynamic translation is added
 ...
 }
 else
 {
 // Compiled and linked in languages
 currentLanguagePtr = texts_all_languages;
 currentLanguageIndices = staticLanguageIndices[id];
 currentLanguageTypedText = typedTextDatabaseArray[id];
 }
 }

 

There is also the Ruby tools they include in the projects.
$project$\touchgfx\framework\tools\textconvert/

We could probably ask to add dynamic loading in the example:
https://support.touchgfx.com/academy/tutorials/tutorial-06/tutorial-06-part-1#create-a-new-language

LouisBBest answer
ST Employee
November 28, 2024

Hello @Priyank ,

You can't add dynamic languages but you can add dynamic translations.

 

Best regards,