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

getRelativeLocaleUrl dont work with internal "#" link #10951

Closed
1 task
TheElegantCoding opened this issue May 4, 2024 · 1 comment
Closed
1 task

getRelativeLocaleUrl dont work with internal "#" link #10951

TheElegantCoding opened this issue May 4, 2024 · 1 comment
Labels
needs triage Issue needs to be triaged

Comments

@TheElegantCoding
Copy link

Astro Info

Astro                    v4.7.1
Node                     v20.10.0
System                   Windows (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @astrojs/sitemap
                         @astrojs/partytown

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

with trailingSlash: 'never', getRelativeLocaleUrl, redirect to another page instead of keep the actual page, also if is a redirect to another and make scroll, go to 404

to reproduce in stacktrace go to /es and then click the link app

What's the expected result?

redirect to "/es#about"

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-ppkgse?file=src%2Fpages%2Findex.astro,src%2Futil%2Flocale.ts,src%2Fpages%2Fen%2Findex.astro,src%2Fpages%2Fes%2Findex.astro,astro.config.mjs

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label May 4, 2024
@matthewp
Copy link
Contributor

getRelativeLocaleUrl takes a pathname, not arbitrary parts of a URL. You can achieve what you want with this:

{getRelativeLocaleUrl(language)+'#app'}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants