Skip to content

Commit

Permalink
Make error pages translatable
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Jan 9, 2023
1 parent a4bab94 commit 152e524
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 10 deletions.
3 changes: 3 additions & 0 deletions app/views/errors/_contact.html.erb
@@ -0,0 +1,3 @@
<p><%= t ".contact_the_community_html",
:contact_link => link_to(t(".contact"), t(".contact_url"),
:title => t(".contact_url_title")) %></p>
6 changes: 3 additions & 3 deletions app/views/errors/forbidden.html.erb
@@ -1,3 +1,3 @@
<h1>Forbidden</h1>
<p>The operation you requested on the OpenStreetMap server is only available to administrators (HTTP 403)</p>
<p>Feel free to <a href="http://wiki.openstreetmap.org/wiki/Contact" title="Various contact channels explained">contact</a> the OpenStreetMap community if you have found a broken link / bug. Make a note of the exact URL of your request.</p>
<h1><%= t ".title" %></h1>
<p><%= t ".description" %></p>
<%= render :partial => "contact" %>
7 changes: 3 additions & 4 deletions app/views/errors/internal_server_error.html.erb
@@ -1,4 +1,3 @@
<h1>Application error</h1>
<p>The OpenStreetMap server encountered an unexpected condition that prevented it from fulfilling the request (HTTP 500)</p>
<p>Feel free to <a href="http://wiki.openstreetmap.org/wiki/Contact" title="Various contact channels explained">contact</a> the OpenStreetMap community if your problem persists. Make a note of the exact URL / post data of your request.</p>
<p>This may be a problem in our Ruby On Rails code. 500 occurs with exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code)</p>
<h1><%= t ".title" %></h1>
<p><%= t ".description" %></p>
<%= render :partial => "contact" %>
6 changes: 3 additions & 3 deletions app/views/errors/not_found.html.erb
@@ -1,3 +1,3 @@
<h1>File not found</h1>
<p>Couldn't find a file/directory/API operation by that name on the OpenStreetMap server (HTTP 404)</p>
<p>Feel free to <a href="http://wiki.openstreetmap.org/wiki/Contact" title="Various contact channels explained">contact</a> the OpenStreetMap community if you have found a broken link / bug. Make a note of the exact URL of your request.</p>
<h1><%= t ".title" %></h1>
<p><%= t ".description" %></p>
<%= render :partial => "contact" %>
15 changes: 15 additions & 0 deletions config/locales/en.yml
Expand Up @@ -573,6 +573,21 @@ en:
applications:
create:
notice: Application Registered.
errors:
contact:
contact_url: https://wiki.openstreetmap.org/wiki/Contact
contact_url_title: Various contact channels explained
contact: contact
contact_the_community_html: Feel free to %{contact_link} the OpenStreetMap community if you have found a broken link / bug. Make a note of the exact URL of your request.
forbidden:
title: Forbidden
description: The operation you requested on the OpenStreetMap server is only available to administrators (HTTP 403)
internal_server_error:
title: Application error
description: The OpenStreetMap server encountered an unexpected condition that prevented it from fulfilling the request (HTTP 500)
not_found:
title: File not found
description: Couldn't find a file/directory/API operation by that name on the OpenStreetMap server (HTTP 404)
friendships:
make_friend:
heading: "Add %{user} as a friend?"
Expand Down

0 comments on commit 152e524

Please sign in to comment.