Display only translations for the current language
After creating a translation in spanish, it was also displaying it when selecting the english locale. This was due to the code picking the first translation available With this commit, we are checking for an existing translation in the current locale and displaying it if it exists
This commit is contained in:
@@ -15,7 +15,7 @@ class Admin::SiteCustomization::InformationTextsController < Admin::SiteCustomiz
|
||||
values.each do |key, value|
|
||||
locale = key.split("_").last
|
||||
|
||||
if value == I18n.backend.translate(locale, content[:id])
|
||||
if value == t(content[:id], locale: locale)
|
||||
next
|
||||
else
|
||||
text = I18nContent.find_or_create_by(key: content[:id])
|
||||
|
||||
Reference in New Issue
Block a user