Git Product home page Git Product logo

Comments (5)

JanLenoch avatar JanLenoch commented on May 27, 2024 1

Sure! What @Steve-Fenton says is correct, however, there is another, slightly more elegant solution: to utilize the CultureInfo.CurrentUICulture.Name value in the CustomContentLinkUrlResolver.

The culture is being set in the LocalizedMvcRouteHandler and is then used by the ControllerBase class. It can be therefore used in the same way in the link resolver.

The most-elegant solution is to enrich the ContentLink class in the SDK with a notion of the culture.

Fixed via #62 and filed an issue in the SDK repo.

from sample-app-net.

Steve-Fenton avatar Steve-Fenton commented on May 27, 2024

Should this be fixed in the content, or by adding additional routes?

It could be solved by adding routes to catch all situations where there is no language in the URL - one would be needed for each localized route. Otherwise, the link in the content (which is an en-US page) could be updated to point at the en-US route: /en-us/articles/on-roasts

        routes.MapRoute(
            name: "ArticleNoLang",
            url: "articles/{urlSlug}",
            defaults: new { language = LanguageClient.DEFAULT_LANGUAGE, controller = "Articles", action = "Show", urlSlug = "" }
        );

from sample-app-net.

petrsvihlik avatar petrsvihlik commented on May 27, 2024

@JanLenoch could you please comment on that?

from sample-app-net.

MartinaFarkasova avatar MartinaFarkasova commented on May 27, 2024

Hi guys, I found other broken links in the "Coffee processing techniques" article that lead to "Page not found". Both of them are leading to coffee products: Kenya Gakuyuni AA and Brazil Natural Barra Grande.
I guess the problem might be in the CustomContentLinkUrlResolver.cs since it links products via $"/products/{link.UrlSlug}"; Also, the lang codename doesn't match.

Currently used link: /en-US/products/kenya-gakuyuni-aa
Correct link: /en-us/product/detail/kenya-gakuyuni-aa

See it here: https://dancing-goat-mvc-develop.azurewebsites.net/en-US/products/kenya-gakuyuni-aa

from sample-app-net.

JanLenoch avatar JanLenoch commented on May 27, 2024

Well spotted, @MartinaFarkasova ! Pushed 47ec62a to finish the fix.

from sample-app-net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.