Change Locale getting Reset

  

Hi,

I have made my application multi lingual. I have different tenants for different countries, each tenant is linked to a default language. 

When a session is started I identify the tenant and change the Locale using the SetCurrentLocale action, everything is good until this point. I can navigate between pages and there is no problem.

The problem comes whenever I save or edit something, at first the locale is not changed I guess because it's an ajax refresh, but if I were to refresh or go to another screen it goes back to the Default Application Locale which is english.

I have set breakpoints where I set the locale, and it is not hitting them, so I don't know what is causing my session locale to get reset.

If anyone has any input I would really appreciate it.

Hi Andres,

    usually location is not related to tenant. The OS application supply the language according the language set in the browser. 

   The tenant is only an option to "reset" the database for new users (tenants).

At least, this is my understanding.

Luck

Luciano Schiavo wrote:

Hi Andres,

    usually location is not related to tenant. The OS application supply the language according the language set in the browser. 

   The tenant is only an option to "reset" the database for new users (tenants).

At least, this is my understanding.

Luck

Hi Luciano,

Thanks for the response.

Yes, but it happens to be that for my application each country will be a tenant (they have their own data), that is why I am able to default the language based on that. 

The main problem is that even if I Set the Locale to a different one using a Language Bar, after I do any kind of save if I refresh it goes to English.


Hi Andres,

  have you tried to use the TenantSwitch ? It will do all job regarding the Site.TenantId that must be associated to the user after login.


Hello,

I'm Having the exactly same problem!

I save the language chosen by the user in Data Base and when it logins I set the Locale.

However every time I do a submit the language goes to Default!


Have you found a solution?

Hi Raphael,

    you need to set the language (SetCurrentLocale) in the login according to the user or tenant preference.


Have anybody find a solution for this issue?

We are encountering this issue, after we do an ajax refresh it goes back to english. 

we have a layout espace and a sessionB espace, in the sessionB espace, we have the session locale stored.  The functions setCurrentLocale and setCurrentlangauge resides in sessionB.

Layout espace contains the layout webblocks for the rest of the espaces within the application. So we set the locale on the Layout_Normal, etc, web-blocks that are being used by the other web-blocks and webpages in other espaces. For some reason it defaults to english when doing an ajax refresh.

has someone find a solution for this?


Alexei...

Try to call SetLocale on the OnBeginWebRequest action.


This solved for me.