jcasimir / locale_setter

A simple library to set request locale based on a hierarchy of factors
MIT License
118 stars 18 forks source link

Support Subdomains #5

Open jcasimir opened 11 years ago

jcasimir commented 11 years ago

It'd be nice if there we an easy way to set locale based on subdomain (or even primary domain). I could see this making it even more useful when sites want to use a different domain for mobile.

myabc commented 11 years ago

Is this not already supported? (i.e. Locale-per-domain)

adrianpacala commented 11 years ago

It's not. The current implementation only supports TLDs (based on request.domain). For example: { 'myapp.pl' => :pl, 'myapp.de' => :de }.

adrianpacala commented 11 years ago

Update: it does work, you just need to tell rails that the locale is a part of TLD: config.action_dispatch.tld_length = 2.