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

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

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

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -