开发者

Rails 3: How to insert non English text in view

开发者 https://www.devze.com 2023-03-04 04:24 出处:网络
I would like to insert non English (e.g. Russian or Hebrew) text in my 开发者_StackOverflow中文版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

精彩评论

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