I am currently creating a new page from code to use as my startpage for a sitedefinition which I also create from code..however.. even if I publish the newly created startpage I always end up with the following message in the CMS UI:
"This content is in English. It does not exist in svenska. Would you like to translate it now?"
How can I "Translate" the page from programatically and then publish it as well? I havent been able to find anything related to this here or while googling it..
Thanks in advance!
Assuming I understand your question correctly it should just be case of using:
To translate into Swedish and publish you'd want something like (untested):
var translatedContent = _contentRepository.CreateLanguageBranch<IContent>(contentLink, CultureInfo.GetCultureInfo("sv"));
_contentRepository.Save(translatedContent, SaveAction.Publish | SaveAction.SkipValidation , AccessLevel.NoAccess);
Hope that helps,