Last week, I was doing some support for a customer which had some issues with variations on their intranet which is based on SharePoint 2010.
They have 3 variations:
- English (Source)
- Dutch
- French
While investigating an issue, I started playing around with the browser language and noticed the following :
- Browser language = English => Redirect to the “English” variation
- Browser language = Dutch => Redirect to the “English” variation
- Browser language = French => Redirect to the “French” variation
Dutch users were redirected to the English site… awkward. I looked at the variation labels and it was pretty clear why this was happening.
The english variation is created with the “Dutch” locale. The problem with this is… you can’t change it once it has been created.
The solution for this lies in PowerShell. Variation labels are stored in a hidden list on the root web of the site collection and is called “Variation Labels”.
To change the locale, you can use the following script:
1 2 3 4 5 6 7 8 9 |
Add-PSSnapin Microsoft.SharePoint.PowerShell $Site = Get-SPSite http://intranet.westeros.local $Web = $Site.RootWeb $VariationsList = $Web.Lists["Variation Labels"] $Label = $VariationsList.Items | ? {$_.Title –eq "English"} $Label["Locale"] = 1033 $Label.Update() $Web.Dispose() $Site.Dispose() |
Just replace the URL for the site with the url where the variation hierarchy has been created and the “English” with the title for the variation label with the wrong Locale.
Once this is done, the Locale of the variation label is changed and the users are directed to the correct site.