ruby-on-railsinternationalizationglobalizetraco

How do we get a translation in the view on render for a rails model attr, eg a blog post?


I want to translate a column in rails upon display in the view that is translated to the current users locale IE I don't need to store the translation really in the DB. Is there any reason why gems like Globalize and Traco force you to store the translation in a separate table on save?

Is there just a way to translate what I want in the view when I render my blog post?

I havn't done any language conversion before in rails but it seems YAML files are just for static text IE we can't add in model objects and translate them?


Solution

  • I found this else where where I asked a question..

    Goolge translate

    Does the job I need.

    Don't think globalize is even is a translator library and going off the railscast 338 seems you still need to add your own translation ymls unless thats just for custom languages I'm not sure exactly how that works. But still you need to translate and save each language just for your model methods to translate