]> source.dussan.org Git - redmine.git/commitdiff
Fix hard-coded error messages in ApplicationController (#33232).
authorGo MAEDA <maeda@farend.jp>
Thu, 25 Mar 2021 04:39:18 +0000 (04:39 +0000)
committerGo MAEDA <maeda@farend.jp>
Thu, 25 Mar 2021 04:39:18 +0000 (04:39 +0000)
Contributed by Kam Nazir.

git-svn-id: http://svn.redmine.org/redmine/trunk@20843 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/application_controller.rb
config/locales/en.yml

index 7750120d756311087ac2f5dd270f18eb8c546916..d382421ae8b44aab3996d0351e76b85158010220 100644 (file)
@@ -52,7 +52,7 @@ class ApplicationController < ActionController::Base
       cookies.delete(autologin_cookie_name)
       self.logged_user = nil
       set_localization
-      render_error :status => 422, :message => "Invalid form authenticity token."
+      render_error :status => 422, :message => l(:error_invalid_authenticity_token)
     end
   end
 
@@ -722,7 +722,7 @@ class ApplicationController < ActionController::Base
   def query_statement_invalid(exception)
     logger.error "Query::StatementInvalid: #{exception.message}" if logger
     session.delete(:issue_query)
-    render_error "An error occurred while executing the query and has been logged. Please report this error to your Redmine administrator."
+    render_error l(:error_query_statement_invalid)
   end
 
   # Renders a 204 response for successful updates or deletions via the API
index 2ff0ae432a83814da1eacec023a0e3324a8a5dc1..9d779a2fe08ea7e9e3df22f83af4c6cc04232ac8 100644 (file)
@@ -242,6 +242,8 @@ en:
   error_filename_required: "Filename required"
   error_invalid_size_parameter: "Invalid size parameter"
   error_attachment_not_found: "Attachment %{name} not found"
+  error_invalid_authenticity_token: "Invalid form authenticity token."
+  error_query_statement_invalid: "An error occurred while executing the query and has been logged. Please report this error to your Redmine administrator."
 
   mail_subject_lost_password: "Your %{value} password"
   mail_body_lost_password: 'To change your password, click on the following link:'