Method: I18n::Inflector::API_Strict#each_inflected_locale

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

#each_inflected_localeLazyArrayEnumerator #each_inflected_locale(kind) ⇒ LazyArrayEnumerator Also known as: each_locale, each_supported_locale

Iterates through locales which have configured strict inflection support.

Overloads:

  • #each_inflected_localeLazyArrayEnumerator

    Iterates through locales which have configured inflection support.

    Returns:

  • #each_inflected_locale(kind) ⇒ LazyArrayEnumerator

    Iterates through locales which have configured inflection support for the given kind.

    Parameters:

    • kind (Symbol)

      the identifier of a kind

    Returns:

Yields:

  • (locale)

    optional block in which each kind will be yielded

Yield Parameters:

  • locale (Symbol)

    the inflected locale identifier

Yield Returns:

Returns:

[View source]

142
143
144
145
146
147
# File 'lib/i18n-inflector/api_strict.rb', line 142

def each_inflected_locale(kind=nil, &block)
  kind = kind.to_s.empty? ? nil : kind.to_sym
  i = @lazy_locales.reject  { |lang,data| data.empty?           }
  i = i.select              { |lang,data| data.has_kind?(kind)  } unless kind.nil?
  i.each_key(&block)
end