heartcombo / simple_form

Forms made easy for Rails! It's tied to a simple DSL, with no opinion on markup.
http://blog.plataformatec.com.br/tag/simple_form
MIT License
8.21k stars 1.31k forks source link

Add option to enforce translations #1813

Open Nerian opened 1 year ago

Nerian commented 1 year ago

Hi,

This PR adds an option to enforce translations from location files instead of falling back to humanizing attribute names.

Nerian commented 1 year ago

Also related to this is https://github.com/ruby-i18n/i18n/pull/654.

The goal being to have this kind of errors:

I18n.t(
  :"role.name",
  scope: : "simple_form.placeholders",
  default: [:"defaults.new.name", :"defaults.name"], 
  raise: true)

Translation missing. Options considered were:
- en.simple_form.placeholders.role.new.name
- en.simple_form.placeholders.role.name
- en.simple_form.placeholders.defaults.new.name
- en.simple_form.placeholders.defaults.name