Method: I18n::Inflector::API_Strict#inflected_locales

Defined in:
lib/i18n-inflector/api_strict.rb

#inflected_localesArray<Symbol> #inflected_locales(kind) ⇒ Array<Symbol> Also known as: locales, supported_locales

Gets locales which have configured strict inflection support.

Overloads:

  • #inflected_localesArray<Symbol>

    Gets locales which have configured inflection support.

    Returns:

    • (Array<Symbol>)

      the array containing locales that support inflection

  • #inflected_locales(kind) ⇒ Array<Symbol>

    Gets locales which have configured inflection support for the given kind.

    Parameters:

    • kind (Symbol)

      the identifier of a kind

    Returns:

    • (Array<Symbol>)

      the array containing locales that support inflection

Returns:

  • (Array<Symbol>)

    the array containing locales that support inflection


162
163
164
165
166
# File 'lib/i18n-inflector/api_strict.rb', line 162

def inflected_locales(kind=nil)
  kind = kind.to_s.empty? ? nil : kind.to_sym
  r = ( @inflected_locales_cache[kind] ||= each_inflected_locale(kind).to_a )
  r.nil? ? r : r.dup
end