How to manage language switching with placeholders? Let's say, I plan to pass a text to a button ("Turn off", for instance), through a variable linked to a placeholder %s; how to make this text be translated at the same time as the rest of the display in case of a language change? I have the impression that we should be able to link a list of text to the variable or something like that, but I really don't see how to do it.
Can anyone help me?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
create a textlist with your needed and translated texts.
Using the function DynamicTextGetText from the lib CmpDynamicText you should be able to "feed" your string variable with the translated texts. The function needs a pointer to the textlist and the index of the text in the list as input. Good luck!
Last edit: dkugler 2023-02-28
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Good morning,
How to manage language switching with placeholders? Let's say, I plan to pass a text to a button ("Turn off", for instance), through a variable linked to a placeholder %s; how to make this text be translated at the same time as the rest of the display in case of a language change? I have the impression that we should be able to link a list of text to the variable or something like that, but I really don't see how to do it.
Can anyone help me?
create a textlist with your needed and translated texts.
Using the function DynamicTextGetText from the lib CmpDynamicText you should be able to "feed" your string variable with the translated texts. The function needs a pointer to the textlist and the index of the text in the list as input. Good luck!
Last edit: dkugler 2023-02-28