Forum: Rails I18n using translation variable inside String

09bbc36d6eb2bfdc5b54cf56f73e88f2?d=identicon&s=25 Aruna Chinnamuthu (arunajasmine)
on 2010-10-12 08:32
Hi , I am new to rails.. I am having a line in the mailing queue.rb file
as

subject ="Mail : Welcome to app"

I have added translation for Welcome to app as

str_welcome: "Welcome to app"

Now i am trying to replace Welcome to app in the file with the
str_welcome

how to do that as i have another prefix ("Mail") also ..
42ec9fd08c179b547dcb60d977e29941?d=identicon&s=25 Iain Hecker (Guest)
on 2010-10-13 15:05
(Received via mailing list)
Or you could try nesting a translation:

subject = I18n.t(:mail, :title => I18n.t("str_welcome"))

Your mail translation would look like:

mail: "Mail: %{title}"



2010/10/12 Andrs Meja <andmej@gmail.com>:
7e565a1681dc0137f43826aa840686af?d=identicon&s=25 "Andrés Mejía" <andmej@gmail.com> (Guest)
on 2010-10-15 22:59
(Received via mailing list)
Try subject="Mail: #{I18n.t("str_welcome")}"
This topic is locked and can not be replied to.