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: "<span class=\"translation_missing\" title=\"translation missing: es.debates.index.search_results.one\">One</span>"> 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
This commit is contained in:
@@ -15,7 +15,7 @@ class Admin::SiteCustomization::InformationTextsController < Admin::SiteCustomiz
|
|||||||
values.each do |key, value|
|
values.each do |key, value|
|
||||||
locale = key.split("_").last
|
locale = key.split("_").last
|
||||||
|
|
||||||
if value == t(content[:id], locale: locale)
|
if value == t(content[:id], locale: locale) || value.match(/translation missing/)
|
||||||
next
|
next
|
||||||
else
|
else
|
||||||
text = I18nContent.find_or_create_by(key: content[:id])
|
text = I18nContent.find_or_create_by(key: content[:id])
|
||||||
|
|||||||
Reference in New Issue
Block a user