Lang Attribute for the Block Editor

설명

The intent of this plugin is to provide a way to ensure any language change in the content of a page is indicated to assistive technologies. This feature is not available by default in the block editor so it is difficult to make a website fully compliant to WCAG guidelines using the block editor for now.

We clearly hope this feature will be natively implemented in the block editor in middle term, because this very simple feature is really needed to help people to create accessible websites. But in short terms, we need a solution and this plugin is a solution you may want to use to make your website compliant to accessibility guidelines 🙂

For more context: this plugin helps you to make your website compliant to the Web Content Accessibility Guidelines (WCAG) success criterion 3.1.2: “Language of Parts”. The purpose of this success Criterion is to ensure that user agents can correctly present content written in multiple languages.

As per Web Content Accessibility Guidelines:

This makes it possible for user agents and assistive technologies to present content according to the presentation and pronunciation rules for that language. This applies to graphical browsers as well as screen readers, braille displays, and other voice browsers.

Both assistive technologies and conventional user agents can render text more accurately if the language of each passage of text is identified. Screen readers can use the pronunciation rules of the language of the text. Visual browsers can display characters and scripts in appropriate ways.

This is especially important when switching between languages that read from left to right and languages that read from right to left, or when text is rendered in a language that uses a different alphabet. Users with disabilities who know all the languages used in the Web page will be better able to understand the content when each passage is rendered appropriately.

스크린샷

  • Using the block editor formatting toolbar to add a language attribute.
  • Checking that the lang attribute is rendered on front-end.

설치

  1. Install the plugin and activate.
  2. Use the “Language attribute” toolbar button, available on any text content added in the block editor.

후기

2024년 2월 22일
As a user of WordPress with a Persian background, I am genuinely grateful to the developers for offering such a valuable solution.
2023년 2월 2일
Thanks for this little Plugin! Seems it just adds a <span>-tag to the block. This can also be done with the html-mode of the block-editor. But so it might be a little bit easier to maintain.
2023년 11월 21일
Thank you, thank you, thank you!, for creating and sharing this plugin. As small as this may seem to the less knowledgable, this plugin provides a massive win for accessibility! Update Tuesday, Nov. 21: this plugin still works fine with WordPress 6.4.x! An yes, of course, you can achieve the in the HTML editor manually, but not all users are comfortable doing that. This is a great solution!
모든 3 평가 읽기

기여자 & 개발자

“Lang Attribute for the Block Editor”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에 기여하였습니다.

기여자

“Lang Attribute for the Block Editor”(이)가 8(으)로 번역되었습니다. 기여해 주셔서 번역자님께 감사드립니다.

자국어로 “Lang Attribute for the Block Editor”(을)를 번역하세요.

개발에 관심이 있으십니까?

코드 탐색하기는, SVN 저장소를 확인하시거나, 개발 기록RSS로 구독하세요.

변경이력

0.3

  • Added support for the dir attribute.

0.2.2

  • Further internationalization fixes.

0.2.1

  • Adds wp_set_script_translations to the main script.

0.2

  • Fixes an i18n issue: JS strings were not translatable.

0.1

  • Plugin initial commit. Works fine 🙂