ngx-translate-router
ngx-translate-router copied to clipboard
Get Translated Route of a different language than the current one
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.
This feature looks interesting. Have you found a workaround?
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 ?
Is there any plans on implementing this?