I need to perform string interpolation inside yml file, to create a custom error message based on a value which I will pass to locale yml file.
something like
users:
error1: "custom error message based on variable #{passed_in_var}"
Is this possible?
Use I18n interpolation!
users:
error1: "custom error message based on variable %{passed_in_var}"
Then you call it like this:
t('users.error1', passed_in_var: 'foobar')
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