I went through http://guides.rubyonrails.org/i18n.html and set up my en.yml
file:
en:
test:
welcome: Welcome!!!
registration:
signup: Sign up for an invite!!
However, in my new.html.haml
file,
How do I reference signup
?
The tutorial only shows how to do so using ERB, not HAML. I tried this and it didn't work:
%h2 <%=t :registration.signup %>
Any ideas?
You should probably read the HAML reference to understand how HAML works. To add code to generate content for a tag, you use =, as in:
%h2= t('registration.signup')
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