Open links to social networks in the same window

As mentioned in earlier commits, opening external links in a new
tab/window results in usability and accessibility issues.

Since these links are usually at the top or bottom of the page and
contain icons of well-known sites, IMHO there's no need to even notify
people that these are external links.

Since we're no longer using the `shared.target_blank` translation inside
a sentence, we can remove the space and parenthesis in the translations.
This commit is contained in:
Javi Martín
2023-10-15 16:47:53 +02:00
parent 44f4bdf772
commit 56d834783c
5 changed files with 5 additions and 5 deletions

View File

@@ -2,7 +2,7 @@
<ul>
<% sites.each do |name, url| %>
<li>
<%= link_to "#{url}/#{setting["#{name}_handle"]}", target: "_blank", title: link_title(name) do %>
<%= link_to "#{url}/#{setting["#{name}_handle"]}", title: link_title(name) do %>
<span class="show-for-sr"><%= link_text(name) %></span>
<span class="icon-<%= name %>" aria-hidden="true"></span>
<% end %>

View File

@@ -18,7 +18,7 @@ class Layout::SocialComponent < ApplicationComponent
end
def link_title(site_name)
t("shared.go_to_page") + link_text(site_name) + t("shared.target_blank")
t("shared.go_to_page") + link_text(site_name)
end
def link_text(site_name)

View File

@@ -719,7 +719,7 @@ en:
districts: "Districts"
districts_list: "Districts list"
categories: "Categories"
target_blank: " (link opens in new window)"
target_blank: "Link opens in new window"
you_are_in: "You are in"
unflag: Unflag
unfollow_entity: "Unfollow %{entity}"

View File

@@ -719,7 +719,7 @@ es:
districts: "Distritos"
districts_list: "Listado de distritos"
categories: "Categorías"
target_blank: " (se abre en ventana nueva)"
target_blank: "Se abre en ventana nueva"
you_are_in: "Estás en"
unflag: Deshacer denuncia
unfollow_entity: "Dejar de seguir %{entity}"

View File

@@ -25,6 +25,6 @@ describe Shared::AgreeWithTermsOfServiceFieldComponent do
expect(page).to have_link count: 2
expect(page).to have_link "Privacy Policy"
expect(page).to have_link "Terms and conditions of use"
expect(page).to have_link " (link opens in new window)", count: 2
expect(page).to have_link "Link opens in new window", count: 2
end
end