- Notifications
You must be signed in to change notification settings - Fork 452
♿(frontend) inject language attribute to pdf export #1235
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
Conversation
Add a note in the changelog to document frontend accessibility improvements Signed-off-by: Cyril <c.gromoff@gmail.com>
31d2c65 to aa70700 Compare Add a note in the changelog to document frontend accessibility improvements Signed-off-by: Cyril <c.gromoff@gmail.com>
aa70700 to f202cc7 Compare There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a bit hard to know if this dev is working, can you add a test e2e about it ?
Tests about export are located here: https://github.com/suitenumerique/docs/blob/main/src/frontend/apps/e2e/__tests__/app-impress/doc-export.spec.ts
If you do that you can see somewhere the informations:
const pdfBuffer = await cs.toBuffer(await download.createReadStream()); const pdfString = pdfBuffer.toString('latin1'); console.log("pdfString", pdfString);I am wondering if we should not do the same about docx export, WDYT ?
src/frontend/apps/impress/src/features/docs/doc-export/components/ModalExport.tsx Outdated Show resolved Hide resolved
I agree yes, I am on it for the e2e, and for the doc export I think it is a good idea yes to make sure it also works properly and isn’t missing anything ! |
| @AntoLC the e2e test for language injection has been added. Would you like me to create the other test for the DOCX export in this PR as well ? |
ab06646 to a3150ed Compare
If this PR is ready, let's do it in another PR for DOCX. |
Yes this PR is ready, Ok I will do an another one, the goal is to test Injection language in DOCX export right ? |
a3150ed to 5a3e3b3 Compare src/frontend/apps/impress/src/features/docs/doc-export/components/ModalExport.tsx Outdated Show resolved Hide resolved
bf9ee00 to 4cf487b Compare 4cf487b to 417caa4 Compare 04aaf54 to 937bf02 Compare 937bf02 to 7813219 Compare added language="fr-FR" to <Document /> in ModalExport.tsx via cloneElement() to improve accessibility and ensure correct screen reader pronunciation Signed-off-by: Cyril <c.gromoff@gmail.com>
Adds an end-to-end test to verify language injection in the generated PDF. Signed-off-by: Cyril <c.gromoff@gmail.com>
| Thank you Cyril! @Ovgodd |


Purpose
This PR improves the accessibility of exported PDF documents by explicitly setting the document language to fr-FR as suggested in the issue 1133
This ensures proper pronunciation by screen readers (e.g. VoiceOver, NVDA), especially for homographs like “mobile” that differ between French and English.
Proposal
External contributions
Thank you for your contribution! 🎉
Please ensure the following items are checked before submitting your pull request:
git commit --signoff(DCO compliance)git commit -S)<gitmoji>(type) title description## [Unreleased]section (if noticeable change)