-
Notifications
You must be signed in to change notification settings - Fork 15
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
Translated paths #92
Translated paths #92
Conversation
Hi @claudioshiver, thanks a lot for this pr! I'll look at it as soon as possible. |
Hi Claudio, There were no requests for this feature in this repo, so what follows is just my opinion as a maintainer. First we should leave the old
The rewrite-based method seems to work well in basic cases:
Ok, now as a developer I have tried some configurations (operating on the
Let me know what you think. |
Hi Roberto, These two approaches can't work together, i'll explain in the following points. I reverted back the About the other points:
Let me know if it's all clear. What should i do with the base app example, i changed everything to work with the new approach. Do you prefer to rollback that part and just describe the new possible approach in Thank you. |
Currently, non-ASCII characters are not supported by @claudioshiver solution, therefore even a simple path like "città" in Italian doesn't work. Path encoding/decoding should be added. For example if I do this:
(just an example, encoding should be done internally) and I decode the return value of
it works. Ok, then I think the developer should also configure the web server to handle non-ASCII characters in URLs. But I'm not sure this is enough. We should look into it further. @ahnpnl , @mahmoudajawad any opinion on how to work with paths translated into non-Latin based languages? |
My opinion is that there is no reason to use non ascii characters in urls.. Even the italian "città" for example in the URLs is usually written as "citta" without any accent and as far as i know even japanese or chinese URLs doesn't usually use idiograms but latin letters with their phonetic language alternative. Anyway i think this is just an edge case, everything should work for other cases except for special characters in URLs and as you said it can be done at config time encoding the URLs if you want. |
ad73365
to
7510f19
Compare
Awesome! Thanks a lot! Well be released soon. |
Use the new Qwik City rewriteRoutes option to translate complete paths.
This PR add the
useTranslatePath
hook that can translate the application routes.Now you can translate
http://127.0.0.1:4173/page
tohttp://127.0.0.1:4173/it-IT/pagina
instead ofhttp://127.0.0.1:4173/it-IT/page
that will not be available anymore.