I use subdomains to determine the locale on the Rails 4 website. I have work with the language switch exactly the way I want, but now I need to translate the routes and I'm not sure what is the best way to proceed.
I looked at https://github.com/kwi/i18n_routing i18n routing gem, but this does not work with subdomains, it seems to change the path by adding / locale, which is not what I need.
Other gems seem obsolete with Rails 4.
Edit
Basically, I want to be able to use the same view helpers, but change the URLs to use any language that is reflected by the selected subdomain. this is just a translation of the route.
I have language-specific templates that work, and I can create navigation templates for specific languages, but I really would like not to worry about changing the erb and url erb labels.
End editing
Sample of routes. rb
scope module: 'countries', shallow: true do get 'south_american', to: 'south_america#index', as: :south_america scope module: 'south_america' do get 'south-america-weather', to: 'weather#index', as: :south_america_weather get 'south-america-gps-maps', to: 'gps#index', as: :south_america_gps get 'south-america-accommodation', to: 'hotels#index', as: :south_america_hotels get 'south-america-vacations', to: 'vacations#index', as: :south_america_vacations get 'south-america-facts', to: 'facts#index', as: :south_america_facts end
Using south_america_hotels_path as an example will result in a URL for
south america accommodation
which is great, but how to translate it so that when I am in the Spanish subdomain, south_america_hotels_path will create the following URL
Hoteles en sudamerica
UPDATE
Just as this will work for the url, not just the path, so south_america_hotels_url will generate
en.some_site / south america location
and when on the Spanish subdomain I get
es.some_site / Hoteles-en-Sudamerica
etc. for different involved locales.
I am happy to use yml files for translations for URLs or for defining additional routes in the routes.rb file, or an option, but I would prefer to define a URL in route.rb, but I cannot find a way to provide language specific URLs addresses for the same: as a path / url parameter based on a subdomain.
Update and further clarification in response to previous answers.
Changing URLs is not an option; they must match existing URLs. I just need to know how to translate them from the perspective of a view helper without changing view helpers.