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

Add basic support for localized routes #6068

Merged
merged 4 commits into from
Feb 3, 2025

Conversation

josevalim
Copy link
Member

@BartOtten and @kipcole9, I mention both of your projects, let me know if you are happy with the mention. If you have any feedback on this basic localization schema, please let me know too. Thank you!


Finally, for even more complex use cases, where the whole URL needs to localized,
see projects such as [Routex](https://github.com/BartOtten/routex) and
[CLDR.Routes](https://github.com/elixir-cldr/cldr_routes).
Copy link

@kipcole9 kipcole9 Feb 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @josevalim . I think ex_cldr_routes (as known on hex) would be more accurate in this case than CLDR.Routes.

Copy link

@greven greven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small typo.

of this approach is that you don't have to change the routes in your application and
verified routes works as is.

Some applications, however, like to the locale as part of the URL prefix:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing add in the sentence.

"Some applications, however, like to add the locale as part of the URL prefix:"

@@ -179,8 +179,8 @@ defmodule Phoenix.VerifiedRoutes do
end

Finally, for even more complex use cases, where the whole URL needs to localized,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really love the fact that the basic and most common use case is added to the core.

Too be fully honest: I rather see it named Routex with the capital R (and Cldr Routes for that matter). This keeps it consistent with other software and libs mentioned with their Natural Name in documentation instead of their snake case package_name.

Just a few examples:

Phoenix uses the Jason library to encode JSON

A project that integrates Phoenix with Ecto, implementing all relevant protocols.

You can now checkout a sandboxed connection and pass the connection information to an acceptance testing tool like Hound or Wallaby.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went ahead and linked directly to the packages and we will revisit how we want to approach these links later. :)

@BartOtten
Copy link

BartOtten commented Feb 3, 2025

nvm, couln't came up with a clean solution from UX perspective which would also be basic enough.

@josevalim josevalim merged commit 77ce927 into main Feb 3, 2025
10 checks passed
@josevalim
Copy link
Member Author

💚 💙 💜 💛 ❤️

@josevalim josevalim deleted the jv-path-prefixes-localized-routes branch February 3, 2025 13:03
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

Successfully merging this pull request may close these issues.

5 participants