Do you want to create a Communication Site in another language? This post will show you how by creating a site with the primary language set to a language other than English using PnP PowerShell.
Before creating these, it is important to know that once you have chosen the primary language for the site, this cannot be changed – so it needs to be right.
I will be using the Microsoft Patterns and Practices library: PnP-PowerShell. If you haven’t heard of this or use this before – I highly recommend taking a look at the Microsoft documentation for this library: https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-pnp/sharepoint-pnp-cmdlets?view=sharepoint-ps#installation
This script is an example of creating a new communication site, with Welsh as the default language using the PnP-PowerShell commands:
|$adminUrl = "https://<tenant>-admin.sharepoint.com"|
|$newSiteUrl = "https://<tenant>.sharepoint.com/sites/Pensaerniaeth"|
|$ownerEmail = "<firstname.lastname@example.org>"|
|$siteTitle = "Pensaerniaeth" # Translates to "Architecture" – Bing Translator|
|$siteTemplate = "SITEPAGEPUBLISHING#0" # Communication Site Template|
|$lcid = 1106 # Welsh (https://capa.ltd/mui-lcids)|
|$timeZone = 2 # London (https://capa.ltd/sp-timezones)|
|Connect-PnPOnline –Url $adminUrl –NoTelemetry|
|New-PnPTenantSite –Template $siteTemplate –Title $siteTitle –Url $newSiteUrl `|
|–Lcid $lcid –Owner $ownerEmail –TimeZone $timeZone|
|Write-Host "Script Complete! 🙂" –ForegroundColor Green|
In the PowerShell script, you may notice that cmdlet requires a number for the “-LCID” to specify the language you want to use for the primary language. The Microsoft documentation does not clearly give the LCID for each language when you are trying to create a site in another language.
I have written a Locale Id page on this site, to refer to for all the languages that SharePoint supports (at the time of writing this post) so you can refer to the Locale IDs in the above script for other languages.
Or you can generate this yourself, by running:
|# Simple script to get the installed languages in SharePoint Online|
|Connect-PnPOnline –Url "https://<mytenant>.sharepoint.com"|
|(Get-PnPWeb –Includes RegionalSettings.InstalledLanguages).RegionalSettings.InstalledLanguages|
New features are coming to the site creation process that will allow you to select the language at first creation. When this is available this will give you another option; to use a self-service site creation process at the time of creating your Communication Site.
The above Screenshot shows an Office 365 group creation screen, however the announcement also indicates this will be available for communication sites.
Note: I will write another post when this has been released to one of our tenants and provide a link from this post.
This blog post is part of a series, check out this post “Series: Creating a multi-lingual Intranet using Communication Sites” for more related content.
- Microsoft Docs – PnP PowerShell Reference
- Microsoft Docs – SPO Cmdlet Reference
- Microsoft Tech Community – SharePoint Blog
- SharePoint Language LCIDs
- SharePoint Time Zone Ids
Note: In this post, I am using Welsh translated from Microsoft Bing/Translator Text API, I don’t speak Welsh so I rely on the accuracy of the translator services, if you find some Welsh words inaccurate or offensive, please let me know immediately by posting a comment or DM via Twitter and I will correct the content. Thank you.
This should will get you going… Enjoy!