I18n.translate can translate error.messages like this:
I18n.translate('error.messages.taken')
-> has already been taken
But there are some error messages that contains arguments like:
I18n.translate('error.messages.greater_than_or_equal_to')
-> must be greater than or equal to %{count}"
Is it possible to pass the argument ‘count’ in the I18n.translate?
You can pass the params after the key
I18n.translate('error.messages.greater_than_or_equal_to', count: 2)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With