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

added 'url_segments' namespace in yaml input translations file #8

Closed
wants to merge 1 commit into from

Conversation

cawel
Copy link

@cawel cawel commented Jan 24, 2012

Old way:

es:
  products: productos
  contact: contacto

New way (now wrapped into a namespace):

es:
  url_segments:
    products: productos
    contact: contacto

I had to introduce a namespace because I had a I18n translation in my app which collided with one of my url segment translations.

On another topic, I'm willing to write a few tests, but right now I have errors when I try to run ruby test/test_rails-translate-routes.rb :(

@francesc
Copy link
Owner

Hey, seems ok to me. Thanks! I'll try to add and documentate it this week.

I'll be quite busy making it work with rails 3.2, I just started but still have to see how the new engine works. After I have a new version for it next step will be to add some testing. ;)

@cawel
Copy link
Author

cawel commented Jan 27, 2012

I'm curious, when do you think you'll have a Rails 3.2 compatible version?

@francesc
Copy link
Owner

Hey Martin,

I spend some hours this week trying to make it work and pulling my hair out XD I got how to retrieve the regular, named & engine routes from Journey but still have to figure out how to remove routes and add them.

@corneverbruggen
Copy link

Just ran into the same collision problem as @cawel, so found this issue. Is this going to be merged soon?

@cawel
Copy link
Author

cawel commented May 4, 2012

francesc: I have recently upgraded a personal project from Rails < 3.2 to Rails 3.2.3 and I found no problem with that commit (which I put on top of your latest master branch) which allows us to introduce a namespace into our url segment translations.

Any plans to integrate it into the main repo?

@morgoth
Copy link

morgoth commented May 15, 2012

Same problem.

My workaround:
Put routes translations in: config/routes.yml
and in router.rb:

ActionDispatch::Routing::Translator.translate_from_file("config/routes.yml")

@francesc
Copy link
Owner

Hey. Sorry for the delay, I'll release a new version today to fix this and other small improvements. It will use a :routes namespace on the yaml.

en:
routes:

you can leave empty locales, for example the default one, don't forget the routes namespace

es:
routes:
products: productos
contact: contacto

@francesc francesc closed this Jun 20, 2012
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.

None yet

4 participants