I want to use the translation function for parts of the text in a label so I dont have to translate the same word more than once.
For example.
I want to show 4 texts to show the status of Vacuum 1 - 4, but I do not want to have 4 translation keys. It does not seem to be possible to use !!Vacuum!! 1 and so on.
Hi, you can use classic approach to build custom strings. Like for example: const stringTest = ${string1} ${string2}; Or you can just add two strings like const stringTest = translatedString + String(index);
I don’t think you have fully understood my question.
I know how to combine strings in javascript. What I want is to do it without breaking the translation function in AppStudio.
I have been trying to combine a translation key with additional text, but so far I have not been able to get the key to translate when it is concatenated with other strings.
If there is a supported way to combine a !!key!! with other values (for example, an index or suffix), I would really appreciate seeing a concrete code example that demonstrates how this should be done.
For reference, the following does not work in my case, as !!vacuum!! is not replaced with its translated value:
const stringTest = "!!vacuum!!" + String(index);
Thank you in advance for any clarification or guidance you can provide.
Hi, do you want to use code to parse the current multilingual entries in AppStudio?
You’ve noticed that App Studio uses !! + key name + !! as the multilingual key, but if you want to dynamically retrieve its value, you can use TComponents.Component_A.t(‘key name’) to get its value.