Core Blimey! - Sitecore Blog

Create Language Versions using Sitecore Powershell

November 17, 2014 | 1 Minute Read

A few months ago I was working on a global site that needed 10 different language versions of content. The site was completed in the English master version and some basic training was given to content authors in using Page Editor. There was just one problem: how could I create all the language versions of the content so the content authors could start using Page Editor to localise content?

Manually Add New Versions

You could do this (or hire an intern to do it) but it would involve some serious copying and pasting and some nasty finger injuries.

This module from Cognifide helps speed things up so there’s less copying, but still some serious clicking.

The Easy Way

I thought: this is a laborious task - this must be a job for Sitecore Powershell. I fooled around with some of the existing Sitecore Powershell Commandlets but got nowhere.

So I posed the question to Adam Najmanowicz @adamnaj on Twitter and within a day he’d written a Commandlet that would do the job - this truly shows how great the Sitecore Community is!

This is what he came up with and it worked a treat. I’ve used this on a few global sites now:

The commandlet is really easy to use. Here’s an example of how I created all 10 languages by pasting this one line into the Sitecore Powershell Console:

   Add-ItemLanguage -Path "master:\sitecore\content" -Language "en" -TargetLanguage "de-AT","de-de","en-za","fi-fi","fr-be","it-it","pl-pl","ru-ru","sv-se","fr-fr" -IfExist OverwriteLatest  -IgnoredFields ""

Hope this is useful!