Open asecondwill opened 10 years ago
Hi asecondwill. I don't currently have any plans to add further translation features. Hopefully the majority of the text used in the gem comes from the locale yml files, so that should be a good start. I think the next step would be to add support for translations on the models if the spree_i18n gem is loaded. Presumably that would be the BlogEntry
model fields for title
, body
and summary
. Is that what you had in mind?
Hi, Yep thats exactly it.
+1 This would be very interesting for me, too!
+1
Hi there! First off: thanks for this plugin here! I also wanted to add translations and tried it myself.
First I created a file named blog_entry_decorator.rb in models/spree containing this code:
Spree::BlogEntry.class_eval do
translates :title, :body, :summary
end
Then I added this migration here
class AddTranslationsToBlogEntries < ActiveRecord::Migration
def up
Spree::BlogEntry.create_translation_table!({
:title => :string, :body => :text, :summary => :text
}, {
:migrate_data => true
})
end
end
is that correct? how can I add the translation fields to the admin view?
Best regards
@mmintel you need to override the view part of this gem as well and use the same procedure to add translations as you can do with a normal rails application. and as suggested by the
globalize gem
you can take help with this gem Spree Globalize
This works great - I've been searching all arvo for a spree blog gem. thanks!
Do you have any plans to enable translations with spree I18N / globalise?