开发者

i18n find in associated models with rails 3

开发者 https://www.devze.com 2023-03-10 00:29 出处:网络
I need to build a multi-language site, where the client wil开发者_运维问答l add records in many languages.

I need to build a multi-language site, where the client wil开发者_运维问答l add records in many languages. I wanna know if Rails has something to do a website like this. Imagine these scenario: I have a Post and Category. The user language sessions is set to en-US. When the user do a search for category 'car' the system will retrieve the Category model and all Posts TRANSLATED in that language.

Can I accomplish this with Rails 3?

Thanks in advance


You can do this by yourself by adding a translation table for the posts and categories tables and join them with the original tables. Alternatively, have a look at Globalize2: https://github.com/joshmh/globalize2 which does all the backend work for you.

0

精彩评论

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