Skip to content

Commit

Permalink
AO3-6911: prefer double quotes, add i18n support
Browse files Browse the repository at this point in the history
  • Loading branch information
boyer-victor committed Feb 21, 2025
1 parent c420089 commit 165261d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def raise_not_found
rescue_from Rack::Timeout::RequestTimeoutException, with: :raise_timeout

def raise_timeout
redirect_to '/timeout'
redirect_to "/timeout"
end

helper :all # include all helpers, all the time
Expand Down
5 changes: 3 additions & 2 deletions app/views/errors/timeout.html.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<h3 class="heading">The page was responding too slowly. Please try again after a few minutes.</h3>
<p>If you still get this error after a few tries, you can <%= link_to ts('contact Support'), new_feedback_report_path %>. In the form, please include a link to the page you're trying to reach and what action you are taking.</p>
<h2 class="heading"><%= t("errors.timeout.title") %></h2>
<h3 class="heading"><%= t("errors.timeout.subtitle") %></h3>
<p><%= t("errors.timeout.html", contact_support_link: link_to(ts("contact Support"), new_feedback_report_path)) %></p>

Check failure on line 3 in app/views/errors/timeout.html.erb

View workflow job for this annotation

GitHub Actions / ERB Lint runner

[] reported by reviewdog 🐶 Missing a trailing newline at the end of the file. Raw Output: app/views/errors/timeout.html.erb:3:118: Missing a trailing newline at the end of the file.

Check failure on line 3 in app/views/errors/timeout.html.erb

View workflow job for this annotation

GitHub Actions / ERB Lint runner

[] reported by reviewdog 🐶 I18n/DeprecatedHelper: Prefer Rails built-in `t` helper over `ts` and move the text into the yml file. `ts` is not actually translatable. For more information, refer to https://github.com/otwcode/otwarchive/wiki/Internationalization-(i18n)-Standards Raw Output: app/views/errors/timeout.html.erb:3:62: I18n/DeprecatedHelper: Prefer Rails built-in `t` helper over `ts` and move the text into the yml file. `ts` is not actually translatable. For more information, refer to https://github.com/otwcode/otwarchive/wiki/Internationalization-(i18n)-Standards
5 changes: 5 additions & 0 deletions config/locales/views/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,11 @@ en:
restricted_html: A translation of [Restricted Work] by %{creator_link}
revealed_html: A translation of %{work_link} by %{creator_link}
unrevealed: A translation of a work in an unrevealed collection
errors:
timeout:
title: Timeout
subtitle: The page was responding too slowly. Please try again after a few minutes.
html: If you still get this error after a few tries, please %{contact_support_link}.
feedbacks:
new:
abuse:
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
get '/422', to: 'errors#422'
get '/500', to: 'errors#500'
get '/auth_error', to: 'errors#auth_error'
get '/timeout', to: 'errors#timeout'
get "/timeout", to: "errors#timeout"

#### DOWNLOADS ####

Expand Down

0 comments on commit 165261d

Please sign in to comment.