Re-creating Multilanguage Links: A Step-by-Step Guide

Maybe you’ve also stumbled upon the issue of missing multilanguage links in your SitePages library in SharePoint Online. This can happen if you create translations in an unsaved default language Post / News Article.
Since the Column Translation languages (_SPTranslatedLanguages) is read-only, you can’t simply add the missing language tags to the existing pages. Instead, you need for example PowerShell to re-create the entries for each page.
This is where my new PowerShell script comes into play. It helps you to re-create all missing multilanguage links in your SitePages library by checking if the existing translations are correctly linked to the default language page.
If not, it updates the _SPTranslatedLanguages field accordingly.
Prerequisites
- You need to have the PnP.PowerShell module installed.
- You need the necessary permissions to run the script.
Step-by-Step Documentation
1. Set Up Variables
- TenantName: Use your tenant name.
- SiteName: Define the name of the site collection to be flagged as a Corporate News Site.
|
|
2. Connect to SharePoint Online
- Use PnP-PowerShell to connect to the SharePoint Online site.
|
|
3. Retrieve Language Folders
- Retrieve all folders from the SitePages library where the folder name contains exactly two letters. This “trick” I use to identify the language folders. So if you have also other folders in your SitePages library, with only two letters, you should adjust the script.
|
|
4. Process Each Language Folder
- the script looks in each language folder, to retrieve all pages.
|
|
5. Retrieve and Update Default Pages
- For each translated page, we now have to retrieve the corresponding default language page (in the root directory).
- Then we need to check if the column
_SPTranslatedLanguagesalready contains this language. - If not, we add it to the
_SPTranslatedLanguagesfield. We use theSystemUpdatemethod to update the field without changing the modified date. If you want / have to to update the modified date, you can remove the-UpdateType.
|
|
Full Script
|
|
I hope this script helps you to re-create the missing multilanguage links in your SitePages library. If you have any questions or feedback, feel free to leave a comment below.
Published on:
Learn moreWe can help you with Re-creating Multilanguage Links: A Step-by-Step Guide
If you want help implementing, troubleshooting, or improving this product, contact us and we’ll point you in the right direction.
Related posts
Creating Copilot Studio Agents Without an M365 Copilot Premium License
A common assumption when getting started with Copilot Studio is that you need a full Microsoft 365 Copilot Premium license. That assumption is...
Power Automate: Get events (V4) shared mailbox fix
When your flow reads a shared mailbox calendar using the Office 365 Outlook → Get events (V4) connector, it can fail in a way that looks like...
Using Managed Identity with Azure Automation & PnP.PowerShell
How to Set Up a Managed Identity for Azure Automation Runbooks and Use It in PowerShell Scripts with PnP.PowerShell This guide walks you throu...
UPDATED - Set Up Pay-as-you-go M365 Chat & SharePoint Agents
Introduction to Pay-as-You-Go Agents in Microsoft 365 Microsoft has introduced a flexible way for organizations to leverage AI capabilities wi...
How to Use Flexible Sections in SharePoint Pages and News
If you’ve been using SharePoint Online to build pages or share news, you know how important it is to have a layout that works for your c...
What's New in SharePoint Pages
1. New Carousel Layout in the Hero Web Part The Hero Web Part has always been a fundamental element of SharePoint pages. The new Carousel Layo...
Power Platform Solutions Made Simple
Introduction to Power Platform Solutions Power Platform Solutions offer many benefits, especially when moving from standalone flows and apps t...
Use your Bluesky post for comments on your Hugo Blog
Since Bluesky is getting really popular by people I interact with, I decided to switch my blog comments to Bluesky posts. In this blog post, I...
Exploring SharePoint Online's SiteAssets Library
The SiteAssets library in SharePoint Online often seems like a mystery to a lot of users I talk to, but it’s important to understand it ...
Step-by-Step Guide to Copy Pages between SharePoint Online
Unfortunately you can’t copy pages in SharePoint through the UI. But sometimes you may need to copy pages and their associated SiteAsset...