1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Localization in user controls

Localization in user controls

9 posts, 0 answered
  1. jocelyn payneau
    jocelyn payneau avatar
    51 posts
    Registered:
    07 Dec 2009
    02 Feb 2011
    Link to this post
    Hello,

    My website is multilingual. To display my specific content, I used user controls. In these user controls, I have some labels that need to be translated. How can I achieve this? Can I use asp.net resources file or does Sitefinity provide a way to do this?

    Thanks

    Jocelyn
  2. jocelyn payneau
    jocelyn payneau avatar
    51 posts
    Registered:
    07 Dec 2009
    03 Feb 2011
    Link to this post
    Hello,

    Can someone bring me an answer?

    Jocelyn
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    03 Feb 2011
    Link to this post
    Hello jocelyn,

    You can use ASP.NET Local resources. You can create a custom resource class. You can take a look at this post.For properties,if you want to have them in multilingual mode you have to mark the property with  MultilingualProperty attribute (Telerik.Sitefinity.Modules.Pages.PropertyPersisters.MultilingualPropertyAttribute).
    Note that this should be a string property.

    You can use Administration >> Interfaces and Labels to add a new key which you can access in your control as shown below


     var res = Res.Get("Labels", "MyKey");

    We recommend creating a separate classes for your custom keys and not mix them with the default one. Thus, you can separate the built-in and custom logic easily and this will ensure that there would not be a problem if you import or export a language pack.






    All the best,
    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
  4. Julien
    Julien avatar
    5 posts
    Registered:
    08 Dec 2010
    03 Feb 2011
    Link to this post
    Hello Ivan,

    Thanks for your reply. Where can I create my custom resources class and register it in sitefinity?

    Jocelyn
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    03 Feb 2011
    Link to this post
    Hi Julien,

    You can take a look at this post that explains how to do this.

    Greetings,
    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
  6. jocelyn payneau
    jocelyn payneau avatar
    51 posts
    Registered:
    07 Dec 2009
    02 Mar 2011
    Link to this post
    Hello,

    I create my resources class and register it.

    When i go to "Administration" > "Interface and labels", I see my Resources class but when I click it to filter the labels, I still see all labels. My resources class name in "Filter by type" side bar appears in grey.

    Thanks for your help!

    Jocelyn
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    08 Mar 2011
    Link to this post
    Hi Julien,

    This is a bug related to the custom localization resources. It has been logged with ID 390410 and it is related to bug 100991 added in the initial post. The current status of bug 100991 is not done.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
  8. Julien
    Julien avatar
    5 posts
    Registered:
    08 Dec 2010
    09 Mar 2011
    Link to this post
    Hello Ivan,

    When this bug will be treated? However, I think this bug does not block us to use the back end to translate my labels of my custom resources class. Is is true?

    Regards,
  9. Kalina
    Kalina avatar
    176 posts
    Registered:
    27 Oct 2016
    16 Mar 2011
    Link to this post
    Hi Julien,

    This bug is scheduled for fixing for the Q1 release in the begining of April.
    It doesn't block you to use the back end to translate your labels of your custom resources class.


    All the best,
    Kalina
    the Telerik team
9 posts, 0 answered