Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Frank Laumann 1 post 71 karma points
    Oct 03, 2017 @ 13:49
    Frank Laumann
    0

    Culture dependent UrlReplacing

    Hello,

    I'm working on a multi domain website, where easch domain is a different language, and I have used UrlRplacing for special characters from the language of the first domain. Now when I have to add UrlReplacing for the next doamin (with another language than the first doamin) I found that the same same character might need to be replaced differently depending on the language of the domain.

    Therefore my question is: Is it possible to make UrlReplacings depending on the culture the domains have ?

    Thanks in advance for any efforts :-)

  • John 1 post 71 karma points
    Apr 12, 2018 @ 10:12
    John
    0

    I am having the same issue, where the French version should replace 'Ü' with 'U', but the German version should replace 'Ü' with 'Ue'.

    The only way that I could see of doing this was to edit the Umbraco.Core logic in \Umbraco.Core\Strings\DefaultShortStringHelper.cs.

    My idea was to change the urlReplacing xml from

    <urlReplacing>
        <char org="Ü">Ue</char>
    </urlReplacing>
    

    With something along these lines

    <urlReplacing>
        <culture code="de-de">
            <char org="Ü">Ue</char>
        </culture>
        <culture code="fr-fr">
            <char org="Ü">U</char>
        </culture>
    </urlReplacing>
    

    NOTE: This only works on the umbraco instance that I am working on as the url begins with the culture of the page e.g. www.example.com/de-de/news/article/ and so the solution about would be able to use the replaceMany function that is currently used to check if the url passed in contains the corresponding culture code.

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Apr 12, 2018 @ 10:16
    Sebastiaan Janssen
    1

    Please please please please do not start running custom builds of Umbraco, it is not necessary and never advisable as you will never be able to upgrade and take advantage of security fixes, performance increases and new features.

    Make sure to look into IContentFinders for example - https://our.umbraco.org/documentation/reference/routing/request-pipeline/icontentfinder

  • Sjors Pals 617 posts 270 karma points
    Apr 12, 2018 @ 12:07
    Sjors Pals
    0

    You might consider to do this on IIS level with url rewriting, not ideal but at least you don't have to fix it in Umbraco.

Please Sign in or register to post replies

Write your reply to:

Draft