Fallback to default I18n value if translation is not available
This commit is contained in:
@@ -12,11 +12,12 @@ module ActionView
|
|||||||
if translation.present?
|
if translation.present?
|
||||||
Globalize.with_locale(locale) do
|
Globalize.with_locale(locale) do
|
||||||
string = I18nContent.where(key: key).first.value
|
string = I18nContent.where(key: key).first.value
|
||||||
|
|
||||||
options.each do |key, value|
|
options.each do |key, value|
|
||||||
string.sub! "%{#{key}}", (value || "%{#{key}}")
|
string.sub! "%{#{key}}", (value || "%{#{key}}")
|
||||||
end
|
end
|
||||||
|
|
||||||
return string.html_safe
|
return string.html_safe unless string.nil?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user