diff --git a/app/assets/javascripts/app/controllers/translation.coffee b/app/assets/javascripts/app/controllers/translation.coffee index 430bf25e4b7b..1507c78f2595 100644 --- a/app/assets/javascripts/app/controllers/translation.coffee +++ b/app/assets/javascripts/app/controllers/translation.coffee @@ -329,18 +329,14 @@ class TranslationModal extends App.ControllerModal url: "#{@apiPath}/translations/upsert", data: JSON.stringify(params), processData: true, - success: => + success: (data) => @close() @successCallback() - # Show toast if neeeded (means that in string inside the current user language was changed). # Later we should add real subscription handling for this situation in the new tech stack. currentLocale = App.i18n.get() if params.locale == currentLocale - @notify( - type: 'success' - msg: App.i18n.translateContent('To see the updated translation, please reload your browser.') - ) + App.i18n.setMap(data.source, data.target) }) diff --git a/app/services/service/translation/upsert.rb b/app/services/service/translation/upsert.rb index bc7edccb9c99..10ab42ae2a88 100644 --- a/app/services/service/translation/upsert.rb +++ b/app/services/service/translation/upsert.rb @@ -15,7 +15,8 @@ def execute translation = Translation.find_source(locale, source) if translation - return translation.update!(target: target) + translation.update!(target: target) + return translation end Translation.create!(locale: locale, source: source, target: target, is_synchronized_from_codebase: false) diff --git a/i18n/zammad.pot b/i18n/zammad.pot index c12081bb6432..22c74bab4e90 100644 --- a/i18n/zammad.pot +++ b/i18n/zammad.pot @@ -13887,10 +13887,6 @@ msgstr "" msgid "To revert back to the default payload, simply turn off the \"Custom Payload\" switch above." msgstr "" -#: app/assets/javascripts/app/controllers/translation.coffee -msgid "To see the updated translation, please reload your browser." -msgstr "" - #: app/assets/javascripts/app/models/text_module.coffee msgid "To select placeholders from a list, just enter \"::\"." msgstr ""