Просмотр исходного кода

Maintenance: Improved source string wording.

Martin Gruner 2 лет назад
Родитель
Сommit
a44d8f0756

+ 5 - 5
app/controllers/channels_sms_controller.rb

@@ -42,7 +42,7 @@ class ChannelsSmsController < ApplicationController
   end
 
   def test
-    raise __('Missing parameter options.adapter') if params[:options][:adapter].blank?
+    raise __("The required parameter 'options.adapter' is missing.") if params[:options][:adapter].blank?
 
     driver = Channel.driver_class(params[:options][:adapter])
     resp   = driver.new.send(params[:options], test_options)
@@ -86,12 +86,12 @@ class ChannelsSmsController < ApplicationController
   end
 
   def channel_params
-    raise __('Missing area params') if params[:area].blank?
+    raise __("The required parameter 'area' is missing.") if params[:area].blank?
     if ['Sms::Notification', 'Sms::Account'].exclude?(params[:area])
-      raise "Invalid area '#{params[:area]}'!"
+      raise "The parameter 'area' has the invalid value '#{params[:area]}'!"
     end
-    raise __('Missing options params') if params[:options].blank?
-    raise __('Missing options.adapter params') if params[:options][:adapter].blank?
+    raise __("The required parameter 'params' is missing.") if params[:options].blank?
+    raise __("The required parameter 'options.adapter' is missing.") if params[:options][:adapter].blank?
 
     params
   end

+ 2 - 2
app/controllers/sessions_controller.rb

@@ -26,8 +26,8 @@ class SessionsController < ApplicationController
       User.lookup(login: login&.downcase)
     end
 
-    raise Exceptions::NotAuthorized, __('Missing SSO ENV REMOTE_USER or X-Forwarded-User header') if login.blank?
-    raise Exceptions::NotAuthorized, "No such user '#{login}' found!" if user.blank?
+    raise Exceptions::NotAuthorized, __("Neither an SSO environment variable 'REMOTE_USER' nor a 'X-Forwarded-User' header could be found.") if login.blank?
+    raise Exceptions::NotAuthorized, "Uuser '#{login}' could not be found." if user.blank?
 
     session.delete(:switched_from_user_id)
     authentication_check_prerequesits(user, 'SSO', {})

+ 1 - 1
app/models/store/file.rb

@@ -26,7 +26,7 @@ do also verify of written data
         # load backend based on config
         adapter_name = Setting.get('storage_provider') || 'DB'
         if !adapter_name
-          raise __('Missing storage_provider setting option')
+          raise __("The setting 'storage_provider' was not configured.")
         end
 
         adapter = "Store::Provider::#{adapter_name}".constantize

+ 1 - 1
app/models/ticket/number.rb

@@ -43,6 +43,6 @@ returns
   # load backend based on config
   def self.adapter
     Setting.get('ticket_number')&.constantize ||
-      raise(__('Missing ticket_number setting option'))
+      raise(__("The setting 'ticket_number' was not configured."))
   end
 end

+ 58 - 62
i18n/zammad.pot

@@ -5906,38 +5906,10 @@ msgstr ""
 msgid "Missing 'for_user_id' in payload!"
 msgstr ""
 
-#: app/controllers/sessions_controller.rb
-msgid "Missing SSO ENV REMOTE_USER or X-Forwarded-User header"
-msgstr ""
-
 #: app/controllers/import_freshdesk_controller.rb
 msgid "Missing administrator permission!"
 msgstr ""
 
-#: app/controllers/channels_sms_controller.rb
-msgid "Missing area params"
-msgstr ""
-
-#: app/controllers/channels_sms_controller.rb
-msgid "Missing options params"
-msgstr ""
-
-#: app/controllers/channels_sms_controller.rb
-msgid "Missing options.adapter params"
-msgstr ""
-
-#: app/controllers/channels_sms_controller.rb
-msgid "Missing parameter options.adapter"
-msgstr ""
-
-#: app/models/store/file.rb
-msgid "Missing storage_provider setting option"
-msgstr ""
-
-#: app/models/ticket/number.rb
-msgid "Missing ticket_number setting option"
-msgstr ""
-
 #: db/seeds/object_manager_attributes.rb
 msgid "Mobile"
 msgstr ""
@@ -6174,6 +6146,10 @@ msgstr ""
 msgid "Needed"
 msgstr ""
 
+#: app/controllers/sessions_controller.rb
+msgid "Neither an SSO environment variable 'REMOTE_USER' nor a 'X-Forwarded-User' header could be found."
+msgstr ""
+
 #: app/assets/javascripts/app/controllers/_manage/system.coffee
 msgid "Network"
 msgstr ""
@@ -6373,14 +6349,6 @@ msgstr ""
 msgid "No answers"
 msgstr ""
 
-#: lib/external_credential/facebook.rb
-msgid "No application_id param!"
-msgstr ""
-
-#: lib/external_credential/facebook.rb
-msgid "No application_secret param!"
-msgstr ""
-
 #: app/assets/javascripts/app/controllers/_profile/avatar.coffee
 msgid "No camera found."
 msgstr ""
@@ -6389,16 +6357,6 @@ msgstr ""
 msgid "No categories"
 msgstr ""
 
-#: lib/external_credential/google.rb
-#: lib/external_credential/microsoft365.rb
-msgid "No client_id param!"
-msgstr ""
-
-#: lib/external_credential/google.rb
-#: lib/external_credential/microsoft365.rb
-msgid "No client_secret param!"
-msgstr ""
-
 #: lib/external_credential/google.rb
 #: lib/external_credential/microsoft365.rb
 msgid "No code for session found!"
@@ -6408,14 +6366,6 @@ msgstr ""
 msgid "No configured business hours found!"
 msgstr ""
 
-#: lib/external_credential/twitter.rb
-msgid "No consumer_key param!"
-msgstr ""
-
-#: lib/external_credential/twitter.rb
-msgid "No consumer_secret param!"
-msgstr ""
-
 #: app/views/knowledge_base/public/categories/index.html.erb
 #: app/views/knowledge_base/public/tags/show.html.erb
 msgid "No content to show"
@@ -6442,14 +6392,6 @@ msgstr ""
 msgid "No linked issues"
 msgstr ""
 
-#: lib/external_credential/twitter.rb
-msgid "No oauth_token param!"
-msgstr ""
-
-#: lib/external_credential/twitter.rb
-msgid "No oauth_token_secret param!"
-msgstr ""
-
 #: app/assets/javascripts/app/views/settings/proxy.jst.eco
 #: db/seeds/settings.rb
 msgid "No proxy for the following hosts."
@@ -8981,6 +8923,36 @@ msgstr ""
 msgid "The required field 'endpoint' is missing from the config."
 msgstr ""
 
+#: lib/external_credential/facebook.rb
+msgid "The required parameter 'application_id' is missing."
+msgstr ""
+
+#: lib/external_credential/facebook.rb
+msgid "The required parameter 'application_secret' is missing."
+msgstr ""
+
+#: app/controllers/channels_sms_controller.rb
+msgid "The required parameter 'area' is missing."
+msgstr ""
+
+#: lib/external_credential/google.rb
+#: lib/external_credential/microsoft365.rb
+msgid "The required parameter 'client_id' is missing."
+msgstr ""
+
+#: lib/external_credential/google.rb
+#: lib/external_credential/microsoft365.rb
+msgid "The required parameter 'client_secret' is missing."
+msgstr ""
+
+#: lib/external_credential/twitter.rb
+msgid "The required parameter 'consumer_key' is missing."
+msgstr ""
+
+#: lib/external_credential/twitter.rb
+msgid "The required parameter 'consumer_secret' is missing."
+msgstr ""
+
 #: app/controllers/channels_twitter_controller.rb
 msgid "The required parameter 'crc_token' is missing from the Twitter verify payload!"
 msgstr ""
@@ -8993,6 +8965,22 @@ msgstr ""
 msgid "The required parameter 'id' is missing."
 msgstr ""
 
+#: lib/external_credential/twitter.rb
+msgid "The required parameter 'oauth_token' is missing."
+msgstr ""
+
+#: lib/external_credential/twitter.rb
+msgid "The required parameter 'oauth_token_secret' is missing."
+msgstr ""
+
+#: app/controllers/channels_sms_controller.rb
+msgid "The required parameter 'options.adapter' is missing."
+msgstr ""
+
+#: app/controllers/channels_sms_controller.rb
+msgid "The required parameter 'params' is missing."
+msgstr ""
+
 #: app/models/core_workflow/result.rb
 msgid "The required parameter 'payload->class_name' is missing."
 msgstr ""
@@ -9018,6 +9006,14 @@ msgstr ""
 msgid "The server settings could not be automatically detected. Please configure them manually."
 msgstr ""
 
+#: app/models/store/file.rb
+msgid "The setting 'storage_provider' was not configured."
+msgstr ""
+
+#: app/models/ticket/number.rb
+msgid "The setting 'ticket_number' was not configured."
+msgstr ""
+
 #: app/assets/javascripts/app/controllers/getting_started/admin.coffee
 msgid "The sign-in failed. Please contact the Support team."
 msgstr ""

+ 2 - 2
lib/external_credential/facebook.rb

@@ -20,8 +20,8 @@ class ExternalCredential::Facebook
       end
     end
 
-    raise Exceptions::UnprocessableEntity, __('No application_id param!') if credentials[:application_id].blank?
-    raise Exceptions::UnprocessableEntity, __('No application_secret param!') if credentials[:application_secret].blank?
+    raise Exceptions::UnprocessableEntity, __("The required parameter 'application_id' is missing.") if credentials[:application_id].blank?
+    raise Exceptions::UnprocessableEntity, __("The required parameter 'application_secret' is missing.") if credentials[:application_secret].blank?
 
     oauth = Koala::Facebook::OAuth.new(
       credentials[:application_id],

+ 2 - 2
lib/external_credential/google.rb

@@ -20,8 +20,8 @@ class ExternalCredential::Google
       end
     end
 
-    raise Exceptions::UnprocessableEntity, __('No client_id param!') if credentials[:client_id].blank?
-    raise Exceptions::UnprocessableEntity, __('No client_secret param!') if credentials[:client_secret].blank?
+    raise Exceptions::UnprocessableEntity, __("The required parameter 'client_id' is missing.") if credentials[:client_id].blank?
+    raise Exceptions::UnprocessableEntity, __("The required parameter 'client_secret' is missing.") if credentials[:client_secret].blank?
 
     authorize_url = generate_authorize_url(credentials[:client_id])
 

+ 2 - 2
lib/external_credential/microsoft365.rb

@@ -24,8 +24,8 @@ class ExternalCredential::Microsoft365
       end
     end
 
-    raise Exceptions::UnprocessableEntity, __('No client_id param!') if credentials[:client_id].blank?
-    raise Exceptions::UnprocessableEntity, __('No client_secret param!') if credentials[:client_secret].blank?
+    raise Exceptions::UnprocessableEntity, __("The required parameter 'client_id' is missing.") if credentials[:client_id].blank?
+    raise Exceptions::UnprocessableEntity, __("The required parameter 'client_secret' is missing.") if credentials[:client_secret].blank?
 
     authorize_url = generate_authorize_url(credentials)
 

+ 6 - 6
lib/external_credential/twitter.rb

@@ -19,8 +19,8 @@ class ExternalCredential::Twitter
       end
     end
 
-    raise Exceptions::UnprocessableEntity, __('No consumer_key param!') if credentials[:consumer_key].blank?
-    raise Exceptions::UnprocessableEntity, __('No consumer_secret param!') if credentials[:consumer_secret].blank?
+    raise Exceptions::UnprocessableEntity, __("The required parameter 'consumer_key' is missing.") if credentials[:consumer_key].blank?
+    raise Exceptions::UnprocessableEntity, __("The required parameter 'consumer_secret' is missing.") if credentials[:consumer_secret].blank?
 
     consumer = OAuth::Consumer.new(
       credentials[:consumer_key],
@@ -132,10 +132,10 @@ class ExternalCredential::Twitter
   def self.register_webhook(params)
     request_account_to_link(params, false)
 
-    raise Exceptions::UnprocessableEntity, __('No consumer_key param!') if params[:consumer_key].blank?
-    raise Exceptions::UnprocessableEntity, __('No consumer_secret param!') if params[:consumer_secret].blank?
-    raise Exceptions::UnprocessableEntity, __('No oauth_token param!') if params[:oauth_token].blank?
-    raise Exceptions::UnprocessableEntity, __('No oauth_token_secret param!') if params[:oauth_token_secret].blank?
+    raise Exceptions::UnprocessableEntity, __("The required parameter 'consumer_key' is missing.") if params[:consumer_key].blank?
+    raise Exceptions::UnprocessableEntity, __("The required parameter 'consumer_secret' is missing.") if params[:consumer_secret].blank?
+    raise Exceptions::UnprocessableEntity, __("The required parameter 'oauth_token' is missing.") if params[:oauth_token].blank?
+    raise Exceptions::UnprocessableEntity, __("The required parameter 'oauth_token_secret' is missing.") if params[:oauth_token_secret].blank?
 
     return if params[:env].blank?
 

+ 2 - 2
spec/lib/external_credential/google_spec.rb

@@ -348,7 +348,7 @@ RSpec.describe ExternalCredential::Google do
           }
         end
         let(:app_required) { false }
-        let(:exception_message) { 'No client_id param!' }
+        let(:exception_message) { "The required parameter 'client_id' is missing." }
 
         include_examples 'failed attempt'
       end
@@ -360,7 +360,7 @@ RSpec.describe ExternalCredential::Google do
           }
         end
         let(:app_required) { false }
-        let(:exception_message) { 'No client_secret param!' }
+        let(:exception_message) { "The required parameter 'client_secret' is missing." }
 
         include_examples 'failed attempt'
       end

Некоторые файлы не были показаны из-за большого количества измененных файлов