I am using subdomains to determine the locale in a Rails 4 website. I have this working with a locale switcher exactly the way I want it but now I need to translate the routes a
From my experience, the domain should not be the only thing that determines the locale. It's so much easier if you just put the current locale into a cookie, so that the User can choose in the end!
Now to the translation-part of your question. I think you should change the way you are using the routing.
If you see the countries as resources, and the actions as a different part, you will make your life easier. The model to_param
method can help you with that:
resource :country do
get :weather, on: :member
...
end
That will result in urls like south-america/weather
but from my perspective, that is even better in terms of readability and search engine optimization. google used to like paths a lot.
For the different translations of your paths, you could iterate over your domains and provide a translation for each segment: http://guides.rubyonrails.org/routing.html#translated-paths