mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Failed to save email template with pluralized subject
This commit is contained in:
@@ -113,12 +113,15 @@ class Admin::EmailTemplatesController < Admin::AdminController
|
||||
|
||||
def update_key(key, value)
|
||||
old_value = I18n.t(key)
|
||||
translation_override = TranslationOverride.upsert!(I18n.locale, key, value)
|
||||
|
||||
unless old_value.is_a?(Hash)
|
||||
translation_override = TranslationOverride.upsert!(I18n.locale, key, value)
|
||||
end
|
||||
|
||||
{
|
||||
key: key,
|
||||
old_value: old_value,
|
||||
error_messages: translation_override.errors.full_messages
|
||||
error_messages: translation_override&.errors&.full_messages
|
||||
}
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user