Skip to content

Commit

Permalink
Localize 'throttled' (mastodon#2755)
Browse files Browse the repository at this point in the history
  • Loading branch information
alpaca-tc authored and Gargron committed May 3, 2017
1 parent 4496930 commit db92eec
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/i18n-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ ignore_unused:
- 'simple_form.{error_notification,required}.:'
- 'errors.messages.*'
- 'activerecord.errors.models.doorkeeper/*'
- 'errors.429'
2 changes: 1 addition & 1 deletion config/initializers/rack_attack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ class Rack::Attack
'X-RateLimit-Reset' => (now + (match_data[:period] - now.to_i % match_data[:period])).iso8601(6),
}

[429, headers, [{ error: 'Throttled' }.to_json]]
[429, headers, [{ error: I18n.t('errors.429') }.to_json]]
end
end
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ en:
'422':
content: Security verification failed. Are you blocking cookies?
title: Security verification failed
'429': Throttled
exports:
blocks: You block
csv: CSV
Expand Down
1 change: 1 addition & 0 deletions config/locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ ja:
'422':
content: セキュリティ認証に失敗しました。Cookieをブロックしていませんか?
title: セキュリティ認証に失敗
'429': リクエストの制限に達しました。
exports:
blocks: ブロック
csv: CSV
Expand Down

0 comments on commit db92eec

Please sign in to comment.