Fallback to default I18n value if translation is not available
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user