‎2022-06-13 02:41 AM
Why touchgfx combines alignment and font with translations?
We have same translation in many fonts and alignments, and we must create new Resource for each. Does not seem to make sense. Am I missing something?
We end up with a lot of duplicates of the same text content, that make translations very difficult:
<Text Id="EDIT" Alignment="Left" TypographyId="mainFont20_full">
<Translation Language="en_US">Edit </Translation>
<Translation Language="fi_FI">Muokkaa </Translation>
<Translation Language="it_IT">Modifica</Translation></Text>
<Text Id="EDIT_CENTER" Alignment="Center" TypographyId="mainFont20_full">
<Translation Language="en_US">Edit </Translation>
<Translation Language="fi_FI">Muokkaa </Translation>
<Translation Language="it_IT">Modifica</Translation></Text>
<Text Id="EDIT_CENTER_32P" Alignment="Center" TypographyId="mainFont32_full"><Translation Language="en_US">Edit </Translation>
<Translation Language="fi_FI">Muokkaa </Translation>
<Translation Language="it_IT">Modifica</Translation></Text>
<Text Id="EDIT_LEFT_32P" Alignment="Left" TypographyId="mainFont32_full">
<Translation Language="en_US">Edit </Translation>
<Translation Language="fi_FI">Muokkaa </Translation>
<Translation Language="it_IT">Modifica</Translation></Text>
‎2022-06-14 08:40 AM
Hello Tuoman,
Yes I think you're missing something :) Actually we do have in TouchGFX Designer the option to have different alignments and fonts for each of your translation of your same resource.
Here is how to use it:
1- Create a new resource on Designer with different translations
2- If you want to change the alignment, double click on the translated resource and change the alignment
3 - If you want to change the font of your translated resource, go to the "Typographies" tab and click on the Typography you want to use, then click on the "+" logo to add the languages you want to change the font, and select another font.
4 - Now, if I change the language of my application (Config > General > Selected Language), my changes should be applied to my resource.
Hope this helps :)
/Osman
‎2022-06-17 01:21 AM
Hello, thanks for answer, but
>option to have different alignments and fonts for each of your translation of your same resource
I do not need different alignment for the same resource per language, instead I need:
>option to have multiple resources with different alignment for the same translation
As you can see, for EDIT_CENTER_32P we want each language to have center alignment. We do not want different alignment per language.
Problem is that we need the same translation of "Edit" in another place, in another style. We have Edit button (center 20p), Edit title text (center 32P), Edit menu item (left 20P).
All languages should always have the same alignment. But we want to use the same translation, with multiple styles in various places.
We don't want to translate separately Edit button, Edit title text and Edit menu item, just because they have different alignment and font.
‎2022-06-23 02:37 AM
Hello Tuoman,
Then unfortunately the only way to do it would be the way you're doing it right now.
I've had a discussion about that with our team, and that might be a new feature we would like to implement. Thanks for the idea :)
/Osman
‎2022-06-30 09:36 AM
I had this same issue. I want to have a text resource table separate from alignments.
I get around it by having the code set the alignment based on another table.
All of my TouchGFX text resources are set to Center alignment as default. Another table determines which resource and alignment to use on any particular screen. I have code in the presenter read the table and set the alignment. (using resizeToCurrentText() and moveTo() methods on original width of Text Area)
I'd like to see something similar with fonts but I know it would be a challenge for the Auto-Generation of characters (Text determines what characters to include in a font). I wish there was a way to Auto-Generate characters for multiple fonts. In that way I can switch between two fonts with the same text resource. For example, I have 100+ text resources of Chinese in a medium sized font. I don't want to duplicate those text resources again just to display them in a smaller font. And I don't want to be forced to include the whole Chinese character set (lots of wasted flash) for both fonts just to make this happen.
‎2022-07-03 11:49 PM
Thanks. I added Idea https://community.st.com/s/idea/0873W000000fy0uQAA/detail
please support.
Another good idea to support: https://community.st.com/s/idea/0873W000000fxt0QAA/detail