Module: Localized::Helper
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/localized/helper.rb
Instance Method Summary collapse
Instance Method Details
#localized_site ⇒ Object
25 26 27 |
# File 'lib/localized/helper.rb', line 25 def localized_site Localized::Config.locale_to_site_map[I18n.locale] end |
#set_locale ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/localized/helper.rb', line 10 def set_locale key = request.subdomains.last.to_s.to_sym unless Localized::Config.site_to_locale_map[key] key = Localized::Config.default_site end I18n.locale = Localized::Config.site_to_locale_map[key] end |
#url_for(options = nil) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/localized/helper.rb', line 18 def url_for( = nil) if .kind_of?(Hash) and not ip?(request.host) [:host] = with_locale(.delete(:site)) end super end |