Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Translated Route of a different language than the current one #108

Open
mmsergi opened this issue Jun 29, 2021 · 3 comments
Open

Get Translated Route of a different language than the current one #108

mmsergi opened this issue Jun 29, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@mmsergi
Copy link

mmsergi commented Jun 29, 2021

Hi! I want to set up some SEO tags for different langs like:

<link rel="alternate" hreflang="en" href="https://www.example.co/en/blog">
<link rel="alternate" hreflang="es" href="https://www.example.co/es/blog">

The unique method that seems to exist is "translateRoute" but only returns the current lang url.

My problem is I can't access at the same time to both href (url), is there a way to get it?

Thanks community.

@gilsdav gilsdav added the enhancement New feature or request label Nov 29, 2021
@gilsdav
Copy link
Owner

gilsdav commented Nov 29, 2021

This feature looks interesting.
Have you found a workaround?

@romankh
Copy link

romankh commented Dec 10, 2021

I am also looking for a way to achieve this.
What is needed from my perspective is a method that returns the current url in a language provided by param,
like this.localizeRouterService.translateCurrentUrl('en)

As far as I have seen, method changeLanguage does something similar, but also changes the language and navigates.

Would it be possible to implement

  • a method that provides the current, untranslated route
  • an additional, optional param "lang" to method translateRoute so we can translate a route into any language

in LocalizeRouterService ?

@motiejunas
Copy link

Is there any plans on implementing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants