-
Notifications
You must be signed in to change notification settings - Fork 6
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 controller helpers to auto-generate Locale-prefixed routes #32
Comments
That would be great man, I'd just add that this could also work as well:
Internally, wherever it is available, the "current locale" would be mapped to the app's default one |
@fgrehm you mean that in your example, that'd be equivalent to I'm a fan of the latter, but I like the generated routes as well since it encourages good SEO. |
@sam yeah, probably the latter one, the point is that users should not have to type in the locale in order to get to a page, if we don't have that default and they hit |
Ya, I definitely think Request#locale is the way to go.
On Mar 3, 2012, at 2:04 PM, Fabio Rehmreply@reply.github.com wrote:
|
Got it. Well, let's make it so. These helpers seem like a good use of mixins, but I wouldn't want them confused with view helpers so |
Just to be clear about this one and make sure we don't forget, this should probably not register all prefixed routes for all locales, we can just make it make it a wildcard routes like |
So we'd have a special node in the tree, something like a On Sat, Mar 10, 2012 at 9:45 PM, Fabio Rehm <
|
hum.... I see your point, but wouldn't that make up huge tree if the app has a lot of locales?
Maybe having the routes pre-calc'ed is not a big issue from a router perspective (I was able to make it balanced ;-), but if end up providing something like Thoughts? |
Say you've got 500 "base" routes. Then assume each node takes around 1Kb (that seems really high, but that works for the example). That makes our tree 500Kb. So you enable localization for 20 Locales. That makes the tree 10Mb in size. It makes insertion a lot more expensive probably, but it shouldn't really impact match performance right? I'm not suggesting that would be ideal, but it seems like a good enough starting point. And we can optimize later in v1.x. |
I can't imagine that we're storing 1k per route, and I doubt insertion time -Scott On Sun, Mar 11, 2012 at 6:51 PM, Sam Smoot <
|
For example:
The text was updated successfully, but these errors were encountered: