splitbrain / dokuwiki-plugin-translation

Easily setup a multi-language DokuWiki
http://www.dokuwiki.org/plugin:translation
23 stars 24 forks source link

Add `lang` and `dir` to main content if `translateui` is off #273

Closed selfthinker closed 1 year ago

selfthinker commented 3 years ago

When the translateui setting is not used, the page's language is still set to the wiki's main language and there is no indication in the code that the language of the main content has changed. That will be bad for translation services (like Google Translate) and screenreader users.

The main content should have a lang and dir around it to make the language (and script direction) be programmatically determinable. The dir will then also help to show text in the correct direction. See also splitbrain/dokuwiki#3413.

Adding lang and dir to the main content is not necessary when translateui is set, as the html element will have the correct attributes for the whole page.

splitbrain commented 1 year ago

Makes sense. Should be possible with the TPL_CONTENT_DISPLAY event