cancel
Showing results for 
Search instead for 
Did you mean: 

Simulator Screenshots in all Languages

AEber.2
Associate

Hi,

one of the most comfortable functions of the simulator is the possibility to create screenshots. We heavily make use of this for our operation manuals.

The point is: Now we have 24 languages and even consider to add some more. This means we have to navigate to main menu to change the language, then navigate to the requested screen, open windows, do scrolling etc., take a  screenshot and repeat. It is an exhausting procedure to create every picture in every language.

A litte script would be perfect:

for(i=0; i<MAX_LANGUAGE; i++)

{

   setLanguage(i);

   MakeScreenshot();

}

Okay, it sounds easy and maybe it is not. Nevertheless, for me it would be sufficient to change the language with keyboard shortcuts (maybe page up/down). If you would show the language in the title and add it to the filename of the screenshot it would be a very feasable solution for us.

This suggestion is similar:

Fast switch between selected Languages in TouchGFX... - STMicroelectronics Community

Also testing the screens in all languages would be very easy. It is necessary to check every screen for translations to fit into the text areas.

Do you think it is possible to add the feature to the simulator?

Best regards

Alexander

2 REPLIES 2
GaetanGodart
ST Employee

Hello @AEber.2 ,

 

From your description, I assume that being able to change the language in the code by clicking on a keyboard key would be enough.

To do so, I would create a new interaction on the screen you want to take multiple screenshot of, set the trigger to be "Physical key press" and select a key from your keyboard and make this interaction call a new virtual function.
Then you have to overwrite this function to make it change language.
I would suggest you to look at the "Text animation demo) :

GaetanGodart_0-1731329115760.png

In it, you can look at the function "moveIsDone()" where we use the function "Texts::setLanguage(languageToBeChangedTo)" to set the new language.

void textAnimationView::moveIsDone()
{
    switch (languageSelector.getSelectedLanguage())
    {
    case BITMAP_ENGLISH_FLAG_LARGE_ID:
        Texts::setLanguage(GB);
        break;
    case BITMAP_FRENCH_FLAG_LARGE_ID:
        Texts::setLanguage(FR);
        break;
    case BITMAP_ARABIC_FLAG_LARGE_ID:
        Texts::setLanguage(AR);
        break;
    case BITMAP_CHINESE_FLAG_LARGE_ID:
        Texts::setLanguage(CH);
        break;
    default:
        break;
    }

Alternatively, you can look at the tutorial 6 .

 

For the screenshoot part, you could look at the file "HALSDL2.cpp" where the screenshot functions are defined.

You could call the appropriate function in the new virtual function you created so that right after changing the language, you automatically take a screenshot.

Also, it seems that the name of the screenshot is defined in "void HALSDL2::saveScreenshot()", you could modify it to set the name of the screenshot to something more appropriate such as the id of the current language.

Note that this file might be generated by TouchGFX and therefore, it might be regenerated every time you run the simulator, in that case, you could simple create a custom "takeScreenshot" function in your view.cpp.

 

I hope this helps!
If this comment solves your issue, I invite you to select it as "best answer".

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)
GaetanGodart
ST Employee

Hello @AEber.2 ,

 

Have you been able to move forward on your issue?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)