Recently we had a problem with a (pretty large) 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. You get the picture.. ;-)
Do note that this solution doesn't work well for publishing sites as they depend on all sorts of libraries that don't have their name changed when you change the language of the site via the database.
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]]