cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a second language to TouchGFX project

BGuth.1
Senior

Hi, I am using TouchGFX 4.16.1. Could you suggest a tutorial or some other material to add a second language to my project. Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi BGuth.1,

I opened your project, and the problem I see is that you haven't created a new font supporting your language in your TouchGFX Designer.

Here are the steps to make it work :

1- Click on "Texts" panel at the top and "Typographies". You will have a list of all Typographies you can use at the moment. To add a new one, click on Add new Typography"

0693W00000LyiMAQAZ.png 

2- Edit the new typography (enter a name, select your kruti-dev typo, and change the size). Then Click on "Save"

0693W00000LyiNrQAJ.png 

3- Go to "Ressources" and for your ResourceId1, edit your translation by clinking on the "T" button when you pass your mousse on the text zone. Then select the new Typo you've just created in step 2.

0693W00000LyiTGQAZ.png0693W00000LyiUiQAJ.png 

3- Run the project on your simulator

0693W00000LyidzQAB.png0693W00000LyieOQAR.pngBut now, the problem we see is that the text you added doesn't match with the text shown on the simulator. That's why I highly recommend you to try other fonts to see which one can be compatible. I tried with an other font I fount here : (https://fonts.google.com/noto/specimen/Noto+Serif+Devanagari?subset=devanagari&query=Devanagari) and it looks to be running fine.

0693W00000LyiiBQAR.pngLet me know if it works fine on your side :)

/Osman

Osman SOYKURT
ST Software Developer | TouchGFX

View solution in original post

5 REPLIES 5
Osman SOYKURT
ST Employee

Hi BGuth.1,

We don't have a tutorial, but we have this documentation for TouchGFX Designer version 4.16.1 that can help you.

Here the steps to add a second language with TouchGFX Designer:

1 - Click on "Texts" panel at the top and "Add New Language"

0693W00000Lyb5gQAB.png 

2- A popop will appear, you'll need to add the language you want to add. Then click on "Save"0693W00000Lyb7NQAR.png 

3- In "Resources", create a new resource by clicking on "Add new resource" and fill the info about the the resource.

0693W00000LybBoQAJ.png 

4- Go back to "Canvas" and add a new text widget.

0693W00000LybFHQAZ.png 

5 - On the right panel, click on "Resource" under the "Text" section, and select your new ressource.

0693W00000LybGtQAJ.png 

6- Now go to "Config", and under General, change the "Selected Language". The change will automatically take place on you canvas

0693W00000LybHdQAJ.png0693W00000LybKbQAJ.png 

7- Enjoy :)

/Osman

Osman SOYKURT
ST Software Developer | TouchGFX

Hi @Osman SOYKURT​ ,

Thank you for your detailed reply and taking time to explain with images. I appreciate it.

I am looking to add a language that has completely different script than English (e.g. Devanagari). How can I do that?

Also, similar to Windows operating systems, I want to be able to select the language through a settings option and then change the langue of text in all screens as per the selection made. Please advice.

BGuth.1
Senior

Hi @Osman SOYKURT​ 

I downloaded Devanagari font (kruti-dev-021.ttf) and tried implementing a simple example. I put the font in ...\TouchGFX\assets\fonts folder and followed the example you provided in adding the language. However, TouchGFX doesn't recognize the characters from the Davanagari script and showing the fallback character when I click on Hindi button.

I am attaching the project here for your reference. Please advice.

0693W00000LyfKzQAJ.png 

Hi BGuth.1,

I opened your project, and the problem I see is that you haven't created a new font supporting your language in your TouchGFX Designer.

Here are the steps to make it work :

1- Click on "Texts" panel at the top and "Typographies". You will have a list of all Typographies you can use at the moment. To add a new one, click on Add new Typography"

0693W00000LyiMAQAZ.png 

2- Edit the new typography (enter a name, select your kruti-dev typo, and change the size). Then Click on "Save"

0693W00000LyiNrQAJ.png 

3- Go to "Ressources" and for your ResourceId1, edit your translation by clinking on the "T" button when you pass your mousse on the text zone. Then select the new Typo you've just created in step 2.

0693W00000LyiTGQAZ.png0693W00000LyiUiQAJ.png 

3- Run the project on your simulator

0693W00000LyidzQAB.png0693W00000LyieOQAR.pngBut now, the problem we see is that the text you added doesn't match with the text shown on the simulator. That's why I highly recommend you to try other fonts to see which one can be compatible. I tried with an other font I fount here : (https://fonts.google.com/noto/specimen/Noto+Serif+Devanagari?subset=devanagari&query=Devanagari) and it looks to be running fine.

0693W00000LyiiBQAR.pngLet me know if it works fine on your side :)

/Osman

Osman SOYKURT
ST Software Developer | TouchGFX

Thank you very much. I see the new language text now.