Module: DevDoc::I18n::PseudoLocale::Backend

Defined in:
lib/dev_doc/i18n/pseudo_locale.rb

Overview

I18n backend override: resolves the real English entry, then accents it.

Constant Summary collapse

SKIP_NAMESPACES =

Namespaces whose values are format directives / structural data, not copy. Accenting these would corrupt strftime (%A), number formats.

%w[i18n date time datetime number support].freeze

Instance Method Summary collapse

Instance Method Details

#lookup(locale, key, scope = [], options = ::I18n::EMPTY_HASH) ⇒ Object



112
113
114
115
116
117
118
119
120
# File 'lib/dev_doc/i18n/pseudo_locale.rb', line 112

def lookup(locale, key, scope = [], options = ::I18n::EMPTY_HASH)
  return super unless locale.to_s == PSEUDO_LOCALE

  # Resolve the real English entry (template, before interpolation).
  real = super(:en, key, scope, options)
  return real if real.nil? || skip?(key, scope)

  pseudoize(real)
end