Last active
December 23, 2015 06:49
-
-
Save hannesl/6596150 to your computer and use it in GitHub Desktop.
Use English in Rails admin even though you're using a different default locale for the app.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
# Use Swedish as default locale. | |
config.i18n.default_locale = :sv | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
... | |
before_filter do|c| | |
I18n.locale = c.request.path =~ /admin/ ? :en : I18n.default_locale | |
end | |
... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment