Pour optimiser les pages, les traductions venant de la bd sont cachées en mémoire
This commit is contained in:
parent
61ed01ce2e
commit
b5ede41a87
@ -8,4 +8,8 @@ ActiveAdmin.register I18n::Backend::ActiveRecord::Translation do
|
|||||||
f.actions
|
f.actions
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
after_update do
|
||||||
|
I18n.reload!
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
require 'i18n/backend/active_record'
|
require 'i18n/backend/active_record'
|
||||||
|
|
||||||
|
# https://github.com/dylanz/i18n_backend_database
|
||||||
Translation = I18n::Backend::ActiveRecord::Translation
|
Translation = I18n::Backend::ActiveRecord::Translation
|
||||||
|
|
||||||
if Translation.table_exists?
|
if Translation.table_exists?
|
||||||
I18n.backend = I18n::Backend::Chain.new(I18n.backend, I18n::Backend::ActiveRecord.new)
|
I18n.backend = I18n::Backend::Chain.new(I18n.backend, I18n::Backend::ActiveRecord.new)
|
||||||
|
I18n::Backend::ActiveRecord.send :include, I18n::Backend::Memoize
|
||||||
end
|
end
|
||||||
|
@ -75,6 +75,8 @@ fr:
|
|||||||
update: "Mettre à jour %{model}"
|
update: "Mettre à jour %{model}"
|
||||||
event:
|
event:
|
||||||
create: Visualiser
|
create: Visualiser
|
||||||
|
q:
|
||||||
|
create: Rechercher
|
||||||
|
|
||||||
date:
|
date:
|
||||||
abbr_day_names:
|
abbr_day_names:
|
||||||
|
Loading…
Reference in New Issue
Block a user