In a view file:
t("example")
or
t(:example)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Passing a string can be more succinct. Given a translation file such as:
You could access the flash messages using a string or symbols:
Where the
:scopevalue is an array containing symbols ordered from top to bottom of the ‘namespace tree’, if you will.Both methods lead to the same result, but one, using a string, is arguably easier to use and more readable.
Intuitively I would say the symbol method might be faster (as there might be some regex parsing with the string, which is generally expensive), but I couldn’t tell you for certain.