Tuesday, 14 August 2007

Sharepoint 2007 - Set MySite Locale (Regional settings) to UK (EN-GB)

I spent much time recently investigating how to set regional settings (locale) on a MOSS 2007 Web Application level so that any new site collections inherit the appropriate regional settings (in my case EN-GB).

It is possible to set regional settings at site collection level and inherit down to all subsites, which works fine when you do not use self-service site creation, but not otherwise, especially for MySites. Back in May 2007 I opened a call with Microsoft about this (via the Education Support Centre http://www.escuk.net/) and recently received the news that Microsoft have identified this as a code change and the developers are considering the change. As it stands Microsoft may well need more persuasion in order to make this change, so if you are having this trouble please get in touch with me and we can build a case.

There are some work arounds to this if you are prepared to forefit Microsoft support for your Sharepoint implementation i.e.

1. Alter the Store procedure proc_CreateSite which performs the site creation process and accepts language and locale as parameters, to always use locale 2057 (English UK) for each portal (In the relevant _site database). Currently it will be set with no default, so will always use the 1033 locale (English US). If you were to do this, you could be asked to remove the setting from the settings from the store procedure and more importantly revert back any portals to before the changes were made.
2. Bulk update the webs table in the _site database for each Portal to have a locale of 2057 instead of 1033. This has the effect of changing all the sites to UK English.

Naturally I DO NOT recommend these changes due to supportability issues, but support from Microsoft may not be of concern in all implementations.

Another better workaround is to use feature stapling to provision a masterpage to new mysites by adding the regional settings to the featurereceiver (credit to Esben Kolind of Netcompany IT and Business Consulting for this suggestion):

mySiteWeb.RegionalSettings.LocaleId = 1030; //Danish
mySiteWeb.RegionalSettings.Time24 = true;


Microsoft have now developed a fix for this that has gone through testing, has been approved and is being rolled into a hotfix.

The initial fix released in October 07 broke the creation of MySites in my farm so was prompty uninstalled. A new version has now been released for pre-SP1. I'm awaiting Microsoft to send it to me. Microsoft plan to release a post-SP1 update in about eight weeks.

The second release of the fix works a treat and allows the administrator to set the locale in https://MySiteURL/_layouts/settings.aspx (the Personal Site Provider site) to whatever they want ie. UK and then this will be inherited to new My Sites.

A third release of the fix is now available for post SP1. Because this fix has not undergone full regression testing it is not available for general download. To obtain, contact Microsoft and quote KB942819.


Jamel said...

I can't find the KB942819. Could you please provide the link.


Rob Head said...

Hi Jamel.

You won't find it online as it has not been officially released. You will need to contact Microsoft support and quote them the KB number. They will then send you the patch.


Steve said...

You start your post be going on about the limitation within SharePoint to set the default locale for all Site Collections, but then proceed to finish off with a solution & hotfix which only appears to work for MySites. Am I right in thinking this hotfix only sets the default locale for Mysites - and other sites will still continue to be create under the EN-US locale?

Rob Head said...

Hi Steve,
You are absolutely right. For some reason Microsoft decided to design their fix for this to work only for MySites. I don't know of a way of achieving the same for normal site collections without writing any code (i.e. feature stapling). This does not cause us any issues as we centrally control site collection creation (other than MySites).
Please let me know if you come across a solution to this.

Steve said...

Hi Rob,

Thanks for getting back to me...

I agree. I've also tried feature stapling this functionality through a FeatureReceiver (Feature Activating) and it still fails.

I'm assuming the processing for a site collection's locale is done after the feature stapling code runs...

Steve said...


Hi Rob...

Feature Stapling does work... it just I forgot to 'Clean' the assembly in Visual Studio before deploying - doh!!

BenMiller87 said...

Hi Rob,

An interesting solution however, i seem to having to have a slightly different requirement from the fix - i don't want to set the locale for everyone, i want people to choose themselves (like they can anywhere else but mysites!).

The reason for this is that the availability web part that shows out of the box is returning our UK user's availability in EST, and if they go onto their own profile and click on My Settings to adjust their regional settings... 'Regional Settings' is not there! So you see, like everywhere else on sharepoint, i want users to be able to choose their locale but they can't.

I'm not expecting a fix from you or anything, just wondered what your thoughts were because this must've been raised by other multinational companies before! (surely?!)

Thanks in advance!