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

Forums / Developing with Sitefinity / Registering a Second Language Resource in Custom Module Initialization

Registering a Second Language Resource in Custom Module Initialization

7 posts, 1 answered
  1. Ronnie
    Ronnie avatar
    31 posts
    Registered:
    20 Jul 2011
    27 Jan 2012
    Link to this post
    [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.
  2. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    01 Feb 2012
    Link to this post
    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
  3. Ronnie
    Ronnie avatar
    31 posts
    Registered:
    20 Jul 2011
    01 Feb 2012
    Link to this post

     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.

  4. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    02 Feb 2012
    Link to this post
    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
  5. Ronnie
    Ronnie avatar
    31 posts
    Registered:
    20 Jul 2011
    03 Feb 2012
    Link to this post

    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.


  6. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    07 Feb 2012
    Link to this post
    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
    Answered
  7. Ronnie
    Ronnie avatar
    31 posts
    Registered:
    20 Jul 2011
    07 Feb 2012
    Link to this post

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