If you ever find yourself wanting to enable a particular language or set of languages on a site Collection and all subsites, and if you do NOT want to enable all languages installed but rather Control what gets enabled? Here is a scripot that will help you.
In my own scenario I had 4 site Collections, each tageted for a different nordic country, Sweden, Norway, Finland and Denmark. So, the need is to have enabled English for all and only the countrys language for the 4 site Collections.
Looking for an existing sample code to use, I found many that were copies of the MSDN sample, this is a good piece of code but it enables all languages installed.
So, trying to find a clever way of selecting what language got enabled, I found an old script I created for the same customer, the solution was so simple it works!
While iterating thru all the installed languages, site by site, I check the displayname of the Language and add criteria fro the languages to install. Beautifully simple 🙂
There is Little difference between this and the MSDN sample code, but is was an important difference to me.
This is what I used in the end:
# Enables SELECTED installed languages for each subsite in a site collection$spSiteURL = http://sharepoint.balkestahl.se/sites/subsitecountry$spSite = Get-SPSite -Identity $spSiteURLforeach ($spWeb in $spSite.AllWebs){ $spWeb.IsMultilingual = $true $WebRegionSettings = New-Object Microsoft.SharePoint.SPRegionalSettings($spWeb) foreach ($language in $WebRegionSettings.InstalledLanguages) { If ($language.DisplayName -eq "English" -or $language.DisplayName -eq "Swedish") # Add the displayname of any langauge you have installed: -or $language.DisplayName -eq "Norwegian" -or $language.DisplayName -eq "Finnish" -or $language.DisplayName -eq "Danish" { write-host -BackgroundColor Green -ForegroundColor Black "Update -" $spWeb "site with LCID:" $language.DisplayName $culture = New-Object System.Globalization.CultureInfo($language.LCID) $spWeb.AddSupportedUICulture($Culture) } else { Write-host " Language not activated: " $language.DisplayName " on site " $spWeb.Name } } $spWeb.Update()}
This saved me hours and hours…or made it possible 🙂
The running of the script looks something like this, in my case around 3000 times for the Swedish collection, all in all, 50.000 subsites!):
Before running the script, in each site, you have these settings:
(Accessed under: Site Settings/Language Settings, path: /_layouts/muisetng.aspx)
And what we want to do, is check the box for the selected language(s) and move on to the next.
When adding the criteria to the If statement, use the displaynames exactly like in the list in Site Settings/Language Settings:
This script saved me, I hope it can do the same for some of you.
A few thousand years ago, humans were a race of hunter/gatherers. We also lived in caves and were a very simple and crude race. At times when working with SharePoint, you can find that the old mindset is coming back…if only for a few seconds.
Language Packs.
I have been in the situation myself where I find myself lost regarding language packs, so I was forced to find all these things out and here are my findings for you to reuse at will.
This post will not cover what language to use when and when you need to do some more work to get a site completely localized, that is for another post. This is about deploying them, getting the correct bits onto the servers and getting them to work.
What do I need to install:
First: Technet states that: SharePoint Foundation 2010 language packs are not required for SharePoint Server 2010.(Deploy language packs (SharePoint Server 2010))
Perhaps there are different opinions as there are about what to install regarding CU’s, but I have followed this advise without any issues or missing language bits.
Now, you have a series of different LP’s and namings are different in different places, I’ll focus on the clean SharePoint 2010 Foundation and Server. No Project or other unrelated stuff touched here…
At the very end of this post you will find the complate list of Languages available. (Updated 11-11-04)
1. Foundation:
You need the Language Pack files for the language you need to have present in your sites. English, German, French, Arabic…at this point in time, I would recommend that you install the LP and its SP1.
2. Server
The same goes for Foundation as well as for server.
Find the binaries:
Correct me if you think that I’m wrong, but it was never easy to find the files you need. I have simply collected the links you need in one place.
Description from Microsoft, judging by the english LPSP1 at 9MB there has not been many updates which is a good thing:
Service Pack 1 (SP1) for Microsoft SharePoint Foundation 2010 Language Pack contains new updates which improve security, performance, and stability.
Additionally, the SP is a roll-up of all previously released updates.
The KB: http://support.microsoft.com/kb/2460059
See Server for details on the actual downloads. Difference here is that the name of the complate package for foundation is ‘SharePointLanguagePack.exe’ instead of ‘ServerLanguagePack.exe’ for Server. I would rename the ‘SharePointLanguagePack.exe’ to‘SPFoundationLanguagePack_en-us.exe’ . The LPSP1 for foundation has a nice spf in front of it (spflanguagepack2010sp1-kb2460059-x64-fullfile-en-us.exe), placing it on your foundation servers. Although, maybe ‘FoundationLanguagePackSP1_en-us.exe’ would be easier and more explaining…
2. Server
2010 Server Language Packs for SharePoint Server 2010, Project Server 2010, Search Server 2010, and Office Web Apps 2010 (is the ‘short’ name of this LP)
The design of the downloadpage will change based on what language you select, and in a few languages you must press ‘Change’ or the button that corresponds in that language. After you have pressed change, or as in for example the english page, that will redirect on the dropdown-select and a click on the page, you can start the download (you will get it). The file you will get is named ‘ServerLanguagePack.exe’ no matter what language it is for. A nice best practise is to rename it during or after it is downloaded to something like SPServerLanguagePack_en-us.exe or similar, so that you can separate your different language pack files later on.
For the Language Pack Service Pack 1, you obviously have something completely different. The site will look a little different but generally the same, it will just like the LP page look different in different languages, so that needs no further description.
What is really different is the files you get. They are here named as: serverlanguagepack2010sp1-kb2460056-x64-fullfile-en-us.exe, Obviously…I rename them simply ServerLanguagePackSP1_en-us.exe as they will most likely end up together in one folder.
All download pages and packages are localized in itself, so if you need to install for example an arabic LP and don’t speak arabic, make sure to memorize the location and meaning of the buttons, but also remember that they will be mirrored.
Use any method you prefer, clicking on them one by one and wait for it to finish, then click the next, and so on. Or…you do as I usually do, create a script. In a multitier farm this is essential so that you can save time to do other great things.
My simple script looks like this for the Swedish and German LP’s + LPSP1: (saved in a text file as Install_LP.cmd)
Install the binaries on every Application and Web server in your farm! This is the only approach that will be accepted when you want to run the PSConfig/Config Wizard to finalize the update in the farm. The technet instruction above is a bit shaky on this particular subject but this is a fact, you need the exact same Language Packs’s on all of your servers, except off course the Database servers and the email servers…
In order to run PSConfig, I also use a script to do it, save a text file in the same folder as the updates and name it Install_PSConfig.cmd (or something you like better). It needs a single line:
Direct it to where your 14 Hive is located. This way, you don’t have to look up the exact functions of the PSConfig tool every time…
(if you have a multitier farm with many servers, store the scriptfiles on a fileshare and the path will be the same on all servers, you will also only have to update it in one place.)
Same store as for FOundation, the files are different but the method needs to be the same. The script would now look something like:
“C:\Updates Binaries\SPServerLanguagePack_sv-se.exe” /quiet
“C:\Updates Binaries\SPServerLanguagePack_de-de” /quiet
“C:\Updates Binaries\SPServerLanguagePackSP1_sv_se.exe” /quiet
“C:\Updates Binaries\SPServerLanguagePackSP1_de-de.exe” /quiet
(The SP1’s takes very long time to apply…if memory serves me right)
Slipstreaming the SharePoint Language Packs, do or not to do?
During the SharePoint installation, the answer is NO! Not supported, can’t do it! The /Updates folder is only for SharePoint updates and SharePoint updates alone, ServicePacks and Cumulative updates and the likes, functional add-ons like LP’s not included. Try it if you will, but it will simply not work.
During the Language Pack installation…given the way I do it with a silent script, I would say Do NOT. Slipstreaming the LP updates is possible but it does not really save you a lot of time and I know that there have been issues. You will easily loose more than you win.
Verify:
After you have found, downloaded and installed your Languages, how do you see that they are installed at all…? There are a few places to look.
Control panel on one of your SharePoint Web or Application servers:
The Language Pack.
View in Control Panel, Uninstall or change a program
The Language Pack Service Pack 1
View in Control Panel, Uninstall an Update
In CA you will find information on upgrades in 3 places, Servers in farm, Check Product And Patch Istallation Status and Check Upgrade Status. If your Check Upgrade statyus looks like this you can relax, for this time…
All Done!
I almost forgot! Powershell. Check out installed and missing updates by running:
Get-SPProduct | select *
and
Get-SPProduct | select -ExpandProperty PatchableUnitDisplayNames
(Requires that you first run add-pssnapin Microsoft.SharePoint.powershell)
Summary
There are probably things that should be here that I have missed, or that you think is incorrect or that should be included. Please let me know so that I can correct this and make this a better place of information on Language pack finding, collection and deployment.
1 down, at least 3500 steps left to get your ultimate SharePoint 2010 farm in order…