More in this section

Forums / Developing with Sitefinity / languages : javascript navigate and preserve language

languages : javascript navigate and preserve language

2 posts, 0 answered
  1. Pierre
    Pierre avatar
    433 posts
    16 Feb 2006
    13 May 2010
    Link to this post
    Hi Team,

    I have some troubles in navigation multilanguage using javascripting inside rad items. After selecting backside(admin) my language selector and add some lang. like .aspx?sflang=zh-CN i need to navigate to others clientside pages but i lost the selected language and my language selector is returning to defaut language. Could suggest me please one method to pass the selected language to client side and preserve.

    function onClicking(sender, eventArgs) {
            var item = eventArgs.get_item();
            //LogEvent("Clicking: " +item.get_text());
            var navigateUrl = item.get_navigateUrl();
            if (navigateUrl && navigateUrl != "#") {
                var line = item.get_value();//
                if (!line) {
                else {
                    if(line != '99'){
                            navigateUrl = $Url.resolve(navigateUrl);
                            window.location.href =$Url.resolve(navigateUrl);

    Thanks. Romi.
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    01 Feb 2016
    14 May 2010
    Link to this post
    Hello Pierre,

    The first option is to resolve links for the currently selected language using server side code: Telerik.Cms.Web.UrlHelper.ResolveUrl(YourUrl). The other options is to check the url of your current page. Then add the same localization info to the one you are navigating to.

    Kind regards,
    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.
2 posts, 0 answered