Basti
i18n - Switching locales fails if an anchor has been clicked beforehand.
If there is an anchor which jumps to a certain section of the page, the anchor can not have different names (can't be translated). For instance if I click the following link:
I will get a url like this
But if I were to translate the id of the anchor element, there is no anchor with that name on the other locale, so it can't switch.
If I now click the above link and then translate the page from, say, english to spanish, Nuxt will attempt to go from
to
but the anchor in the spanish version would be called #contacto with an 'o' at the end, so it doesn't find the page. Is there a workaround for this? I tried some string manipulation to delete everything in the url after the # but that doesn't work with switchLocalePath()
9 replies