简体   繁体   中英

Ruby on Rails, internalization in coffescript

I have a coffeescript file for one of my resources. It seems like internalization doesn't work properly in my coffescript file. I want I18 gem to transform 'select' script, but it doesn't work.

coffeescript:

console.log('employee loaded -> '+"<%= I18n.t 'select' %>")

When I open the browser console I end up with this text:

employee loaded -> <%= I18n.t 'select' %>

en.yml

en:
    select: 'Select...'

tr.yml

tr:
    select: 'Seçiniz...'

Any suggestions,

Thanks.

Maybe you forgot to add extension? filename.coffee. erb

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM