Skip to main content

Changing the language of an existing SharePoint site

The problem was that the site was created in English, while it should have been created in Dutch. All content was in Dutch of course, but for instance the Site Actions button still said Site Actions, and when adding a document the buttons were "New", "Upload" and "Actions".

In order to solve this a couple of possible solutions were explored:

  • Saving the site as template didn't work, because you can only see the saved site when you create a site in the original language of the site

  • Using backup and restore didn't work, the site kept it's original language

  • Changing the language through the object model didn't work, because the Language property of the SPWeb object is read-only


This last attempt did trigger me to think that the language of a site is stored at SPWeb level. It is also stored in the database in the Webs table. So I decided to do a little test with changing the language in de database. And it worked like a charm!

Now you need to know that you're not supposed to change data in the database and that doing so is not supported by Microsoft. For me this was a very simple solution though to a pretty big problem. And the best thing was that it only took me 30 seconds to write the query and about 0.02 seconds to run it. Everything in the site is now Dutch, except of course for already created lists and libraries. So the name of the Pages library is still Pages and does not change to Pagina's. But the Site Actions button calls itself Siteacties, the Master Pages are Hoofdpagina's and View All Site Content is called Alle site-inhoud weergeven.

For changing the language of all sites in the content database to Dutch the query would be:
UPDATE dbo.Webs SET Language = 1043

Changing the language of one site collection can be done with:
UPDATE dbo.Webs SET Language = 1043 WHERE SiteId = [[SiteCollectionId]]

And for changing the language of a single web or subsite you can use:
UPDATE dbo.Webs SET Language = 1043 WHERE Id = [[WebId]]

Comments

Popular posts from this blog

How to get SPUser or SPGroup from Person or Group field

You have person or group field in SharePoint list and you want to programmatically get the user or person. The below code to gets SPUser from User or Group field in the list when multiple choice and Groups are not allowed in the field: //get SPUser SPFieldUser userField = (SPFieldUser)item.Fields.GetField("Users"); SPFieldUserValue userFieldValue = (SPFieldUserValue)userField.GetFieldValue(item["Users"].ToString()); SPUser user = userFieldValue.User; This part of code would help you to get SPUser when multiple choice is allowed and groups are not allowed: //Multiple choices are allowed SPFieldUser userField = (SPFieldUser)item.Fields.GetField("Users"); SPFieldUserValueCollection userFieldValueCollection = (SPFieldUserValueCollection)userField.GetFieldValue(item["Users"].ToString()); foreach (SPFieldUserValue userFieldValue in userFieldValueCollection) {     Console.WriteLine("     " + userFieldValue.User.LoginName); } And when group

SharePoint publishing page scheduling

In SharePoint 2010 publishing enabled team site collection is not showing schedule button in publish ribbon. Solution: Here is how to enable it  though the UI: Locate the SharePoint Server Web site on which you want to enable content approval and item scheduling. Click  Site Actions , click  Site Settings , and then click  Modify Pages Library Settings . Under  General Settings , click  Versioning Settings . Click  Yes  next to  Content Approval , and then click  OK . Click  Manage item scheduling .   Click to enable the  Enable scheduling of items in this list  check box, and then click  OK .

Changing Content Type Hub URL

Change the Hub URL through powershell by using: Set-SPMetadataServiceApplication -Identity " " -HubURI " " For Ex: Set-SPMetadataServiceApplication -Identity "Managed Metadata Service" -HubURI "http://contenttype.Domain.Com" When you try to do this you get this rather scary message: This is SharePoint telling you that this is a major thing so be careful! Essentially all your content types that you have published out will be removed if they can, and you have to republish all of your content types out again which can cause some issue.