Registering a Second Language Resource in Custom Module Initialization
[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.
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
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.
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
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
So, yes using the Administration -> Interface Labels & Messages -> Import Language Package is the best practice...
Thanks,