diff --git a/app/admin/translation.rb b/app/admin/translation.rb index 0f88e8ec..6b493cda 100644 --- a/app/admin/translation.rb +++ b/app/admin/translation.rb @@ -8,4 +8,8 @@ ActiveAdmin.register I18n::Backend::ActiveRecord::Translation do f.actions end end + + after_update do + I18n.reload! + end end diff --git a/config/initializers/locale.rb b/config/initializers/locale.rb index 385a3696..0bee853d 100644 --- a/config/initializers/locale.rb +++ b/config/initializers/locale.rb @@ -1,7 +1,9 @@ require 'i18n/backend/active_record' +# https://github.com/dylanz/i18n_backend_database Translation = I18n::Backend::ActiveRecord::Translation if Translation.table_exists? I18n.backend = I18n::Backend::Chain.new(I18n.backend, I18n::Backend::ActiveRecord.new) + I18n::Backend::ActiveRecord.send :include, I18n::Backend::Memoize end diff --git a/config/locales/fr.yml b/config/locales/fr.yml index e8de4b75..2c0fcd6c 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -75,6 +75,8 @@ fr: update: "Mettre à jour %{model}" event: create: Visualiser + q: + create: Rechercher date: abbr_day_names: