Try our conversational search powered by Generative AI!

Set user interface language for all users

Vote:
 

Hi, how do you set global user interface language for the editor/admin interface? https://docs.developers.optimizely.com/content-management-system/docs/determining-languages The documentation is giving me nothing. Am I suppose to set something in Startup.cs or in appsettings.json?

#304932
Jul 10, 2023 16:28
Vote:
 

Hi Tam,

Each user can set their own language through the CMS see here for details:

https://webhelp.optimizely.com/latest/en/content-cloud-for-editors/multiple-languages.htm

Otherwise it will fallback I believe to the default configuration.

You can customise this see https://docs.developers.optimizely.com/content-management-system/docs/localizing-the-user-interface.

Checkout how to configure the fallback culture also https://world.optimizely.com/documentation/developer-guides/archive/-net-core-preview/CMS/configuration/Configuring-cms/#localizationOptions

Paul

#304991
Edited, Jul 11, 2023 12:18
Tam Duc Ha Vo - Jul 12, 2023 3:42
Hi, Paul

Aha, so I can just specify «FallbackCulture»: «no» in appsettings.json?
Vote:
 

Hi Tam,

That or 

  services.Configure<LocalizationOptions>(o => o.FallbackCulture = new System.Globalization.CultureInfo("no"));

Should do the trick.

Paul

#305043
Jul 12, 2023 8:16
Vote:
 

Hi Paul

Thank you for the quick reply. I have added the line of code in Startup.cs, but it seems like the language in the interface is still in english?

Maybe I'm missing something

#305045
Jul 12, 2023 8:38
Vote:
 

Use this as part of your middleware in startup.cs.

var globalizationSettings= ServiceLocator.Current.GetInstance<GlobalizationSettingsOptions>();
globalizationSettings.UICultureLanguageCode= "no";

If the user has specifically set a language in their profile then it will prioritize that over the code above.

#305055
Jul 12, 2023 13:13
Vote:
 

Hi Surjit,

Would this also work?

services.Configure<GlobalizationSettingsOptions>(o => o.UICultureLanguageCode = "no");

Paul

#305104
Edited, Jul 13, 2023 8:12
Tam Duc Ha Vo - Jul 13, 2023 11:33
That seemed to have done the trick. Thank you!
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.