From ea4f07958824a45a652f31f3607b4e5b40dad94f Mon Sep 17 00:00:00 2001 From: rgarcia Date: Fri, 27 Jul 2018 03:19:01 +0200 Subject: [PATCH] Do not store missing translations in DB When visiting http://localhost:3000/admin/site_customization/information_texts?locale=fr and creating a translation, other languages where storing translations in db with the following values: "One"> With this commit we are not storing this translations Note that this only happened when using a param[:locale] in the url at least for french --- .../admin/site_customization/information_texts_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/site_customization/information_texts_controller.rb b/app/controllers/admin/site_customization/information_texts_controller.rb index 54739e8f3..25594fc4a 100644 --- a/app/controllers/admin/site_customization/information_texts_controller.rb +++ b/app/controllers/admin/site_customization/information_texts_controller.rb @@ -15,7 +15,7 @@ class Admin::SiteCustomization::InformationTextsController < Admin::SiteCustomiz values.each do |key, value| locale = key.split("_").last - if value == t(content[:id], locale: locale) + if value == t(content[:id], locale: locale) || value.match(/translation missing/) next else text = I18nContent.find_or_create_by(key: content[:id])