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

Forums / Developing with Sitefinity / Localizing a custom control under SiteFinity

Localizing a custom control under SiteFinity

6 posts, 0 answered
  1. Peter
    Peter avatar
    10 posts
    Registered:
    24 Aug 2008
    14 Apr 2009
    Link to this post
    Hey guys,

    I'm currently working on a contact form for my company's web site. And I'm kinda stuck with localizing the custom control.

    I've created resx files for both danish and english. I've checked that the Thread.CurrentThread.CurrentUICulture actually shows "da" as selected culture when my custom control is being rendered, but my custom control still only renders "en" language.

    What else should I check?

    Kind regards,

    Peter
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    15 Apr 2009
    Link to this post
    Hello Peter,

    We are inheriting this functionality from the Asp.Net framework. Could you please show us the exact file/directory structure you have?

    Regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Peter
    Peter avatar
    10 posts
    Registered:
    24 Aug 2008
    16 Apr 2009
    Link to this post
    Hi the directory structure looks like this:

    .\UserControls\ContactUsForm\ContactUs.ascx
    .\UserControls\ContactUsForm\ContactUs.ascx.cs
    .\UserControls\ContactUsForm\App_LocalResources\ContactUs.ascx.resx
    .\UserControls\ContactUsForm\App_LocalResources\ContactUs.da.ascx.resx
    .\UserControls\ContactUsForm\App_LocalResources\ContactUs.da-DK.ascx.resx

    I tried to put the dansih translations in the resx files with both "da-DK" and just "da" but none seem to work..

    Kind regards,

    Peter
    CodeLean Inc.

  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    20 Apr 2009
    Link to this post
    Hello Peter,

    Everything looks correct. Could you please check if the:
    • CurrentThread.CurrentCulture
    • CurrentThread.CurrentUICulture
    are different than the default ones, when you change the language?
    Regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Peter
    Peter avatar
    10 posts
    Registered:
    24 Aug 2008
    22 Apr 2009
    Link to this post
    Hi Georgi,

    When I browse directly on www.codelean.com with an English language browser the two objects are set to:
    CurrentCulture = en-US
    CurrentUICulture = en

    When I then browse www.codelean.com/da I get the following result from the two objects:
    CurrentCulture = en-US
    CurrentUICulture = da

    Is that what you expected?

    Kind regards,

    Peter
  6. Vlad
    Vlad avatar
    498 posts
    Registered:
    19 Jun 2017
    27 Apr 2009
    Link to this post
    Hi Peter,

    Sorry for overlooking that before.
    Everything looks fine, except the names of the resource files:

    Correct:
    .\UserControls\ContactUsForm\App_LocalResources\ContactUs.ascx.da.resx
    .\UserControls\ContactUsForm\App_LocalResources\ContactUs.ascx.
    da-DK.resx

    Not Correct:
    .\UserControls\ContactUsForm\App_LocalResources\ContactUs.da.ascx.resx
    .\UserControls\ContactUsForm\App_LocalResources\ContactUs.da-DK.ascx.resx



    Regards,
    Vlad
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
6 posts, 0 answered