Registering a Second Language Resource in Custom Module Init

Posted by Community Admin on 04-Aug-2018 19:14

Registering a Second Language Resource in Custom Module Initialization

All Replies

Posted by Community Admin on 27-Jan-2012 00:00

[UPDATE]

Hello,

I can't find a proper way (or sample) to add a second language resource following API calls
Res.RegisterResource<MyModuleResources>();

Need to create a second resource class with a language attribute somewhere?
Need to change CurrentThread Culture before registering  the resource ?

Using Sample Code in this link:

http://www.sitefinity.com/documentation/documentationarticles/developers-guide/how-to/how-to-create-a-jobs-module/localization

Installs the Default Resource entries but what If in my Module installation process I want to install a second language set ?

Thanks for any help.

Posted by Community Admin on 01-Feb-2012 00:00

Hi Ronny,

I see that my colleague Svetoslav has answered to your support request, but lets share the information with the community: basically when you have registered the resources for your module and you add another language to the website, the system creates separate values for the new language and exposes a textbox in the backend where you can edit it ( Administration >> Interface Labels & Messages ).

Kind regards,
Victor Velev
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested 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 01-Feb-2012 00:00

 Yes Thanks, I understand that,
But your solution is manually enter N translations using the backend.


This is our scenario: Let’s say we develop a module for the market and we support N languages for our frontend.... In our standard .Net solution we include those resources...as part of our final installation package. (we don’t ask the final user to do that)..

In Sitefinity we want at least the same functionality..   We are trying to install N resources in custom module installation routines.

I can’t find a way to register different languages and translations using the API…

Thanks.

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

Hello Ronny,

Thank you for providing the details about your request. However in Sitefinity you cannot know what or how many languages will the client's site have ( assuming your case - you are creating a module for the market ) - they may have only one default language or quite few ( and different as well ). So such task is quite complicated and in the same time hardly achievable.

You can also agree that the module will include unnecessary code, for all the extra languages that you wish to include. Also when the user installs your module, he will be automatically provided with the option to localize the resources if a new language is being added ( the language variations may be quite a lot as well ).

Greetings,
Victor Velev
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested 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-2012 00:00

Ok make sense, not installing unnecessary languages in the module installation.
Good point and thanks for the clarification.

But I still need to provide the extra translations to our final users..
How can do that..?
I see there is an option to import a language packs in Administration -> Interface Labels & Messages. Is this the best practice?
 
Thanks for your feedback.

Posted by Community Admin on 07-Feb-2012 00:00

Hello Ronny,

When you set up Sitefinity and install other frontend languages as well, you can access the labels ( or import a language pack ) from the Administration -> Interface Labels & Messages section of the site. Please check the attached image. This is probably the best way to create your module and keep the codebase clean.

Kind regards,
Victor Velev
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested 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 07-Feb-2012 00:00


So, yes using the Administration -> Interface Labels & Messages -> Import Language Package is the best practice...
Thanks,

This thread is closed