-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Conversation
lib/phoenix/verified_routes.ex
Outdated
|
||
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). |
There was a problem hiding this comment.
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
.
There was a problem hiding this 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.
lib/phoenix/verified_routes.ex
Outdated
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: |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. :)
nvm, couln't came up with a clean solution from UX perspective which would also be basic enough. |
💚 💙 💜 💛 ❤️ |
@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!