如何使红宝石在轨道上的内容国际化? [英] How to internationalize content on ruby on rails?
问题描述
如何将类别表(带有名称列)国际化为不同的语言.关于产品表(由名称和描述列组成)如何.使用Ruby on Rails使这些数据库表的内容国际化的最佳方法是什么?
How can I internationalize say a categories table (with a name column) into different languages. How about a products table (consisting of a name and description columns). Which is the best way to internationalize the content of these database tables using Ruby on Rails?
推荐答案
您是否看过: http://guides.rubyonrails.org/i18n.html
它详细描述了如何国际化您的应用程序和
It describes in some detail how to internationalise your application and
"提供了易于使用且可扩展的翻译您的框架应用到单个定制英文以外的语言或提供多种语言支持您的应用程序."
"provides an easy-to-use and extensible framework for translating your application to a single custom language other than English or for providing multi-language support in your application."
一些有用的链接:
- http://rails-i18n.org/
- http://github.com/svenfuchs/rails-i18n
- http://github.com/svenfuchs/rails-i18n/tree/master/rails/locale
更新:2018年
自从将近九年前回答这个问题以来,i18n的同一位作者创建了Globalize,它基于Ruby on Rails中的I18n API来向ActiveRecord模型添加模型转换.
Since answering this question nearly nine years ago, the same author of i18n has created Globalize which builds on the I18n API in Ruby on Rails to add model translations to ActiveRecord models.
请在此处找到详细信息: https://github.com/globalize/globalize
Please find details here: https://github.com/globalize/globalize
这篇关于如何使红宝石在轨道上的内容国际化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!