Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When adding a link that opens in a new tab, the screen reader text does not honor the site language #18727

Open
MarcoZehe opened this issue Nov 25, 2019 · 6 comments
Labels
Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Bug An existing feature does not function as intended

Comments

@MarcoZehe
Copy link
Contributor

Describe the bug
When publishing an article to a site whose language is different to the current WordPress UI language, and inserting a link that opens in a new tab, the additional screen reader text " (opens in a new tab)" is appended to the aria-label in the language WordPress is set to, not the language of the specific site the article is being published at. So if my WP user interface is German, but the particular site is in English, the text gets added in German, but should be in English.

To reproduce
Steps to reproduce the behavior:

  1. I am on wordpress.com, which is set to German (my native tongue). I have a site there whose language is in English.
  2. Start a new post.
  3. In a paragraph block, insert a link, expand the Link Options and check the Opens In A New Tab checkbox.
  4. Check the resulting HTML for the link.

Expected behavior
The aria-label that contains both the link text and the addition of " (opens in a new tab)" should have that extra text in English, which is the site's language. But it actually is in German, which is the language WP is currently running in.

Screenshots
I'm blind, screenshots are difficult.

Desktop (please complete the following information):

  • OS: Windows 10.
  • Browser Firefox.
  • Version 70.0.1

Additional context
Screen readers usually read the text of a page in a given language, in this case, English. Hearing the German equivalent of " (opens in a new tab)", " (öffnet in neuem Tab)", is unexpected and meaningless to someone not speaking German. It should be in the language the actual article text is in, which is usually determined by the setting for the Site Language under Manage/General, or Site Identity in the Customizer.

@ryelle
Copy link
Contributor

ryelle commented Nov 26, 2019

Just adding a note that I can reproduce this unexpected behavior on a non wp.com site too – by setting my user's language to a different language than the site's language. The content added by the "open in a new window" toggle is translated into the language I'm seeing when editing the post, which might not be the language used in the post.

@afercia afercia added [Type] Bug An existing feature does not function as intended Internationalization (i18n) Issues or PRs related to internationalization efforts labels Nov 26, 2019
@afercia
Copy link
Contributor

afercia commented Nov 26, 2019

Just reproduced on trunk as well.

Site language: English
User language: French

Resulting markup:

aria-label="link within English text (s’ouvre dans un nouvel onglet)"

Looks like the appended text is translated based on the user language. Instead, it should be based on the site language.

Also: this highlights a problem related to the user interface. The text gets appended and stored in the post content but content authors may not be aware of it. The UI should should display this text in some way and give the ability to change it. Also wondering what happens with multi-lingual plugins that usually work by duplicating the post content in the original language. For example, users would get a post originally written in English to translate to French. They can translate the text they can see in the UI. Not sure how they're supposed to translate text that can't be seen (unless they know how the appended text works).

@swissspidy
Copy link
Member

Why not add the screen reader text dynamically in PHP? That would solve this issue.

@afercia
Copy link
Contributor

afercia commented Nov 26, 2019

Why not add the screen reader text dynamically in PHP? That would solve this issue.

Related: #12325 (comment) 🤷‍♂

@talldan
Copy link
Contributor

talldan commented Jul 24, 2024

Is this still an issue? I tested just now and it looks like the extra text is no longer appended. Let me know if I'm missing some aspect of the reproduction steps.

@afercia
Copy link
Contributor

afercia commented Jul 24, 2024

it looks like the extra text is no longer appended

I can't remember why and when it was removed. Any clue?
It was added long time ago in #1105 / #7883 Cc @joedolson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

5 participants