I’m trying to localize my Rails apps for several countries.
I want to implement it like AirBnB. Locale based subdomains and www subdomain.
www.myapp.com
jp.myapp.com
kr.myapp.com
At first, users enter locale subdomain site or www subdomain site. If the user enter localized page or set their language in the www subdomain page, set cookie param [:locale].
AirBnB use Ruby on Rails for development, but how they manipulate many subdomains? They have multiple apps for each locale or just One app? Could I implement this on Heroku?
I checked this RailsCasts Episode http://railscasts.com/episodes/123-subdomains-revised?view=asciicast , but it uses passenger, so I doubt whether I can use this solution for Heroku.
It’s perfectly acheivable on Heroku – use a wildcard domain so your application is available on *.myapp.com and then set the language based on the subdomain. The ruby on rails guides have a section on it here. In summary, you would need to do something like (in your application_controller.rb);