Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Multilanguage node and entry API creation (7.5)



When createing/updating nodes and entries from code how do you specify what language version you want to update?

I have the following code,


var productNode = _contentRepository.GetDefault<Core.Models.MetaData.ProductNode>(parentReference);
productNode.Name = _catalogRepository.GetSafeProductName(name);
productNode.Code = code;
productNode.DisplayName = name;
return _contentRepository.Save(productNode, SaveAction.Publish, EPiServer.Security.AccessLevel.NoAccess);


and that creates the node and sets the english "DisplayName" property to name but the catalog also supports germany, how do I set the german DisplayName property? Same with entries but I suspect that the code is the same for the two?


Dec 04, 2013 10:49

Any information on this or is it impossible?


Dec 10, 2013 8:56

The contentrepository for comerce should work just like cms.  So if you whatever languange branch you are working in should be the one that is updated.  

Dec 10, 2013 20:01

Load the content in the second language you want to edit, clone, update and save:
var productNodeGerman = _contentRepository.Get<Core.Models.MetaData.ProductNode>(contentLink, new LanguageSelector("de"));
productNodeGerman = (Core.Models.MetaData.ProductNode)productNodeGerman.CreateWriteableClone();
productNodeGerman.Name = "Deutsch";
_contentRepository.Save(productNodeGerman, SaveAction.Publish, EPiServer.Security.AccessLevel.NoAccess);

This is somewhat different from CMS where you have to create the language version. In commerce all languages are immediately available (but with empty property values) so you skip that step and work like you would do the second time you edit content in CMS.

Dec 10, 2013 20:14



Dec 11, 2013 8:52
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.