MultiLanguage on ContentProviders

Member since: 2007

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
  • Member since: 2007
    #119737 Removed, Apr 02, 2015 10:42
  • Member since: 2007

    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 is locked because the last reply was posted more than 6 months ago. Please contact epw@episerver.com to unlock it.