Ruby on Rails routes translation using route_translator gem -
i'm using route_translator gem , when run rake routes
seems working fine. part of output:
travels_en /en/travels(.:format) travels#index {:locale=>"en"} travels_pt_br /viagens(.:format) travels#index {:locale=>"pt-br"}
i can access pt-br routes application links take me english route, i'm using rails methods. have change route methods new_travel_path
, link_to
specific?
one thing need make sure pt_br yml file has foreign routes want appear. example in pt_br yml file have following code match example:
routes: travels: viagens
when click en should see /en/travels
before. when click pt_br should see /pt_br/viagens
.
another thing check make sure in config/routes.rb
have routes being translated within following statement.
localized whatever routes should appear here end
this have done 1 of sites in english , french.
Comments
Post a Comment