859
Views
9
Comments
How to change language (application locale) in layaut and reload screen?
Question

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.

2025-11-19 06-14-01
Miguel Verdasca
Champion

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

2021-07-06 06-53-37
Jordan Kozuch

Miguel Verdasca wrote:

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

 

 Reactive

2021-07-06 06-53-37
Jordan Kozuch

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?

2024-12-18 16-06-42
Junaid Syed

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

2021-07-06 06-53-37
Jordan Kozuch

Junaid Ahmed Syed wrote:

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

 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.

 

2024-12-18 16-06-42
Junaid Syed

Jordan Kozuch wrote:

Junaid Ahmed Syed wrote:

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

 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.

 

 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.

 

2021-07-06 06-53-37
Jordan Kozuch

Junaid Ahmed Syed wrote:

Jordan Kozuch wrote:

Junaid Ahmed Syed wrote:

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

 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.

 

 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

 

UserImage.jpg
Tomasz M Lipinski

Hi,

Let me recapitulate the issue. We want to achieve a functionality that in the Traditional Web App is implemented as follows:

  • the SwitchLanguage control has links bound to every language
  • These links are of the type: Submit (and point to an empty Screen Action)
  • Therefore selecting a new language fires a postback that forces rendering the whole screen - with new translations but with all user data (inputs) preserved

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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.