ruby on rails - How to pass arguments in I18n.translate -
i18n.translate can translate error.messages this:
i18n.translate('error.messages.taken') -> has been taken
but there error messages contains arguments like:
i18n.translate('error.messages.greater_than_or_equal_to') -> must greater or equal %{count}"
is possible pass argument ‘count’ in i18n.translate?
you can pass params after key
i18n.translate('error.messages.greater_than_or_equal_to', count: 2)
Comments
Post a Comment