Edgars
Edgars

Reputation: 953

adding translations to database records

I am at the end off my project. I implemented few languages. But this moment, I have categories that are placed in database, but these categories are in my native Latvian language, what would be the trick to be able change language of these records simultaneously with display language change.

It means that If I choose locale en, then these category names are displayed in english. Some ideas! To store ultiple language translation within the records, I think it's bad idea. Or to store just put latvian category name as id inside <%= I18n.t 'category_id_in_latvian'%> and just in yml files put the translation ?
Or there are other solution?

Thanks

Upvotes: 0

Views: 224

Answers (1)

Kulgar
Kulgar

Reputation: 1875

You should take a look at the Globalize Gem:

Github of globalize3 Gem

This gem should do exactly what you need. ;)

And if it doesn't, please, explain why by providing more details on what you want to do and I'll update my answer according to your needs.

Upvotes: 1

Related Questions