More in this section

Forums / Developing with Sitefinity / Localization - External Pages

Localization - External Pages

19 posts, 0 answered
  1. George
    George  avatar
    204 posts
    Registered:
    05 Sep 2006
    13 Mar 2010
    Link to this post
    Hi there,

    I have one master page in my website and the application is localized in both english (en) and arabic (ar). I have couple of links on my master page that links to external pages such as a contact us form that i have created [I have set the navigateUrl without the path prefix as I consider that Sitefinity is managing the UrlRewrite]. I have added the contact us form to the sitefinity pages as external page and i have created an english and arabic version inside sitefinity so that it shows in the menu with a different title for english and arabic. So what is happening is:

    1- When i click on contact us link in any of the arabic pages within a /ar/page.aspx i'm redirected to the english version of the contact us page [/en/contactus.aspx] and when i try to check the IUCulture it has changed the en

    2- I tried to change the external link for the arabic contact us page and set it with the ~/ar/ prefix, it's automatically changing the external page link for the english version

    3- I also have an external page inside sitefinity that points to another page that's managed with sitefinity and i'm having the same issue.

    Please advice and i appreciate your help in advance.

    Best Regards,

    G
  2. George
    George  avatar
    204 posts
    Registered:
    05 Sep 2006
    13 Mar 2010
    Link to this post
    One more thing,

    I also have a Sitemap link on my master page and it redirected to a sitemap.aspx which is available in english and arabic. Also When i try to view the sitemap on the arabic site, i'm redirected to the english version of the site map because english is my default language.
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    14 Mar 2010
    Link to this post
    Hi G-force,

    You could use Thread.CurrentUICulture Property to get the current language and based on the value that is returned from your link manually. So when your culture is "ar" the link will be dynamically created as ~/ar/yourpage.aspx.

    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.
  4. George
    George  avatar
    204 posts
    Registered:
    05 Sep 2006
    15 Mar 2010
    Link to this post
    Hi Ivan,

    Thank you for your reply. My real problem with the UICulture is that it is changing to en automatically when i am in an arabic page and I go to an external page.

    One of the scenarios is, I have the home.aspx page as my homepage and I have an aboutus page that does nothing but simply redirects to the home.aspx page. I added the aboutus in sitefinity as external page and added the Url as ~/home.aspx. When i'm in the arabic version and i click on aboutus i'm automatically redirected to en/home.aspx. i tried to change the aboutus external page link and set it to /ar/ in sitefinity for the arabic version but it automatically changes the external link for the english version as well. Note that i'm using one localized master page for both english and arabic sites.

    Second question is, should I inherit my external pages such as SearchJobs from the Cms.Data.PageBase so the HttpHandler will set the correct UICulture?

    Please advice.

    Thanks,

    G
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    15 Mar 2010
    Link to this post
    Hello G-force,

    We do not redirect external pages to the default culture. The language should be added in the url of the menu you use. How have you populated your navigation control? Is there a live website where we could see the behavior you are describing?

    Regards,
    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.
  6. George
    George  avatar
    204 posts
    Registered:
    05 Sep 2006
    15 Mar 2010
    Link to this post
    Hi Ivan,

    site link here

    Scenario 1

    1- Open the link provided above
    2- Go to the About Us page, you will see that you are redirected to the home.aspx which is normal since i set the external link for aboutus to "~/home.aspx"
    3- Now click on the link before join us "عربي" to switch the language you will see that the language has been changed (I change the UICulture and redirect to /ar/home.aspx
    4- now click on the "من نحن" which is the localized arabic text for About Us you will notice that you are redirected to /en/Home.aspx

    I created the AboutUs as external page in sitefinity, created an arabic page and for both pages i set the external Url as "~/home.aspx". I tried to change the Url of the arabic AboutUs to ~/ar/Home.aspx but it automatically changed the Url in the relevant english page as well to ~/ar/Home.aspx

    Scenario 2:

    1- Go back to the english version
    2- under Careers you have "Search Jobs" Please click on it
    3- You are redirected to the english version of careers now try to change the language again by clicking on "عربي" then you are redirected to /Careers/SearchJobs.aspx without the path prefix [In debug mode i noticed that the Request.AppRelativeCurrentExecutionFilePath doesn't contain the path prefix

    Note that the SearchJobs.aspx is also created as external page under sitefinity

    Scenario 3:

    if you click on the logo in the ARABIC version you will notice that you are redirected to the english version of the website. I have set the Url as ~/Home.aspx noting that Home.aspx is a page that is managed under sitefinity.

    I hope i elaborated sufficiently on the subject so you are able to reproduce the problems.

    I sincerely appreciate your concern.

    Thanks,

    G
  7. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    15 Mar 2010
    Link to this post
    Hello G-force,

    When you have localization and external pages Sitefinity is trying to locate the external page in /ar/ExternalPage.aspx if you are in Arabic for example. If it does not locate it it will fall back to the default language version. So you can try the followng:

    1) Create two directories in the root of your website one en and one ar.
    2) In ~/en/ directory put the English versions of your external pages.
    3) in ~/ar/ directory put the Arabic versions of your external pages.

    This should fix the issue. We are going to release Sitefinity 3.7 SP3 where the problem you are experiencing will be fixed.

    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.
  8. George
    George  avatar
    204 posts
    Registered:
    05 Sep 2006
    15 Mar 2010
    Link to this post
    Thank you sir for your support.

    I'll be zealously waiting for the release of 3.7 SP3 because it's just a bad practice to duplicate pages inside these folders. I would rather have one page and use localized resources. Is there a set date for the release?

    As for now do you think that i could use the HttpContext.Current.RewritePath to tell the sitefinity HttpModule that the page exists but it's in a different folder ?

    Best Regards,

  9. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    15 Mar 2010
    Link to this post
    Hello G-force,

    The Sitefinity 3.7 SP3 is available for download now. Please download an upgrade patch relevant to your project (depending on the .NET framework you are running) and check the Upgrade Instructions.

    Best wishes,
    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.
  10. Miled Elias
    Miled Elias avatar
    2 posts
    Registered:
    20 Jun 2012
    15 Mar 2010
    Link to this post
    Thank you, downloading SP3 !
  11. George
    George  avatar
    204 posts
    Registered:
    05 Sep 2006
    15 Mar 2010
    Link to this post
    Thank you Radoslav i will upgrade the project now and test the issues again and I will let you know.

    Best Regards,

    George
  12. George
    George  avatar
    204 posts
    Registered:
    05 Sep 2006
    15 Mar 2010
    Link to this post
    Hi Radoslav,

    I have upgraded to sitefinity 3.7 sp3 ...

    I'm still encountering the same issues ... Do i still have to create two folders and add arabic and english versions for the pages or can i now use one localized external page? Do I need to inherit my page from a class or interface ... Please tell me what changed in this release and how do i proceed?

    Thanks in advance

    George
  13. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    15 Mar 2010
    Link to this post
    Hello G-force,

    Unfortunately you will still have to create the /en and /ar directories in your website root. Here is what you can do. Create those two directories. In each of those directory add an App_LocalResources directory. There you will add the localization resources for your page. Then copy the localized page in both directories. I know it is a bit clunky but it will work.

    All the best,
    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.
  14. George
    George  avatar
    204 posts
    Registered:
    05 Sep 2006
    08 Apr 2010
    Link to this post
    Hi Radoslav,

    Thank you for your last post. I found that working with external pages is very tedious. 

    I have in my menu which is populated with a sitemap provider a link to Careers page. I have 2 languages English and Arabic. Careers links to Search Jobs page which is available in both en and ar folders as you have proposed earlier. When i'm in the arabic version of the website and i click on Careers i'm redirected to the english Search Jobs page although it is available in the ar folder.

    Note that i'm using the Path Prefix mode for localization.

    Please advice.

    Best regards,

    G
  15. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    09 Apr 2010
    Link to this post
    Hi G-force,

    Thank you for getting back to me.

    In your control, could you please subscribe to the data bound event of the menu. For example if you are using SiteMenu in ~/Sitefinity/UserControls/Navigation35/SiteMenu.ascx.cs edit the bellow method:
    public void RadMenu1_ItemDataBound(object sender, RadMenuEventArgs e)
    {
        CmsSiteMapNode node = e.Item.DataItem as CmsSiteMapNode;
        if (this.hideUrlForGroupPages)
        {
            if (node != null)
            {
                // save the PageID in the attributes of the menu item
                e.Item.Attributes.Add("PageID", node.Key);
     
                if (node.PageType == CmsPageType.Group)
                {
                    e.Item.NavigateUrl = "";
                }
            }
        }
        if (node.PageType == CmsPageType.External && e.Item.NavigateUrl.StartsWith("~/"))
        {
            e.Item.NavigateUrl = UrlHelper.ResolveUrl(e.Item.NavigateUrl);
        }
    }


    All the best,
    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.
  16. George
    George  avatar
    204 posts
    Registered:
    05 Sep 2006
    09 Apr 2010
    Link to this post
    Thank you Radoslav I sincerely appreciate it !

    It solved the problem. I have written a Url Helper method myself so I just have a little clarification about the UrlHelper.ResolveUrl. 

    Can you tell me more about what this function does to see if i can replace the method that I created to resolve the Url and add the appropriate path prefix.

    Best Regards,

    G
  17. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    09 Apr 2010
    Link to this post
    Hi G-force,

    The UrlHelper constructs a new url and returns a new url based on the urls string that you pass and Culture infor of the current page context  - (CultureInfo)HttpContext.Current.Items[UrlHelper.CultureKey]

    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.
  18. George
    George  avatar
    204 posts
    Registered:
    05 Sep 2006
    12 Apr 2010
    Link to this post
    Hi Ivan,

    The UrlHelper class is very useful for Url manipulation in Sitefinity and I started using it all over my application. However, I noticed there is a ResolveLanguageUrl function. In case I turned on Localization in my website, is it better to use ResolveUrl or ResolveLanguageUrl(url) and what's the difference between the two. 

    Best Regards,

    George
  19. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    12 Apr 2010
    Link to this post
    Hello G-force,

    UrlHelper.ResolveUrl returns ResolveLanguageUrl( string val) .

    Best wishes,
    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
19 posts, 0 answered