Module: RouteTranslator::RouteSet::Helpers

Included in:
RouteTranslator::RouteSet
Defined in:
lib/route_translator/route_set/helpers.rb

Instance Method Summary collapse

Instance Method Details

#available_localesObject



4
5
6
# File 'lib/route_translator/route_set/helpers.rb', line 4

def available_locales
  @available_locales ||= I18n.available_locales.map(&:to_s)
end

#available_locales=(locales) ⇒ Object



8
9
10
# File 'lib/route_translator/route_set/helpers.rb', line 8

def available_locales= locales
  @available_locales = locales.map(&:to_s)
end

#default_localeObject



12
13
14
# File 'lib/route_translator/route_set/helpers.rb', line 12

def default_locale
  @default_locale ||= I18n.default_locale.to_s
end

#default_locale=(locale) ⇒ Object



16
17
18
# File 'lib/route_translator/route_set/helpers.rb', line 16

def default_locale= locale
  @default_locale = locale.to_s
end

#default_locale?(locale) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/route_translator/route_set/helpers.rb', line 20

def default_locale? locale
  default_locale == locale.to_s
end

#locale_suffix(locale) ⇒ Object



24
25
26
# File 'lib/route_translator/route_set/helpers.rb', line 24

def locale_suffix locale
  RouteTranslator.locale_suffix locale
end