What I would like to do is:
in config / routes.rb
resources :posts
in config / locale / en.yml
en:
resources:
posts: "posts"
new: "new"
edit: "edit"
in config / locale / tr.yml
tr:
resources:
posts: "yazilar"
new: "yeni"
edit: "duzenle"
and get
I18n.locale = :en
edit_post_path(3)
I18n.locale = :tr
edit_post_path(3)
I would also like Rails to match any of these routes at any time and pass the associated locale in the params hash, so when I go to /yazilar, the request should be redirected to the action posts#indexusing :trlocale in the params hash.
Any simple or complicated way to do this?
source
share