Giter Club home page Giter Club logo

Comments (3)

fmh avatar fmh commented on August 16, 2024

same issue !

from i18n-active_record.

fmh avatar fmh commented on August 16, 2024

After some test, it seems that it is a problem related to the logic of rails_admin and not an i18n-active_record issue, It will be necessary to reload the rails_admin files (config and models if rails_admin config in models) after each addition or update of translation
Add this code in your translation model and voila, I hope this will help you :

class Translation  < ActiveRecord::Base
  after_save :reload_models
  after_commit :reload_models

  def reload_models
    RailsAdmin.config.models.collect {|m| m.abstract_model.model_name}.each do |m|
      RailsAdmin.config.reset_model(m)
    end
    RailsAdmin::Config::Actions.reset
    load("#{Rails.root}/config/initializers/rails_admin.rb")
    (Dir[Rails.root.join('app', 'models/*.rb')]).each do |f|
      load f
    end
  end
end

from i18n-active_record.

timfjord avatar timfjord commented on August 16, 2024

Good catch @fmh
I am closing this one in the meantime. Feel free to reopen it if issue still exists

from i18n-active_record.

Related Issues (20)

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.