From 2a86a454c5c847f9738cee84b8794480ba835c2c Mon Sep 17 00:00:00 2001 From: Martin Gruner Date: Thu, 6 Jan 2022 20:37:47 +0100 Subject: [PATCH] Maintenance: Improved translatable source strings. --- .../app/controllers/agent_ticket_merge.coffee | 2 +- .../ticket_zoom/article_new.coffee | 2 +- .../channels_twitter_controller.rb | 10 +- app/controllers/links_controller.rb | 2 +- app/controllers/reports_controller.rb | 8 +- app/controllers/tickets_controller.rb | 4 +- i18n/zammad.pot | 98 +++++++++---------- lib/static_assets.rb | 2 +- spec/requests/ticket_spec.rb | 2 +- 9 files changed, 65 insertions(+), 65 deletions(-) diff --git a/app/assets/javascripts/app/controllers/agent_ticket_merge.coffee b/app/assets/javascripts/app/controllers/agent_ticket_merge.coffee index c5c6bdce0..a071f0173 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_merge.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_merge.coffee @@ -95,7 +95,7 @@ class App.TicketMerge extends App.ControllerModal # notify UI @notify type: 'success' - msg: App.i18n.translateContent('Ticket %s merged!', data.source_ticket['number']) + msg: App.i18n.translateContent('Ticket %s merged.', data.source_ticket['number']) timeout: 4000 App.TaskManager.remove("Ticket-#{data.source_ticket['id']}") diff --git a/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee b/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee index 0881856c9..d461034c7 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee @@ -300,7 +300,7 @@ class App.TicketZoomArticleNew extends App.Controller buttonCancel: __('Cancel') buttonCancelClass: 'btn--danger' buttonSubmit: false - message: __('Please fill also some text in!') + message: __('Please enter a text.') shown: true small: true container: @el.closest('.content') diff --git a/app/controllers/channels_twitter_controller.rb b/app/controllers/channels_twitter_controller.rb index f02e2208d..ea4eb7800 100644 --- a/app/controllers/channels_twitter_controller.rb +++ b/app/controllers/channels_twitter_controller.rb @@ -28,14 +28,14 @@ class ChannelsTwitterController < ApplicationController @channel = channel end - raise Exceptions::UnprocessableEntity, "No such channel for user id '#{params[:for_user_id]}'!" if !@channel + raise Exceptions::UnprocessableEntity, "Could not find channel for user id '#{params[:for_user_id]}'!" if !@channel true end def hmac_signature_by_app(content) external_credential = ExternalCredential.find_by(name: 'twitter') - raise Exceptions::UnprocessableEntity, __('No such external_credential \'twitter\'!') if !external_credential + raise Exceptions::UnprocessableEntity, __("Could not find external_credential 'twitter'!") if !external_credential hmac_signature_gen(external_credential.credentials[:consumer_secret], content) end @@ -51,9 +51,9 @@ class ChannelsTwitterController < ApplicationController if !external_credential && ExternalCredential.exists?(name: 'twitter') external_credential = ExternalCredential.find_by(name: 'twitter').credentials end - raise Exceptions::UnprocessableEntity, __('No external_credential in cache!') if external_credential.blank? - raise Exceptions::UnprocessableEntity, __('No external_credential[:consumer_secret] in cache!') if external_credential[:consumer_secret].blank? - raise Exceptions::UnprocessableEntity, __('No crc_token in verify payload from twitter!') if params['crc_token'].blank? + raise Exceptions::UnprocessableEntity, __('Could not find external_credential in cache!') if external_credential.blank? + raise Exceptions::UnprocessableEntity, __('Could not find external_credential[:consumer_secret] in cache!') if external_credential[:consumer_secret].blank? + raise Exceptions::UnprocessableEntity, __("Required parameter 'crc_token' missing in verify payload from twitter!") if params['crc_token'].blank? render json: { response_token: hmac_signature_gen(external_credential[:consumer_secret], params['crc_token']) diff --git a/app/controllers/links_controller.rb b/app/controllers/links_controller.rb index 0127c9d29..d95ea7781 100644 --- a/app/controllers/links_controller.rb +++ b/app/controllers/links_controller.rb @@ -31,7 +31,7 @@ class LinksController < ApplicationController end if !object - render json: { error: __('No such object!') }, status: :unprocessable_entity + render json: { error: __('Could not find object!') }, status: :unprocessable_entity return end diff --git a/app/controllers/reports_controller.rb b/app/controllers/reports_controller.rb index d95d43bd2..67ab3364a 100644 --- a/app/controllers/reports_controller.rb +++ b/app/controllers/reports_controller.rb @@ -64,7 +64,7 @@ class ReportsController < ApplicationController if !params[:downloadBackendSelected] render json: { - error: __('No such downloadBackendSelected param'), + error: __("Required parameter 'downloadBackendSelected' is missing."), }, status: :unprocessable_entity return end @@ -126,7 +126,7 @@ class ReportsController < ApplicationController def params_all profile = nil if !params[:profiles] && !params[:profile_id] - raise Exceptions::UnprocessableEntity, __('No such profiles param') + raise Exceptions::UnprocessableEntity, __("Required parameter 'profile' is missing.") end if params[:profile_id] @@ -139,12 +139,12 @@ class ReportsController < ApplicationController end end if !profile - raise Exceptions::UnprocessableEntity, __('No such active profile') + raise Exceptions::UnprocessableEntity, __('Could not find active reporting profile.') end local_config = Report.config if !local_config || !local_config[:metric] || !local_config[:metric][params[:metric].to_sym] - raise Exceptions::UnprocessableEntity, "No such metric #{params[:metric]}" + raise Exceptions::UnprocessableEntity, "Could not find metric #{params[:metric]}" end metric = local_config[:metric][params[:metric].to_sym] diff --git a/app/controllers/tickets_controller.rb b/app/controllers/tickets_controller.rb index 21197d1df..2473814ab 100644 --- a/app/controllers/tickets_controller.rb +++ b/app/controllers/tickets_controller.rb @@ -372,7 +372,7 @@ class TicketsController < ApplicationController if !target_ticket render json: { result: 'failed', - message: __('No such target ticket number!'), + message: __('Could not find target ticket number!'), } return end @@ -383,7 +383,7 @@ class TicketsController < ApplicationController if !source_ticket render json: { result: 'failed', - message: __('No such source ticket!'), + message: __('Could not find source ticket!'), } return end diff --git a/i18n/zammad.pot b/i18n/zammad.pot index 045c9483e..95123c4d0 100644 --- a/i18n/zammad.pot +++ b/i18n/zammad.pot @@ -2017,6 +2017,38 @@ msgstr "" msgid "Core Workflows are actions or constraints on selections in forms. Depending on an action, it is possible to hide or restrict fields or to change the obligation to fill them in." msgstr "" +#: app/controllers/reports_controller.rb +msgid "Could not find active reporting profile." +msgstr "" + +#: app/controllers/channels_twitter_controller.rb +msgid "Could not find external_credential 'twitter'!" +msgstr "" + +#: app/controllers/channels_twitter_controller.rb +msgid "Could not find external_credential in cache!" +msgstr "" + +#: app/controllers/channels_twitter_controller.rb +msgid "Could not find external_credential[:consumer_secret] in cache!" +msgstr "" + +#: app/controllers/links_controller.rb +msgid "Could not find object!" +msgstr "" + +#: app/controllers/tickets_controller.rb +msgid "Could not find source ticket!" +msgstr "" + +#: app/controllers/tickets_controller.rb +msgid "Could not find target ticket number!" +msgstr "" + +#: lib/static_assets.rb +msgid "Could not read raw logo!" +msgstr "" + #: app/assets/javascripts/app/views/knowledge_base/new_modal.coffee msgid "Couldn't create Knowledge Base" msgstr "" @@ -6303,10 +6335,6 @@ msgstr "" msgid "No content to show" msgstr "" -#: app/controllers/channels_twitter_controller.rb -msgid "No crc_token in verify payload from twitter!" -msgstr "" - #: app/controllers/users_controller.rb msgid "No email!" msgstr "" @@ -6315,14 +6343,6 @@ msgstr "" msgid "No entries found in selected folder(s)." msgstr "" -#: app/controllers/channels_twitter_controller.rb -msgid "No external_credential in cache!" -msgstr "" - -#: app/controllers/channels_twitter_controller.rb -msgid "No external_credential[:consumer_secret] in cache!" -msgstr "" - #: lib/external_credential/facebook.rb msgid "No facebook app configured!" msgstr "" @@ -6409,38 +6429,6 @@ msgstr "" msgid "No source data submitted!" msgstr "" -#: app/controllers/reports_controller.rb -msgid "No such active profile" -msgstr "" - -#: app/controllers/reports_controller.rb -msgid "No such downloadBackendSelected param" -msgstr "" - -#: app/controllers/channels_twitter_controller.rb -msgid "No such external_credential 'twitter'!" -msgstr "" - -#: app/controllers/links_controller.rb -msgid "No such object!" -msgstr "" - -#: app/controllers/reports_controller.rb -msgid "No such profiles param" -msgstr "" - -#: lib/static_assets.rb -msgid "No such raw logo!" -msgstr "" - -#: app/controllers/tickets_controller.rb -msgid "No such source ticket!" -msgstr "" - -#: app/controllers/tickets_controller.rb -msgid "No such target ticket number!" -msgstr "" - #: app/assets/javascripts/app/views/widget/template.jst.eco msgid "No template created yet." msgstr "" @@ -7154,6 +7142,10 @@ msgstr "" msgid "Please enable execution_time feature to use it (currently only allowed for triggers and schedulers)" msgstr "" +#: app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee +msgid "Please enter a text." +msgstr "" + #: app/models/knowledge_base.rb msgid "Please enter valid path or domain" msgstr "" @@ -7166,10 +7158,6 @@ msgstr "" msgid "Please execute database changes only in a maintenance time-slot." msgstr "" -#: app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee -msgid "Please fill also some text in!" -msgstr "" - #: app/assets/javascripts/app/controllers/knowledge_base/public_menu_form_item.coffee msgid "Please fill in all fields" msgstr "" @@ -7560,6 +7548,18 @@ msgstr "" msgid "Requesting the Grant" msgstr "" +#: app/controllers/channels_twitter_controller.rb +msgid "Required parameter 'crc_token' missing in verify payload from twitter!" +msgstr "" + +#: app/controllers/reports_controller.rb +msgid "Required parameter 'downloadBackendSelected' is missing." +msgstr "" + +#: app/controllers/reports_controller.rb +msgid "Required parameter 'profile' is missing." +msgstr "" + #: app/assets/javascripts/app/views/channel/chat.jst.eco #: app/assets/javascripts/app/views/channel/form.jst.eco msgid "Requirements" @@ -9057,7 +9057,7 @@ msgid "Ticket %s created!" msgstr "" #: app/assets/javascripts/app/controllers/agent_ticket_merge.coffee -msgid "Ticket %s merged!" +msgid "Ticket %s merged." msgstr "" #: app/models/report.rb diff --git a/lib/static_assets.rb b/lib/static_assets.rb index 49df3891f..3d63c40e8 100644 --- a/lib/static_assets.rb +++ b/lib/static_assets.rb @@ -74,7 +74,7 @@ returns return Store.find(list[0]) end - raise __('No such raw logo!') + raise __('Could not read raw logo!') end =begin diff --git a/spec/requests/ticket_spec.rb b/spec/requests/ticket_spec.rb index b889cd043..cf36284f8 100644 --- a/spec/requests/ticket_spec.rb +++ b/spec/requests/ticket_spec.rb @@ -2031,7 +2031,7 @@ RSpec.describe 'Ticket', type: :request do expect(response).to have_http_status(:ok) expect(json_response).to be_a_kind_of(Hash) expect(json_response['result']).to eq('failed') - expect(json_response['message']).to eq('No such target ticket number!') + expect(json_response['message']).to eq('Could not find target ticket number!') put "/api/v1/ticket_merge/#{ticket3.id}/#{ticket1.number}", params: {}, as: :json expect(response).to have_http_status(:forbidden)