I want to change app locale in layaut and reload the screen but i don't want to use event for every folmular in the application.
Hello first of all, what type of application are you working on? Web, Mobile, Reactive?
And can you explain better what you intend to do, so that we can help you?
Cheers,
Miguel
Miguel Verdasca wrote:
Reactive
Hi,
please check this article: https://medium.com/@miguel.f.verdasca/outsystems-translations-in-mobile-and-reactive-web-applications-1c899a0dfb55
You can use this component from forge: https://www.outsystems.com/forge/component-overview/4667/mobile-and-react-translations
Cheers
Hello, my problem is how to implement switch button to change language in a layout. The problem is, i need to reload the screen and i lose my data from folmular. To do that i can use events, but it is not comfortable because then i have to do changes in many modules and screens, because that layaut is used for many screens. In traditional web applications that was not a problem, but in react application if i just redirect to the same screen i lose data from folmular. The question is how to do that in reactive forms?
Hey Jordan,
I think you are trying to change the screen text based on the locale selected, if that is the case then of course your screen needs to know when to change it. As far as event handling goes you can make the event non mandatory which allows you to omit the handler if you don't need it.
Hope this helps!
Junaid
Junaid Ahmed Syed wrote:
Yea... unfortuantelly i have to translate every screen so setting handlers everywhere is not my dream. I like to just reload the screen by som kind of redirect and not lose actual data is that possible in reactive forms? Because in traditional forms its possible.
Jordan Kozuch wrote:
I am not sure why you think you would have to reload the screen. In the event handler you just need to reset the labels on your screen, and this won't have any impact on values user has entered in the input fields on the screen.
I need to reload the screen to change language... the button to change language is in layout, and after switch it have to change language in every screen wher that layaut is used
Let me recapitulate the issue. We want to achieve a functionality that in the Traditional Web App is implemented as follows:
The core question is: how to achieve such functionality in the Reactive Web App model? Selecting a new language causes the Locale to be set to the new value but how to force the whole screen to be rendered with new translations? The SwitchLanguage control is placed on every screen - in a placeholder exposed by the main layout control. The re-rendering of the screen must be forced at the level of these controls - end-screens must not know anything about switching languages. And the solution: get the current URL and redirect to it, is not satisfactory because it will cause user's data lost.
Regards
Tomasz