From b5b1c88b548461fb7e26fb011b51556ee5229c47 Mon Sep 17 00:00:00 2001 From: Martin Gruner Date: Wed, 26 Jan 2022 08:17:54 +0100 Subject: [PATCH] Maintenance: Improved translatable source strings. --- .../_profile/calendar_subscriptions.coffee | 2 +- .../app/controllers/_profile/language.coffee | 2 +- .../_profile/linked_accounts.coffee | 2 +- .../controllers/_profile/notification.coffee | 2 +- .../controllers/_settings/area_logo.coffee | 2 +- .../controllers/_settings/area_switch.coffee | 2 +- .../_settings/area_ticket_number.coffee | 2 +- .../app/controllers/_settings/form.coffee | 2 +- .../knowledge_base/delete_action.coffee | 4 ++- .../knowledge_base/sidebar/attachments.coffee | 4 +-- .../app/controllers/maintenance.coffee | 2 +- .../javascripts/app/models/setting.coffee | 2 +- i18n/zammad.pot | 26 +++++++------------ 13 files changed, 24 insertions(+), 30 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_profile/calendar_subscriptions.coffee b/app/assets/javascripts/app/controllers/_profile/calendar_subscriptions.coffee index 3b9e0795f..ed0a4f586 100644 --- a/app/assets/javascripts/app/controllers/_profile/calendar_subscriptions.coffee +++ b/app/assets/javascripts/app/controllers/_profile/calendar_subscriptions.coffee @@ -77,7 +77,7 @@ class ProfileCalendarSubscriptions extends App.ControllerSubContent => @notify( type: 'success' - msg: App.i18n.translateContent('Successful!') + msg: App.i18n.translateContent('Update successful.') ) true ) diff --git a/app/assets/javascripts/app/controllers/_profile/language.coffee b/app/assets/javascripts/app/controllers/_profile/language.coffee index 20911b2c3..00cd6440d 100644 --- a/app/assets/javascripts/app/controllers/_profile/language.coffee +++ b/app/assets/javascripts/app/controllers/_profile/language.coffee @@ -55,7 +55,7 @@ class ProfileLanguage extends App.ControllerSubContent App.Event.trigger('ui:rerender') @notify( type: 'success' - msg: App.i18n.translateContent('Successful!') + msg: App.i18n.translateContent('Update successful.') ) , true diff --git a/app/assets/javascripts/app/controllers/_profile/linked_accounts.coffee b/app/assets/javascripts/app/controllers/_profile/linked_accounts.coffee index e81321169..f16c6e4b1 100644 --- a/app/assets/javascripts/app/controllers/_profile/linked_accounts.coffee +++ b/app/assets/javascripts/app/controllers/_profile/linked_accounts.coffee @@ -45,7 +45,7 @@ class ProfileLinkedAccounts extends App.ControllerSubContent success: (data, status, xhr) => @notify( type: 'success' - msg: App.i18n.translateContent('Successful!') + msg: App.i18n.translateContent('Update successful.') ) update = => @render() diff --git a/app/assets/javascripts/app/controllers/_profile/notification.coffee b/app/assets/javascripts/app/controllers/_profile/notification.coffee index 70c2d120a..da991cd3c 100644 --- a/app/assets/javascripts/app/controllers/_profile/notification.coffee +++ b/app/assets/javascripts/app/controllers/_profile/notification.coffee @@ -176,7 +176,7 @@ class ProfileNotification extends App.ControllerSubContent App.Event.trigger('ui:rerender') @notify( type: 'success' - msg: App.i18n.translateContent('Successful!') + msg: App.i18n.translateContent('Update successful.') ) , true diff --git a/app/assets/javascripts/app/controllers/_settings/area_logo.coffee b/app/assets/javascripts/app/controllers/_settings/area_logo.coffee index 55a8be865..126c217cd 100644 --- a/app/assets/javascripts/app/controllers/_settings/area_logo.coffee +++ b/app/assets/javascripts/app/controllers/_settings/area_logo.coffee @@ -69,7 +69,7 @@ class App.SettingsAreaLogo extends App.Controller if data.result is 'ok' App.Event.trigger 'notify', { type: 'success' - msg: App.i18n.translateContent('Update successful!') + msg: App.i18n.translateContent('Update successful.') timeout: 2000 } for setting in data.settings diff --git a/app/assets/javascripts/app/controllers/_settings/area_switch.coffee b/app/assets/javascripts/app/controllers/_settings/area_switch.coffee index 710fc2112..d61ff20ff 100644 --- a/app/assets/javascripts/app/controllers/_settings/area_switch.coffee +++ b/app/assets/javascripts/app/controllers/_settings/area_switch.coffee @@ -79,7 +79,7 @@ class App.SettingsAreaSwitch extends App.Controller ui.formEnable(e) App.Event.trigger 'notify', { type: 'success' - msg: App.i18n.translateContent('Update successful!') + msg: App.i18n.translateContent('Update successful.') timeout: 2000 } diff --git a/app/assets/javascripts/app/controllers/_settings/area_ticket_number.coffee b/app/assets/javascripts/app/controllers/_settings/area_ticket_number.coffee index d0f6b808b..77b3f88ef 100644 --- a/app/assets/javascripts/app/controllers/_settings/area_ticket_number.coffee +++ b/app/assets/javascripts/app/controllers/_settings/area_ticket_number.coffee @@ -115,7 +115,7 @@ class App.SettingsAreaTicketNumber extends App.Controller ui.formEnable(e) App.Event.trigger 'notify', { type: 'success' - msg: App.i18n.translateContent('Update successful!') + msg: App.i18n.translateContent('Update successful.') timeout: 2000 } diff --git a/app/assets/javascripts/app/controllers/_settings/form.coffee b/app/assets/javascripts/app/controllers/_settings/form.coffee index 32a2b72c2..c0c05cfd8 100644 --- a/app/assets/javascripts/app/controllers/_settings/form.coffee +++ b/app/assets/javascripts/app/controllers/_settings/form.coffee @@ -78,7 +78,7 @@ class App.SettingsForm extends App.Controller if count == 0 App.Event.trigger('notify', { type: 'success' - msg: App.i18n.translateContent('Update successful!') + msg: App.i18n.translateContent('Update successful.') timeout: 2000 }) diff --git a/app/assets/javascripts/app/controllers/knowledge_base/delete_action.coffee b/app/assets/javascripts/app/controllers/knowledge_base/delete_action.coffee index 78a9fc85c..a5e3507ff 100644 --- a/app/assets/javascripts/app/controllers/knowledge_base/delete_action.coffee +++ b/app/assets/javascripts/app/controllers/knowledge_base/delete_action.coffee @@ -19,7 +19,9 @@ class App.KnowledgeBaseDeleteAction @dialog = new App.ControllerConfirm( head: __('Delete') - message: "Are you sure you want to delete \"#{translation?.title}\"?" + # ControllerConfirm performs another (unneeded) translateContent which does also escape special characters, so + # use translatePlain here. + message: App.i18n.translatePlain('Do you really want to delete "%s"?', translation?.title) callback: @doDelete container: @parentController.el onSubmit: -> diff --git a/app/assets/javascripts/app/controllers/knowledge_base/sidebar/attachments.coffee b/app/assets/javascripts/app/controllers/knowledge_base/sidebar/attachments.coffee index af0de3f3d..93b9f3936 100644 --- a/app/assets/javascripts/app/controllers/knowledge_base/sidebar/attachments.coffee +++ b/app/assets/javascripts/app/controllers/knowledge_base/sidebar/attachments.coffee @@ -110,9 +110,7 @@ class App.KnowledgeBaseSidebarAttachments extends App.Controller class DeleteConfirm extends App.ControllerConfirm content: -> - sentence = App.i18n.translateContent('Are you sure you want to delete') - "#{sentence} #{@attachment.filename}?" - buttonSubmit: __('delete') + App.i18n.translateContent('Do you really want to delete "%s"?', @attachment.filename) onSubmit: -> @formDisable(@el) diff --git a/app/assets/javascripts/app/controllers/maintenance.coffee b/app/assets/javascripts/app/controllers/maintenance.coffee index 772c5d99a..c61c640ba 100644 --- a/app/assets/javascripts/app/controllers/maintenance.coffee +++ b/app/assets/javascripts/app/controllers/maintenance.coffee @@ -71,7 +71,7 @@ class Maintenance extends App.ControllerSubContent App.Setting.set('maintenance_login_message', params.message) @notify type: 'success' - msg: App.i18n.translateContent('Update successful!') + msg: App.i18n.translateContent('Update successful.') removeAll: true sendMessage: (e) -> diff --git a/app/assets/javascripts/app/models/setting.coffee b/app/assets/javascripts/app/models/setting.coffee index e521741dc..605ec2c83 100644 --- a/app/assets/javascripts/app/models/setting.coffee +++ b/app/assets/javascripts/app/models/setting.coffee @@ -17,7 +17,7 @@ class App.Setting extends App.Model if options.notify App.Event.trigger 'notify', { type: 'success' - msg: App.i18n.translateContent('Update successful!') + msg: App.i18n.translateContent('Update successful.') timeout: 2000 } App.Setting.preferencesPost(@) diff --git a/i18n/zammad.pot b/i18n/zammad.pot index 5081c2f1c..bcb61a1b8 100644 --- a/i18n/zammad.pot +++ b/i18n/zammad.pot @@ -835,10 +835,6 @@ msgstr "" msgid "Archived at" msgstr "" -#: app/assets/javascripts/app/controllers/knowledge_base/sidebar/attachments.coffee -msgid "Are you sure you want to delete" -msgstr "" - #: app/assets/javascripts/app/controllers/knowledge_base/content_controller.coffee msgid "Are you sure you want to reload? You have unsaved changes that will get lost" msgstr "" @@ -3280,6 +3276,11 @@ msgstr "" msgid "Do not sign email" msgstr "" +#: app/assets/javascripts/app/controllers/knowledge_base/delete_action.coffee +#: app/assets/javascripts/app/controllers/knowledge_base/sidebar/attachments.coffee +msgid "Do you really want to delete \"%s\"?" +msgstr "" + #: app/assets/javascripts/app/controllers/_application_controller/_modal_generic_destroy_confirm.coffee #: app/assets/javascripts/app/controllers/tag.coffee msgid "Do you really want to delete this object?" @@ -8586,13 +8587,6 @@ msgstr "" msgid "Subscription Settings" msgstr "" -#: app/assets/javascripts/app/controllers/_profile/calendar_subscriptions.coffee -#: app/assets/javascripts/app/controllers/_profile/language.coffee -#: app/assets/javascripts/app/controllers/_profile/linked_accounts.coffee -#: app/assets/javascripts/app/controllers/_profile/notification.coffee -msgid "Successful!" -msgstr "" - #: app/assets/javascripts/app/models/user.coffee msgid "Summer holiday" msgstr "" @@ -9716,16 +9710,17 @@ msgstr "" msgid "Update existing records with the attributes specified in the import data." msgstr "" +#: app/assets/javascripts/app/controllers/_profile/calendar_subscriptions.coffee +#: app/assets/javascripts/app/controllers/_profile/language.coffee +#: app/assets/javascripts/app/controllers/_profile/linked_accounts.coffee +#: app/assets/javascripts/app/controllers/_profile/notification.coffee +#: app/assets/javascripts/app/controllers/_profile/out_of_office.coffee #: app/assets/javascripts/app/controllers/_settings/area_logo.coffee #: app/assets/javascripts/app/controllers/_settings/area_switch.coffee #: app/assets/javascripts/app/controllers/_settings/area_ticket_number.coffee #: app/assets/javascripts/app/controllers/_settings/form.coffee #: app/assets/javascripts/app/controllers/maintenance.coffee #: app/assets/javascripts/app/models/setting.coffee -msgid "Update successful!" -msgstr "" - -#: app/assets/javascripts/app/controllers/_profile/out_of_office.coffee msgid "Update successful." msgstr "" @@ -10903,7 +10898,6 @@ msgstr "" #: app/assets/javascripts/app/controllers/_application_controller/_modal_generic_destroy_confirm.coffee #: app/assets/javascripts/app/controllers/data_privacy.coffee -#: app/assets/javascripts/app/controllers/knowledge_base/sidebar/attachments.coffee #: app/assets/javascripts/app/controllers/ticket_zoom/article_action/delete.coffee #: app/assets/javascripts/app/views/data_privacy/preview.jst.eco msgid "delete"