-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[4.1] Language of Parts [a11y] #35607
Conversation
This PR is a draft to implement and showcase the new language of parts feature in tinyMCE It has been made to 4.1 as its a new feature This PR requires joomla#35605 which at the time of this PR has not been merged into 4.1dev This is a replacement PR of joomla#30939 This wraps the desired text in span tags with a lang attribute for the specified language. Unspecified text is assumed to be written in the page's language. This helps the resulting text comply with WCAG 2.0 3.1.2 Language of Parts: "The human language of each passage or phrase in the content can be programmatically determined..." If you have customised your tinymce editor toolbar you will need to edit the toolbar again to include this button. The need for this is based on the EU funded research project for improving the process of creating accessible content by authors https://accessibilitycluster.com/about You can view a video that demonstrates the benefits of this feature https://www.youtube.com/watch?v=BY9_xhjtLV4 and read the [Technical Sepecification](https://www.dropbox.com/s/mbzh30rdt0c0gqa/Technical%20specification%20-%20Change%20language%20%28We4Authors%20Cluster%29.pdf) that the research project produced. This PR is only a draft The remaining task is to decide - which languages to list - if they should be translatable - should they be fr for fr-FR - or should the list of languages be user selectable in the tinymce plugin configuration In addition the research project recommended that there should be some form of visible indicator to the content author that a piece of text has been marked as being in a specific language. TinyMCE have not implemented this (yet) but I think we could do it with some css? cc @chmst
Thanks for this PR, very useful.
"All", but preselected with the, let's say 10 most spoken one?
Yes I would think so.
Joomla! is using the later for the html tag, so we should stick with it.
If possible we should ship a list of X languages (see first point) and user can add more, as a repeatable subform-field in the tinymce plugin parameter.
Yes, the question is, what should be displayed? |
the ten most spoken is probably not going to work as they won't be the top ten languages likely to be used on a web site. For example this is a top ten list of spoken languages As you can see french and german do not appear on the list This is a list of the top ten list of languages on the internet French and german do appear but so do other languages that might appear "strange" in a list. I think I will try to create it so that its a repeatable subform-field with some prefilled languages (those using latin character sets)
this was the part of the research project that we had no recommendation for - perhaps why tinymce didnt implement anything. I will try what you propose. regarding the capitalisation you highlighted. I am reviewing the documentation from the w3c i18n working group for clarification https://www.w3.org/International/ |
regarding the capitalisation. which was probably following the code here joomla-cms/libraries/src/Document/Document.php Lines 709 to 724 in 95f5ac8
I spoke to the head of the w3c i18n working group who pointed me to https://www.w3.org/International/questions/qa-choosing-language-tags
|
Very good improvement. Highlighting language parts surely is possible via css, at least with js - maybe by adding the respective flag?
I think, the languages should be configurable in the tinyMCE, at least a few ones. English of course it always needed but then it depends. In Europe / America your proposed languages seem to be ok. But in Asian countries, other languages could be more impotant. Opinions from native speakers?
You mean the frontend language? |
The language of the page as defined in the |
Are'nt the languages possibilities defined by the screenreader itself? Example with MacOS Voice Over: Remark that evidently Chinese is different for Taiwan and China (zh-TW and zh-CN in Joomla, also for Hong Kong, not I found a list of supported languages in most screenreaders and tags to use. |
No that is not the way to do it. That assumes that the content author knows about or even has a screen reader. "Language of parts" is about much more than just a screen reader or selecting a voice. There is also no connection between "language of parts" and any joomla language packs. Finally to be usable there is no point in having a huge list of languages available if the content author is only going to need a select few. |
Wonder why I even try again to help... |
I guess you never actually read the original post. Oh well. At least others did and commented appropriately which is greatly appreciated. |
This is now ready for testing etc |
@brianteeman There is a merge conflict in |
Co-authored-by: Quy <[email protected]>
A very good and appreciated feature. In my test (using patchtester) I had an effect where I am not sure if it is the new function or a general tinyMCE issue. If I mark several parts, the are not correct. I had the following text: Marked the result is it should be
|
Could you try and upload your video again. I suspect its a tinymce upstream issue but need to see it |
The advice from tinymce is to apply the span after you have entered the text |
I have tested this item ✅ successfully on 75a0575 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35607. |
I think that part of the description is not right anymore. |
I have tested this item ✅ successfully on 75a0575 It can be even nested, i.e. I can mark a text as English and inside that mark a German part as German. The result is That's quite valid (but maybe not a very useful example). This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35607. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35607. |
Regarding documentation: I am not sure if we should rewrite TinyMCE's documentation. Maybe we should just link to that (if we haven't done yet). The PR is just enabling a builtin TinyMCE feature for us. Another interesting question is if that could be extended by an optional field for the direction of a language and if set, add the "dir" attribute to that span, too. |
I see ... well assume (not tested yet) that would wrap a span with a language attribute into another one with the direction attribute or vice versa, depending on order of processing, which is not nice but valid. It would be nicer to have the right dir attribute directly in the language span. |
Take it up with tinymce ;) |
Seriously the reason they are separate is that you should not add dir=ltr if the rest is already ltr etc. And there is no reliable way to know what the direction of the text is when you mark something as being in a different language. This is the correct way to do this. |
Thx |
thats great - thank you |
joomla/joomla-cms#30522 + joomla/joomla-cms#32223 + joomla/joomla-cms#31675 + joomla/joomla-cms#35378 + joomla/joomla-cms#35612 + joomla/joomla-cms#35715 + joomla/joomla-cms#35610 + joomla/joomla-cms#35607 + joomla/joomla-cms#35788 + joomla/joomla-cms#35647 + joomla/joomla-cms#35143 + joomla/joomla-cms#36135 + joomla/joomla-cms#35998 + joomla/joomla-cms#36173 + joomla/joomla-cms#36212 + joomla/joomla-cms#36208 + joomla/joomla-cms#36206 + joomla/joomla-cms#36205 + joomla/joomla-cms#36203 + joomla/joomla-cms#36192 + joomla/joomla-cms#36191 + joomla/joomla-cms#36228 + joomla/joomla-cms#36211 + joomla/joomla-cms#36271 + joomla/joomla-cms#36270 + joomla/joomla-cms#36245 + joomla/joomla-cms#36294 + joomla/joomla-cms#36244 + joomla/joomla-cms#36242 + joomla/joomla-cms#36296 + joomla/joomla-cms#36190 + joomla/joomla-cms#36474 + joomla/joomla-cms#36297 + joomla/joomla-cms#36480 + joomla/joomla-cms#36479 + joomla/joomla-cms#36551 + joomla/joomla-cms#36366 + joomla/joomla-cms#36589 + joomla/joomla-cms#36583 + joomla/joomla-cms#36328 + joomla/joomla-cms#36515 + joomla/joomla-cms#36555 + joomla/joomla-cms#36653 + joomla/joomla-cms#36660 + joomla/joomla-cms#36657 + joomla/joomla-cms#36637 + joomla/joomla-cms#35983 + joomla/joomla-cms#36704 + joomla/joomla-cms#36708 + joomla/joomla-cms#36700 +
This PR is an implementation of the new "language of parts" feature in tinyMCE
It has been made to 4.1 as its a new feature
This PR requires #35605 which at the time of this PR has not been merged into 4.1devThis is a replacement PR of #30939
This wraps the desired text in span tags with a lang attribute for the specified language. Unspecified text is assumed to be written in the page's language. This helps the resulting text comply with WCAG 2.0 3.1.2 Language of Parts: "The human language of each passage or phrase in the content can be programmatically determined... https://www.w3.org/WAI/WCAG21/Techniques/html/H58.html"
If you have customised your tinymce editor toolbar you will need to edit the toolbar again to include this button.
The need for this is based on the EU funded research project for improving the process of creating accessible content by authors https://accessibilitycluster.com/about
You can view a video that demonstrates the benefits of this feature https://www.youtube.com/watch?v=BY9_xhjtLV4 and read the Technical Sepecification that the research project produced.
The list of languages to be included is a user defined subform in the plugin.
In addition the research project recommended that there should be some form of visible indicator to the content author that a piece of text has been marked as being in a specific language. TinyMCE have not implemented this (yet) so I have done it with some css for the editor
cc @chmst @bembelimen