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

Forums / Developing with Sitefinity / Problem with default Culture

Problem with default Culture

2 posts, 0 answered
  1. tanmay
    tanmay avatar
    18 posts
    Registered:
    14 Aug 2007
    12 Oct 2009
    Link to this post
    Hello ,

    We are using Sitefinity 3.7, and our site support 2 languages 1)Arabic and 2)English. Where Arabic is Default Language.

    I have changed in web.config for default language  issue. it is now
        <localization defaultProvider="Sitefinity" persistenceMode="PathPrefix" defaultCulture="ar" cultures="ar,en" autoSetClientLanguage="false">

    I am still getting a problem, in this site we use Culture as Url Prefix [persistenceMode="PathPrefix"], but when i put
    autoSetClientLanguage="false" , it is not displaying "\ar\" in URL. But that is needed for us, as our menu and Language change User control read URL and set Navigation link.

    Please review the site
    http://www.beeah-uae.com.temphostspace.com/home

    just check language link and Menu you will get details.

    Can you please help me on this issue, or is there any other way to set "Arabic" as Default Culture?

    Thanks and Regards
    Tanmay
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    16 Oct 2009
    Link to this post
    Hello tanmay,

    By default when autoSetClientLanguage="false" the language prefix is not displayed in the url and in the RadMenu control. There are two options

    1. Use the default implementation and you will not have a problem with the menu - when the default culture is loaded the menu will be bound to it.

    2. In your logic for setting the NavigationLink, get the current culture and add it to the url in RadMenu ItemDataBound.

    sample code:

    CultureInfo currentCulture = CultureInfo.CurrentUICulture;
            CmsSiteMapNode smNode = e.Item.DataItem as CmsSiteMapNode;
     
            if (LocalizationManager.DefaultCulture.Equals(currentCulture) && smNode.PageType != CmsPageType.External)
            {
                e.Item.NavigateUrl = "~/" + currentCulture + e.Item.NavigateUrl.Substring(1);
      
            }

    The code above will append the default culture as a url prefix and your links will not be broken.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered