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

Popular posts from this blog

serialization - Convert Any type in scala to Array[Byte] and back -

matplotlib support failed in PyCharm on OSX -

python - Matplotlib: TypeError: 'AxesSubplot' object is not callable -