Fallback to default I18n value if translation is not available

This commit is contained in:
Angel Perez
2018-07-24 14:51:01 -04:00
parent f521188cd0
commit 7255c6cb9b

View File

@@ -12,11 +12,12 @@ module ActionView
if translation.present?
Globalize.with_locale(locale) do
string = I18nContent.where(key: key).first.value
options.each do |key, value|
string.sub! "%{#{key}}", (value || "%{#{key}}")
end
return string.html_safe
return string.html_safe unless string.nil?
end
end