Module: Postnhost::Settings::I18nPatch

Defined in:
lib/postnhost/settings/i18n_patch.rb

Instance Method Summary collapse

Instance Method Details

#translate(locale, key, options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/postnhost/settings/i18n_patch.rb', line 4

def translate(locale, key, options = {})
  separator = options[:separator] || I18n.default_separator
  override = Postnhost::Settings::I18nOverrides.lookup_override(
    key,
    locale: locale,
    scope: options[:scope],
    separator: separator
  )
  return super if override.nil?

  Postnhost::Settings::I18nOverrides.interpolate(override, options)
end