Skip to content

Set HTML lang attribute for documentation#13133

Closed
bramd wants to merge 2 commits into
nvaccess:masterfrom
bramd:i8856
Closed

Set HTML lang attribute for documentation#13133
bramd wants to merge 2 commits into
nvaccess:masterfrom
bramd:i8856

Conversation

@bramd

@bramd bramd commented Dec 4, 2021

Copy link
Copy Markdown
Contributor

Link to issue number:

Closes #8856

Summary of the issue:

The generated HTML from t2t (changes, quick reference, user guide) has no lang attribute set. So, it will not read in the correct TTS language.

Description of how this pull request fixes the issue:

Include a locale.t2tconfig for every language to set the lang attribute and ensure it is included in all documents.

Testing strategy:

Opened a few generated HTML documents and ensured the lang attribute was present and set correctly.

Known issues with pull request:

Some languages may need RTL (right to left) as a reading direction which would require the dir="rtl" attribute as well. However, at least setting lang will improve things and not break anything.

Change log entries:

New features
Changes
Bug fixes

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English

@bramd bramd requested review from a team as code owners December 4, 2021 15:49
@lukaszgo1

Copy link
Copy Markdown
Contributor

Some languages may need RTL (right to left) as a reading direction which would require the dir="rtl" attribute as well. However, at least setting lang will improve things and not break anything.

While this is certainly an improvement reporter of #8856 asked specifically about setting reading direction and closing this issue when this PR is merged makes it pretty easy for this problem to be forgotten. IMO #8856 should either remain open until reading direction is added for all languages or this should be done as part of this PR.

@seanbudd

seanbudd commented Dec 6, 2021

Copy link
Copy Markdown
Member

@feerrenrut Is updating the translated *.t2t files in this manner safe?

@bramd

bramd commented Dec 7, 2021

Copy link
Copy Markdown
Contributor Author

While this is certainly an improvement reporter of #8856 asked specifically about setting reading direction and closing this issue when this PR is merged makes it pretty easy for this problem to be forgotten. IMO #8856 should either remain open until reading direction is added for all languages or this should be done as part of this PR.

That's true. However, I'm not comfortable setting text direction without getting people of the affected localizations involved. For most rtl languages, some text like numbers might need an explicit dir=ltr (see for example Arabic).

@feerrenrut

Copy link
Copy Markdown
Contributor

Is updating the translated *.t2t files in this manner safe?

Not really, this COULD cause merge conflicts. Really only the en should be updated here, and the rest of the files via the screenReaderTranslations Subversion repository.

@bramd

bramd commented Dec 12, 2021

Copy link
Copy Markdown
Contributor Author

@feerrenrut Good to know. I should still have access to that repo due to my work on the NL translation. Should I commit the changes there or should we first discuss this with translation teams?

@seanbudd

Copy link
Copy Markdown
Member

Converting this to a draft until a translation strategy is determined.

@seanbudd seanbudd marked this pull request as draft January 13, 2022 04:33
@feerrenrut

Copy link
Copy Markdown
Contributor

Should I commit the changes there or should we first discuss this with translation teams?

@bramd it's would be nice to give some advanced warning (an email to the NVDA translators mailing list), but I don't expect any opposition to this.

@zstanecic

zstanecic commented Jan 14, 2022 via email

Copy link
Copy Markdown
Contributor

@zstanecic

Copy link
Copy Markdown
Contributor

even it will be good to solve the problem with rtl direction, as now hebrew has a structure difference problem due to this. There is an ugly hack in the t2t file itself.

@seanbudd

Copy link
Copy Markdown
Member

This PR is still blocked by only changing this in the "en" file.
I would suggest adding dir="ltr" as well.
Translators should handle this change in their respective files.

@Qchristensen Qchristensen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work everyone

@seanbudd

Copy link
Copy Markdown
Member

Closing as abandoned, superseded by #14546

@seanbudd seanbudd closed this Jan 16, 2023
seanbudd added a commit that referenced this pull request Mar 27, 2023
Supersedes #13133
Closes #8856 with nvaccess/mrconfig#83

Summary of the issue:
The generated HTML from t2t (changes, quick reference, user guide) has no lang attribute set.
So, it will not read in the correct TTS language.
Right to left languages also do not render correctly without an dir="rtl" attribute.

Description of user facing changes
When translators add values to the attributes, the correct TTS language will be used when reading NVDA documentation and the layout direction of text will be appropriate.

Description of development approach
 PR to mrconfig to support locale.t2tconf: add locale.t2tconf as a translatable file in nvaccess/mrconfig#83
 Create a base template for translators to add their own lang and dir attribute values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTML "lang" & "dir" attributes are missing in the NVDA documentations for some languages

6 participants