We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d8d5554 commit 62eb8b3Copy full SHA for 62eb8b3
guides/source/i18n.md
@@ -196,8 +196,11 @@ We can also set the locale from the _subdomain_ in a very similar way:
196
```ruby
197
# Get locale code from request subdomain (like http://it.application.local:3000)
198
# You have to put something like:
199
-# 127.0.0.1 gr.application.local
+# 127.0.0.1 it.application.local
200
# in your /etc/hosts file to try this out locally
201
+#
202
+# Additionally, you need to add the following configuration to your config/environments/development.rb:
203
+# config.hosts << 'it.application.local:3000'
204
def extract_locale_from_subdomain
205
parsed_locale = request.subdomains.first
206
I18n.available_locales.map(&:to_s).include?(parsed_locale) ? parsed_locale : nil
0 commit comments