Closed cawel closed 12 years ago
Hi Martin,
Just had a quick look over it, what's the purpose? I mean, currently you can already have dashes in a translated url, for example:
model: PressRelease controllers: press_releases in routes.rb: resources :press_releases and in routes.yml: press_releases: "press-releases" in english or press_releases: "notas-de-prensa" in spanish
Is that what you tried to achieve? Correct me if I missunderstood it.
The issue I was trying to fix is when you have dashes in the url's with the default locale. For example, if you have a hardcoded route like this one in your "routes.rb":
get 'who-we-are', :to => 'staticPages#who_we_are'
Then your translatable_segment matcher will fail to recognize "who-we-are" as a valid url segment. Specifically, it will wrongly pick "who" as a segment (and not "who-we-are"). As a result, the route "who-we-are" will not be translated.
Let me know your thoughts.
Ok, I see, I'll make some tests of your branch and merge it to the repo as it doesn't break anything and adds some more flexibility for cases like the one you mention. I don't see any reason to not include it. I'll do it probably tomorrow evening. Thanks!
Glad I could help. Thanks!
Already merged your patches, all but the gem version one, I'll make some more commits and update it myself later in a new release ;)
Just released a new version. Doc is also updated and your're listed as contributor. Thanks!
Let me know what you think of my changes.
Martin