Developing for Multilanguage Sites

Posted by Community Admin on 04-Aug-2018 23:23

Developing for Multilanguage Sites

All Replies

Posted by Community Admin on 09-Dec-2012 00:00

Hi guys,

have someone experience with writing custom widgets for Multilanguage sites ? I have tried the widget selector from Josh, but it is not working in other language as primary language of the whole site. As seen on screenshot, the PageSelector selects Pages in primary language. @Telerik: It will be nice write an article covering the development for Multilanguage sites (selectors, controls, etc.).

Pavol

Posted by Community Admin on 10-Dec-2012 00:00

Hi Pavol,

I'm working on a multilingual site with custom widgets as well. The page selector didn't work for me at first, and the linking option in a HtmlField didn't either. I copied the code generated by Thunder and ended up with this:

You probably already have something like this in the designer code:

Protected Friend Overridable ReadOnly Property PageSelectorLinkPageGUID() As PagesSelector
    Get
        Return Me.Container.GetControl(Of PagesSelector)("pageSelectorLinkPageGUID", True)
    End Get
End Property

You also need this to set the current culture:
Protected Overrides Sub InitializeControls(container As Telerik.Sitefinity.Web.UI.GenericContainer)
    If (Me.PropertyEditor IsNot Nothing) Then
        Dim uiCulture = Me.PropertyEditor.PropertyValuesCulture
        Me.PageSelectorLinkPageGUID.UICulture = uiCulture
    End If
End Sub

I hope it helps!

Posted by Community Admin on 10-Dec-2012 00:00

Hi Arno,

the sample code from Josh is in C# .... in Designer i have following methods

protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
        
            // load in simple mode
            base.DesignerMode = ControlDesignerModes.Simple;

            // set root node for page selector
            
            PageSelector.RootNodeID = Telerik.Sitefinity.Abstractions.SiteInitializer.FrontendRootNodeId;

            // set the image selector type to use string (src)
            ImageSelector.DataFieldType = typeof(String);

            // initialize the taxonomy selectors
            CategoriesSelector.TaxonomyId = TaxonomyManager.CategoriesTaxonomyId;
            TagsSelector.TaxonomyId = TaxonomyManager.TagsTaxonomyId;
        

        /// <summary>
        /// Gets the page selector.
        /// </summary>
        protected PageField PageSelector
        
            get return Container.GetControl<PageField>("PageSelector", true);
        

No PageSelectorLinkPageGUID :(

Posted by Community Admin on 10-Dec-2012 00:00

Hi Pavol,

Translated to C# and that sample code I would guess that adding this code below "PageSelector.RootNodeID = Telerik.Sitefinity.Abstractions.SiteInitializer.FrontendRootNodeId;" may work:

if ((this.PropertyEditor != null))
    object uiCulture = this.PropertyEditor.PropertyValuesCulture;
    this.PageSelector.UICulture = uiCulture;

Posted by Community Admin on 10-Dec-2012 00:00

Hi Arno,

i'm running Sitefinity 5.1.3450 SE .... there is no UICulture Property on PageSelector :( .... I have found following Article in Forum. Regarding Telerik Support Staff is a bug on PageSelector ...

www.sitefinity.com/.../pageselector-pagesservice

Pavol

Posted by Community Admin on 10-Dec-2012 00:00

Hi Pavol,

That's too bad. I hope someone knows a work around in case you can't upgrade. I'm running 5.2.3800. It works there.

Posted by Community Admin on 10-Dec-2012 00:00

Hi Arno,

thanks for your Info. I hope the customer pay a license upgrade and i can continue deliver the "right code" :)

Greetings,

Pavol

Posted by Community Admin on 10-Dec-2012 00:00

Hi Arno,

i have tried this with 5.2.3800 SE with no sucess .... the UICulture Property is definitelly missing on PageSelector object !  Have i something omitted ? The PageSelector is of Type PageField in my Designer class.

protected PageField PageSelector
        
            get return Container.GetControl<PageField>("PageSelector", true);
        

Greeetings,

Pavol

Posted by Community Admin on 10-Dec-2012 00:00

Hi Pavol,

You can try to use the type Telerik.Sitefinity.Web.Ui.PagesSelector. That works for me.

Posted by Community Admin on 10-Dec-2012 00:00

Hi Arno,

can you send me the Designer Implementation ? What i need is store some links in custom widget for navigation. I use the PageField for storing the data. My mail adress is pavol.kokinda@gmail.com

Thanks,

Pavol

Posted by Community Admin on 10-Dec-2012 00:00

Sure, I just sent the files. It's in VB.NET, but you can use the Telerik Code Converter to convert to C#. Most of the code has been generated by Thunder.

Posted by Community Admin on 10-Dec-2012 00:00

That's weird, the mail just bounced with this message: "Remote host said: 552 5.7.0 review our attachment guidelines". I just attached a zip file.

Can't attach it to this post either. Just images allowed :-(

Posted by Community Admin on 10-Dec-2012 00:00

Hi Arno,

thanks for your support and cooperation.

Greetings,

Pavol

This thread is closed