More in this section

Forums / Developing with Sitefinity / Master Pages / Templates Localization

Master Pages / Templates Localization

6 posts, 0 answered
  1. Ray Tam
    Ray Tam avatar
    8 posts
    Registered:
    27 Feb 2010
    03 Mar 2010
    Link to this post
    I have a Page Template which itself has a couple of Custom User Controls.  How can I localize these controls?  I've already set up public properties to enter in my localized information but I can't seem to select a language to edit from.

    Thanks,
    Ray
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    03 Mar 2010
    Link to this post
    Hi Ray Tam,

    1. You need to enable Sitefinity's localization through your web.config file

    sample

    <localization  defaultProvider="Sitefinity" persistenceMode="PathPrefix" defaultCulture="en" allowSpecificCultures="True" cultures="en, es, fr, bg">

    2. Then you can drop LanguageBar control on a page or master page two set the current culture. The control resides under Navigation section of Toolbox Controls.

    3. You have to use Local or global resources to localize your controls


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Ray Tam
    Ray Tam avatar
    8 posts
    Registered:
    27 Feb 2010
    03 Mar 2010
    Link to this post
    Hi, thanks for the reply, I've already enabled localization for my site.  I have english and spanish available.  The thing is no matter which language I edit the page template in the change will always be in both languages.  I switched to spanish and entered in text in spanish, and switch back to english and the spanish text is showing.  This text is going into a public property of a custom user control that I have on the master page.
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    03 Mar 2010
    Link to this post
    Hi Ray Tam,

    Thank you for getting back to us.

    Unfortunately page templates do not have different versions for different languages. This is why Ivan has provided the bellow links. We recommend that the templates just provide place holders and common styles. Then you add controls to them which are localizable. Another thing you can do is create two versions of the same template (when you select a template you have the option to duplicate it) and have one for Spanish and one for English.

    All the best,
    Radoslav Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. Ray Tam
    Ray Tam avatar
    8 posts
    Registered:
    27 Feb 2010
    03 Mar 2010
    Link to this post
    Just to be clear, when I refer to a Page Template I am referring to the Master Page that I have created in code.  I've added a custom user control to this masterpage which percolates down to all the pages that use this Page Template.  From reading Radoslav's comment, he was suggesting that I create two Master Pages one for each language.  Is there no other solution to this?  The only solution that I can think of at the moment is to move the control from the Master Page to each sub page that uses it, but we have a lot of pages (60+) that use this control and we would ilke to keep it on the Master Page.
  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    04 Mar 2010
    Link to this post
    Hello Ray Tam,

    Each user control can be localized so that all labels and texts it uses appear in the languages you have it localized for. The links in Ivan's article explain how to localize the control, attached is also a small sample of a control localized for English and Spanish. Now I was talking about not creating two master pages as physical files, but two templates from the Sitefinity back-end. 

    Kind regards,
    Radoslav Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Register for webinar
6 posts, 0 answered