diff --git a/app/controllers/ajax/smile_controller.rb b/app/controllers/ajax/smile_controller.rb index 4ff67eaf..227b1d9c 100644 --- a/app/controllers/ajax/smile_controller.rb +++ b/app/controllers/ajax/smile_controller.rb @@ -13,12 +13,12 @@ class Ajax::SmileController < AjaxController rescue => e Sentry.capture_exception(e) @response[:status] = :fail - @response[:message] = I18n.t('messages.smile.create.fail') + @response[:message] = t(".error") return end @response[:status] = :okay - @response[:message] = I18n.t('messages.smile.create.okay') + @response[:message] = t(".success") @response[:success] = true end @@ -32,12 +32,12 @@ class Ajax::SmileController < AjaxController rescue => e Sentry.capture_exception(e) @response[:status] = :fail - @response[:message] = I18n.t('messages.smile.destroy.fail') + @response[:message] = t(".error") return end @response[:status] = :okay - @response[:message] = I18n.t('messages.smile.destroy.okay') + @response[:message] = t(".success") @response[:success] = true end @@ -55,12 +55,12 @@ class Ajax::SmileController < AjaxController rescue => e Sentry.capture_exception(e) @response[:status] = :fail - @response[:message] = I18n.t('messages.smile.create_comment.fail') + @response[:message] = t(".error") return end @response[:status] = :okay - @response[:message] = I18n.t('messages.smile.create_comment.okay') + @response[:message] = t(".success") @response[:success] = true end @@ -74,12 +74,12 @@ class Ajax::SmileController < AjaxController rescue => e Sentry.capture_exception(e) @response[:status] = :fail - @response[:message] = I18n.t('messages.smile.destroy_comment.fail') + @response[:message] = t(".error") return end @response[:status] = :okay - @response[:message] = I18n.t('messages.smile.destroy_comment.okay') + @response[:message] = t(".success") @response[:success] = true end end diff --git a/config/locales/controllers.en.yml b/config/locales/controllers.en.yml index a62d40ef..60025c63 100644 --- a/config/locales/controllers.en.yml +++ b/config/locales/controllers.en.yml @@ -34,6 +34,19 @@ en: follow: success: "Successfully unfollowed user." error: "You are not following that user." + smile: + create: + success: "Successfully smiled answer." + error: "You have already smiled that answer." + create_comment: + success: "Successfully smiled comment." + error: "You have already smiled that comment." + destroy: + success: "Successfully unsmiled answer." + error: "You have not smiled that answer." + destroy_comment: + success: "Successfully unsmiled comment." + error: "You have not smiled that comment." announcement: create: success: "Announcement created successfully." diff --git a/config/locales/en.yml b/config/locales/en.yml index 2729b306..ef1787b5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -135,19 +135,6 @@ en: unknown: "unknown type" not_found: "Could not find %{parameter}" okay: "%{parameter} reported. A moderator will decide what happens with the %{parameter}." - smile: - create: - fail: "You have already smiled that answer." - okay: "Successfully smiled answer." - destroy: - fail: "You have not smiled that answer." - okay: "Successfully unsmiled answer." - create_comment: - fail: "You have already smiled that comment." - okay: "Successfully smiled comment." - destroy_comment: - fail: "You have not smiled that comment." - okay: "Successfully unsmiled comment." subscription: torpedo: "418 I'm a torpedo" views: