开发者

Adding translations in the String in Rails

开发者 https://www.devze.com 2023-01-19 06:59 出处:网络
I am new to rai开发者_如何学Gols.. I am having a line in the mailing queue.rb file as subject =\"Mail : Welcome to app\"

I am new to rai开发者_如何学Gols.. 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 ..


Use the i18N inside Rails

subject = i18N.t('str_welcome')

All about i18n in rails : http://guides.rubyonrails.org/i18n.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号