Using the Sitecore event handler 'OnItemSave', I am adding an English language verison of the item if it does not exist.
public void OnItemSaved(object sender, EventArgs args)
{
var item = Event.ExtractParameter<Item>(args, 0);
if (item == null) return;
//Add version of item in English
if (Sitecore.Context.Database.GetItem(item.ID, Sitecore.Data.Managers.LanguageManager.GetLanguage("en")) == null)
using (new LanguageSwitcher("en"))
{
item.Versions.AddVersion();
}
}
But this does not add the version in the en
language, it adds it in the Content Language
.