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

Forums / Developing with Sitefinity / Multi lingual navigation

Multi lingual navigation

7 posts, 0 answered
  1. Siddesh Kapadi
    Siddesh Kapadi avatar
    239 posts
    Registered:
    09 Oct 2009
    16 Jul 2010
    Link to this post
    Hello Team Telerik,

    I am trying to create the custom navigation menu. I need to pull the pages as per the language selected by the user. Currently, if I select all pages, all the pages are fetched irrespective of the language.

    Please let me know how this can be acheived.

    Regards,
    Siddesh Kapadi
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    16 Jul 2010
    Link to this post
    Hi Siddesh Kapadi,

    Here is a forum post that shows how to get pages from different cultures.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Siddesh Kapadi
    Siddesh Kapadi avatar
    239 posts
    Registered:
    09 Oct 2009
    19 Jul 2010
    Link to this post
    Hello Team Telerik,

    there are three things that I can use:
    InvariantCulture,
    CurrentCulture,
    CurrentUICulture.

    For example, 
    for language (en): The code that is saved is 127.
    for language english: 
    InvariantCulture = 127
    CurrentCulture = 1033
    CurrentUICulture = 9

    I need to use this in my query specified as under:

    Mgr.GetPages().Cast<ICmsPage>().Where(x => x.LangID == CultureInfo.CurrentUICulture.LCID).OrderBy(x => x.Ordinal).OrderBy(x => x.ParentID).ToList<ICmsPage>();

    if I use InvariantCulture, irrespective of the language it will return me 127.
    if I use CurrentUICulture, it returns me with the correct code, but not for the language English.

    So, the above query seems to be different for english language and other languages. I cannot seperate these as per the locale.

    Please let me know how can I acheive this


    Regards,
    Siddesh kapadi
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    22 Jul 2010
    Link to this post
    Hi Siddesh Kapadi,

    Thank you for getting back to us.

    Can you please try using InvariantCulture if your CurrentUICulture is equal to the default language, and the language ID code for the CurrentUICulture if it is not the default language.

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Siddesh Kapadi
    Siddesh Kapadi avatar
    239 posts
    Registered:
    09 Oct 2009
    22 Jul 2010
    Link to this post
    Hello Radoslav,
    Can you please let me know how can I get the default language in sitefinity and also the current language selected language.
  6. Siddesh Kapadi
    Siddesh Kapadi avatar
    239 posts
    Registered:
    09 Oct 2009
    22 Jul 2010
    Link to this post
    Hey,
    I think I got this.

    To get the defaultCulture in sitefinity:

    LocalizationManager.DefaultCulture

    Regards,
    Siddesh kapadi
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    22 Jul 2010
    Link to this post
    Hello Siddesh Kapadi,

    For the current culture you can use CurrentUICulture

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
7 posts, 0 answered