Module: DeviseI18n::ViewHelpers

Defined in:
lib/devise-i18n/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#devise_i18n_fix_model_name_case(text, i18n_key:) ⇒ Object

Custom logic to fix case for different strings and languages.



4
5
6
7
8
9
# File 'lib/devise-i18n/view_helpers.rb', line 4

def devise_i18n_fix_model_name_case(text, i18n_key:)
  # In general, on errors.messages.not_saved, downcase, but German nouns are always capitalized.
  return text.downcase if i18n_key == 'errors.messages.not_saved' && I18n.locale.to_s != 'de'

  text
end