Jerome
Jerome

Reputation: 6217

Loading translation data under Globalize gem

Rails applications using Globalize gem generate a database table for a givenmodel's translations named givenmodel_translations with each attribute defined in the givenmodel.rb file.

However starting with a pre-existing data where translation data needs to be created in the translations table - say from a CSV file - there is no railsish way of calling the table. note: this model has also image size validations and works with slugs to find objects One cannot call from the console

GivenmodelTranslation.create( :locale => row[0], :title => row[1] [...] )

How can such data be populated?

Upvotes: 0

Views: 146

Answers (1)

Plamena Gancheva
Plamena Gancheva

Reputation: 700

Globalize creates namespaced translation models:

Givenmodel::Translation

However I haven't seen it documented so it could change in the next versions.

Upvotes: 1

Related Questions