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

#119666 Apr 01, 2015 10:53
    Member since: 2007
    #119737 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