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

paraglide-next: pass request object to getCanonicalPath and getLocalisedUrl in RoutingStrategy #339

Open
artemszelenov opened this issue Jan 24, 2025 · 2 comments

Comments

@artemszelenov
Copy link

In my use case I have this domain-lang logic:
example.com: ['en', 'es']
example.mx: ['es']

and I have the following requirements:
for domains with 1 lang, do not show the lang in url, but for domains with 2 langs and more - show lang in url so it should be
example.com/es/user
example.mx/user

The problem

When I resolve locale as 'es' currently I am not able to build localised url properly because I don't know the current domain because the final url will depend on it. So I need to know the current domain from these functions getCanonicalPath and getLocalisedUrl

Any other proposals?

Copy link
Member

Love your feedback, thanks!

I will focus next week on implementing a generalizable strategy across Paraglide JS 2.0 and all it's adapters, including NextJS. While I might not implement your desired strategy right away, I will keep your requirement in mind when I design the strategy API.

Will reply again next week

@artemszelenov
Copy link
Author

@samuelstroschein thank you so much

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

No branches or pull requests

2 participants