Try our conversational search powered by Generative AI!

MultiLanguage on ContentProviders

Vote:
 

Version 7.19.2

Hi! How do i do programatically so my content is multilangual (SV and EN) in the UI tree and on the site. Now i can-t change language when on a contentprovider page.

The .PageLanguage list is always count 0.

the problem? is that i can not DataFactory.Instance.CreateLanguageBranch(newPage.PageLink, new LanguageSelector("sv")); and after DataFactory.Instance.Save(newLanguagePage, SaveAction.Publish, AccessLevel.NoAccess); OR??

Ive set the capabilities to MultiLanguage http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-CMS/8/Content/Providers/Configuring-content-providers/

#119666
Apr 01, 2015 10:53
Vote:
 
#119737
Apr 02, 2015 10:42
Vote:
 

Found it!

 ILocalizable localizable = newPage as ILocalizable;
                var langs = new List<CultureInfo>();
                langs.Add(new CultureInfo("en"));
                langs.Add(new CultureInfo("sv"));
                localizable.ExistingLanguages = langs;
                localizable.Language = new CultureInfo(((LanguageSelector)languageSelector).LanguageBranch);


               newPage.LinkURL = this.ConstructContentUri(type.ID, newPage.ContentLink, newPage.ContentGuid).ToString();
#120066
Apr 09, 2015 15:07
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.