开发者

Rails 3: How to insert non English text in view

I would like to insert non English (e.g. Russian or Hebrew) text in my 开发者_StackOverflow中文版view.

Is that a good idea to do:

<div>что нибудь по русски</div>

or

<div><%= "משהו בעברית" %></div>

or there are better methods ?


Use the Rails i18n API. you basically create YAML files for translations of specific pieces of code; it works amazingly well. Here's the guide:

http://guides.rubyonrails.org/i18n.html

If you need something more complicated, it's doable, but the Rails i18n API is one of the best.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜