cancel
Showing results for 
Search instead for 
Did you mean: 

Why alignment and font is combined to translations?

Tuoman
Senior II

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>

5 REPLIES 5
Osman SOYKURT
ST Employee

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

0693W00000NrqFLQAZ.png0693W00000NrqFQQAZ.png 

2- If you want to change the alignment, double click on the translated resource and change the alignment

0693W00000NrqHlQAJ.png 

0693W00000NrqFzQAJ.png 

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.

0693W00000NrqHMQAZ.png0693W00000NrqHRQAZ.png 

4 - Now, if I change the language of my application (Config > General > Selected Language), my changes should be applied to my resource.

0693W00000NrqJ3QAJ.png 

0693W00000NrqHgQAJ.png 

Hope this helps :)

/Osman

Osman SOYKURT
ST Software Developer | TouchGFX

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.

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

Osman SOYKURT
ST Software Developer | TouchGFX
Guit32010
Associate III

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.