Coder Social home page Coder Social logo

Translations about spree-blogging-spree HOT 6 OPEN

asecondwill avatar asecondwill commented on July 30, 2024
Translations

from spree-blogging-spree.

Comments (6)

stefansenk avatar stefansenk commented on July 30, 2024

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?

from spree-blogging-spree.

asecondwill avatar asecondwill commented on July 30, 2024

Hi, Yep thats exactly it.

from spree-blogging-spree.

momolog avatar momolog commented on July 30, 2024

+1 This would be very interesting for me, too!

from spree-blogging-spree.

picazoH avatar picazoH commented on July 30, 2024

+1

from spree-blogging-spree.

mmintel avatar mmintel commented on July 30, 2024

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

from spree-blogging-spree.

forever-sumit avatar forever-sumit commented on July 30, 2024

@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

from spree-blogging-spree.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.