-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
host_locales doesn't seem to be working #104
Comments
I think that the issue I'm having is the same issue as yours, because I don't get the exact locale in the root path, and it is probably the cause of the wrong urls:
I'm using a custom solution at the moment. Just skipped |
Can you share how you solved the locale detection from subdomain? I read the issues you posted but couldn't find any that worked for me. |
Something like this:
# Map domains to languages
DOMAIN_LANGUAGE = {
'it.lvh.me' => :it,
'en.lvh.me' => :en,
'de.lvh.me' => :de
}
skip_around_action :set_locale_from_url
around_action :set_site_locale
def set_site_locale(&block)
I18n.with_locale DOMAIN_LANGUAGE[request.host], &block
end |
I'm trying to use route_translator with subdomains (en|pt|es.ityou.dev). I can make it work with a subfolder (ityou.dev/pt/) but subdomain won't work. I have the following:
Any domain/subdomain I open always sets the locale to english
Am I missing something?
The text was updated successfully, but these errors were encountered: