ruby-i18n / i18n

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

Don't skip interpolate for the empty values. #624

Closed piecehealth closed 2 years ago

piecehealth commented 2 years ago

The I18n.t method won't raise I18n::MissingInterpolationArgument error if the given options are empty, which is not as expected.

e.g.

en:
    greeting: "Hello %{firstname} %{lastname}"
I18n.t("greeting", firstname: "Michael", lastname: "Jordan") # => "Hello Michael Jordan"
I18n.t("greeting") # => "Hello %{firstname} %{lastname}"
I18n.t("greeting", firstname: "Michael") # => I18n::MissingInterpolationArgument