ruby-i18n / i18n

Internationalization (i18n) library for Ruby
MIT License
976 stars 408 forks source link

Add more helpful translation error when :default option is provided. #654

Closed Nerian closed 1 year ago

Nerian commented 1 year ago

Hi,

This PR add more information to the error message for missing translation when a default option array was provided.

Example of error message:

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
radar commented 1 year ago

Looks good to me. Thanks :)