question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Language changes not available to assistive technologies

See original GitHub issue

Attach (recommended) or Link to PDF file here: test-lang.pdf The default language in this document is english. But the document contains 2 language changes.

Configuration:

  • Web browser and its version: Firefox 93.0
  • Operating system and its version: Windows 10 Version 1909 Build 18363.1256
  • PDF.js version: from the master branch
  • Is a browser extension: no
  • Screen reader: NVDA 2021.2
  • OS language: english

Steps to reproduce the problem:

  1. Open the file in PDF.js
  2. Read the file with NVDA
  3. The text in French is read with an English voice (in Acrobat, the text in French is read with a French voice)

What is the expected behavior? (add screenshot) French text should be read with a French voice.

In this PDF document, the content in French is made of two tags, one H1 and one P. These two tags have the property Language set to “French”. This info should be available as a lang attribute in the DOM set to “French”, so that screen readers like NVDA can select the correct language to read this text. screen shot of a language change in Acrobat Pro

What went wrong? (add screenshot) Here the only lang attribute we have in the DOM is the one of the default language. We should find 2 others, one for the title in French and one for the paragraph in French. Screenshot of the dev tools showing only one alt attribute

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension): /

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
AlainVagnercommented, Nov 11, 2021

Just in case it could help, I have made a small test case for this issue: https://codepen.io/alainvagner/full/GRvBaBB

0reactions
jcstehcommented, Nov 22, 2021

That clarifies things. Relative to that, this should be easy enough to fix in Gecko. I just need to find the time to write the patch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding Success Criterion 3.1.2 - W3C
Marking changes in language can benefit future developments in technology, for example users who are unable to translate between languages themselves will be...
Read more >
Assistive technology testing in a foreign language
Some assistive technologies may automatically switch voice for the language being read, some may require specific language selection and / or downloads. Note, ......
Read more >
Human language markup: Web content - Accessibility
If the language of content is not specified, assistive technology will read the text in the language set in the visitor's operating system....
Read more >
Missing Language Declaration - Equalize Digital
Language declarations are available to search engines and assistive technology but are not visible on the page. Here is what a language declaration...
Read more >
DEV 1.9 – Specify the default language of the page and any ...
Browsers and assistive technology can reference metadata to communicate information about ... Specifying the language of a page, and any change of language, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found