Localization in user controls

Posted by Community Admin on 03-Aug-2018 14:13

Localization in user controls

All Replies

Posted by Community Admin on 02-Feb-2011 00:00

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

Posted by Community Admin on 03-Feb-2011 00:00

Hello,

Can someone bring me an answer?

Jocelyn

Posted by Community Admin on 03-Feb-2011 00:00

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

Posted by Community Admin on 03-Feb-2011 00:00

Hello Ivan,

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

Jocelyn

Posted by Community Admin on 03-Feb-2011 00:00

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

Posted by Community Admin on 02-Mar-2011 00:00

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

Posted by Community Admin on 08-Mar-2011 00:00

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

Posted by Community Admin on 09-Mar-2011 00:00

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,

Posted by Community Admin on 16-Mar-2011 00:00

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

This thread is closed