Monday, February 5, 2018

Testing multiple languages in SharePoint Online and forcing a modern site’s language

An office desk of a designer showing desktop screen, mouse, iphone and other things.

Image by taner ardalı at Unsplash

More often than not I encounter the following scenario (and I suspect this is quite common in a lot of European countries): When a company’s tenant was created they chose their locale as the default language. This might not be an issue, until they remember that the official language should be for example English, which differs from the locale.

A good example is a tenant which was created in Norwegian. This often(*) leads to sites and Office 365 Group modern sites to have Norwegian as the default language, while having it in English would be ideal.

This post cover how to test multiple languages, and also how to force one particular language – as you might want to force different languages for different users. And, you cannot really force the language per site, unless for site collections and communications sites when you create them via an API.

(*) depending on how the site was created

The solution for testing multiple languages

If you want to test multiple languages make the following three conditions are satisfied:

  • the language you want to test is enabled on your site
  • you don’t have a default language in your profile
  • set the language you want to test as the topmost language in your browser, for example in Chrome as this does not work in Edge/IE on Windows 10

A language lesson

The root question is, how does SharePoint decide which language to use for the user interface? First you need to see which languages has been enabled for your site. By default, all languages are selected, but you may disable any one you want, except the default one as seen on the image below. (Append /_layouts/15/muisetng.aspx to the end of a site URL to directly access Language Settings for a site)

image

Next up SharePoint checks if you have a default language set in your Delve profile (which is usually the case) – if this is blank SharePoint takes a look at the language you have set as the default language in your browser. For Edge/IE on Windows 10 this will be the display language of Windows 10. And this is where the problem starts. Guess how many corporate PC’s have Norwegian as the default OS language, while they want to surf web pages in English?

This means that due to sites being created with Norwegian as the default, users having Norwegian as the default language in Office 365 to get time/date formatting correct, and the users using Edge/IE have Norwegian Windows 10, then all web pages in SharePoint Online will be displayed in Norwegian.

The story for Chrome is somewhat better as you can go to the browser settings and set what the default language should be. Set this to English and you’re all good as long as the Delve profile has no value set.

Forcing the language for users

As mentioned, in SharePoint each user have an option to force what language the UI should preferably be displayed in, which can be set via the Delve profile. Getting there is quite cumbersome, but here are the steps:

  • Go to you profile
  • Click “Update profile”
  • Click “How can I change language and regional settings?”
  • Click the “here” link
    image
  • Click the … ellipses and pick “Language and Region”
    image
  • Add your default language
    image

You may skip directly to step 5 by going to the URL: https://yourtenant-my.sharepoint.com/_layouts/15/editprofile.aspx?UserSettingsProvider=dfb95e82-8132-404b-b693-25418fdac9b6

It might take a little while for the change to stick, but after a while if your profile language matches an enabled site language you should be good to go.

Each user can also go to https://portal.office.com/account/#settings to set their default Office 365 language, and this language is then synchronized over to the Delve user profile.

image

Scripting the language per user

If you’re an administrator you may script the default language for your users.

To set the language for all of Office 365, set the preferredLanguage attribute of the user in Azure AD. This will sync it’s way over to the Delve profile as well – but in my experience it’s best to set the value in both AAD and SharePoint at the same time.

If you only want to set the SharePoint language you can achieve this with for example PnP PowerShell. The command to set English as default is:

Set-PnPUserProfileProperty –Account some.account@contoso.com  -PropertyName "SPS-MUILanguages" -Value en-us

If you have a lot of users you might want to take a look at the CSOM bulk upload API in order to speed up the update.

Summary

In many countries users want to have a different display language in SharePoint from what they use for time and date formatting or their operating system. Combine this with Office 365 language settings and you quickly run into issues.

The ideal scenario for any type of site in Office 365 would be to set the default site language on creation. Today we can programmatically achieve this for regular site collections and communication sites, but not for Office 365 Group sites. And you cannot change the default language of an already created site collection.

For sites which are outside our control the best solution today is to set the default language per user in AAD and Delve profile – ensuring OS or browser language settings are disregarded.