Skip to main content
AndreaC
Associate III
May 10, 2024 11:12 AM UTC
Solved

Changing text at runtime in custom container - Language issues

Hello,

Description

I have created a custom container to have the same stuff displayed at top of the screen, whatever the active screen is.

In this custom container there's a text area tVersFw (with a wildcard and a wildcard buffer) which has to show a const string. I can't precompile the string in Designer beacuse the strings changes with firmware version (chosen at compile time by setting a preprocessor macro).

So, in the initialize() call of the custom container I added this code:

 

 

Unicode::strncpy(tVersFwBuffer, FW_VER_STRING, TVERSFW_SIZE);
tVersFw.invalidate();

 

 

where FW_VER_STRING is like "ABC123".

 

Issue

When I change GUI language, at runtime, one of the two languages makes the textarea show weird things.

It's systematic: when I select one language, "ABC123" is correctly displayed whikle when I choose the other I see something like "New TextABC123".

 

What am I doing wrong?

 

Thank you in advance,

Andrea

This topic has been closed for replies.
JTP1Best answer
Graduate II
May 10, 2024 11:33 AM UTC

Hello

At Tgfx designer, open 'texts' and check all autogenerated items. There is probably some 'New Text <value>' items in language column which is not working. Remove 'New Text' and leave <value>, it represents the wildcard buffer content. By default, this New Text is added to all languages.

Hope this helps.

Br JTP

2 replies

JTP1Best answer
Graduate II
May 10, 2024 11:33 AM UTC

Hello

At Tgfx designer, open 'texts' and check all autogenerated items. There is probably some 'New Text <value>' items in language column which is not working. Remove 'New Text' and leave <value>, it represents the wildcard buffer content. By default, this New Text is added to all languages.

Hope this helps.

Br JTP

AndreaC
AndreaCAuthor
Associate III
May 10, 2024 1:47 PM UTC

That's it!

Thank you very much,
Andrea