From: Tom Hughes Date: Sat, 7 Jan 2023 15:39:27 +0000 (+0000) Subject: Make error pages translatable X-Git-Tag: live~951 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/152e524002d17d72cb9bd9bdfc6b2b7d7254171d?ds=sidebyside Make error pages translatable Fixes #3877 --- diff --git a/app/views/errors/_contact.html.erb b/app/views/errors/_contact.html.erb new file mode 100644 index 000000000..4fe4e7968 --- /dev/null +++ b/app/views/errors/_contact.html.erb @@ -0,0 +1,3 @@ +

<%= t ".contact_the_community_html", + :contact_link => link_to(t(".contact"), t(".contact_url"), + :title => t(".contact_url_title")) %>

diff --git a/app/views/errors/forbidden.html.erb b/app/views/errors/forbidden.html.erb index 6901ec1d5..036517bdd 100644 --- a/app/views/errors/forbidden.html.erb +++ b/app/views/errors/forbidden.html.erb @@ -1,3 +1,3 @@ -

Forbidden

-

The operation you requested on the OpenStreetMap server is only available to administrators (HTTP 403)

-

Feel free to contact the OpenStreetMap community if you have found a broken link / bug. Make a note of the exact URL of your request.

+

<%= t ".title" %>

+

<%= t ".description" %>

+<%= render :partial => "contact" %> diff --git a/app/views/errors/internal_server_error.html.erb b/app/views/errors/internal_server_error.html.erb index a2b1ba6f7..036517bdd 100644 --- a/app/views/errors/internal_server_error.html.erb +++ b/app/views/errors/internal_server_error.html.erb @@ -1,4 +1,3 @@ -

Application error

-

The OpenStreetMap server encountered an unexpected condition that prevented it from fulfilling the request (HTTP 500)

-

Feel free to contact the OpenStreetMap community if your problem persists. Make a note of the exact URL / post data of your request.

-

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)

+

<%= t ".title" %>

+

<%= t ".description" %>

+<%= render :partial => "contact" %> diff --git a/app/views/errors/not_found.html.erb b/app/views/errors/not_found.html.erb index bf4744b5a..036517bdd 100644 --- a/app/views/errors/not_found.html.erb +++ b/app/views/errors/not_found.html.erb @@ -1,3 +1,3 @@ -

File not found

-

Couldn't find a file/directory/API operation by that name on the OpenStreetMap server (HTTP 404)

-

Feel free to contact the OpenStreetMap community if you have found a broken link / bug. Make a note of the exact URL of your request.

+

<%= t ".title" %>

+

<%= t ".description" %>

+<%= render :partial => "contact" %> diff --git a/config/locales/en.yml b/config/locales/en.yml index dbc5272c5..6b65a5cf4 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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?"