this issue will fix the accessibility issues from #1952394: Add configuration translation user interface module in core

First off, it is hard to distinguish the "source" information from the form field where to type its translation. This issue could be solved by adding the language to the label of the information that you are translating.
So, for instance, to translate the site name you could have something like:
Site name (Source language): site_name
Site name (Language_that_you_are_translating_the_information_into): form field to translate it
If this additional information should not be shown to sighted users, it can be wrapped in a span/div element which the "element-invisible" class can be assigned to, so that the information is available for screen reader users, but not for sighted ones.

When you try to translate the displays of a view, you get lots of buttons labelled "display settings". You can understand what display a button refers to only after clicking it. This is not good for accessibility and (maybe( for usability too. And I was also wondering: does it make sense, from a usability point of view, to have the display settings in collapsible details elements?

And finally, I think that the Source text that you are translating into another language should be wrapped in a div/span element, which "lang" attribute should be set to the appropriate value according to the source language. It could be also appropriate to set the "lang" attribute of the form element to translate an element (e.g. the site name) to the appropriate value according to the language that the text is going to be translated into.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Schnitzel’s picture

Status: Active » Needs review
FileSize
3.14 KB

the attached patch fixes all these issues:

  • The Source and Translation Label now have the Language in Brakets, but with the "element-invisible" class, so it's only shown to screen readers
  • The Title of a collapsible area tries to search the child items for something with "title" in the key and if found shows this in the title, so for the Frontpage Views it shows "Displaysettings Master" instead of "Displaysettings"
  • Added the lang="" attribute to the source and translation, so that screenreaders can work better with different languages. (actually this would make sense to do this in the string translation)

Status: Needs review » Needs work

The last submitted patch, 1999156-config-tranlation_accessibility-1.patch, failed testing.

Schnitzel’s picture

Schnitzel’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1999156-config-tranlation_accessibility-3.patch, failed testing.

Schnitzel’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1999156-config-tranlation_accessibility-3.patch, failed testing.

Schnitzel’s picture

Status: Needs work » Needs review
FileSize
3.16 KB

(facepalm), overwrote $key, interesting that the whole thing actually still worked! :D

Schnitzel’s picture

this patch depends on #2004194: Add getLanguageWithFallback() to ConfigGroupMapper so it will fail till it's not yet landed

Status: Needs review » Needs work

The last submitted patch, 1999156-config-tranlation_accessibility-depends-2004194-9.patch, failed testing.

Schnitzel’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1999156-config-tranlation_accessibility-depends-2004194-9.patch, failed testing.

Schnitzel’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1999156-config-tranlation_accessibility-depends-2004194-9.patch, failed testing.

Schnitzel’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1999156-config-tranlation_accessibility-depends-2004194-9.patch, failed testing.

Schnitzel’s picture

Status: Needs work » Needs review
Gábor Hojtsy’s picture

Status: Needs review » Needs work
+++ b/lib/Drupal/config_translation/Form/ConfigTranslationManageForm.phpundefined
@@ -138,9 +146,16 @@ class ConfigTranslationManageForm implements FormInterface {
+          $title = ' ';
+          foreach (array_keys($sub_build) as $title_key) {
+            if (strpos($title_key, 'title') !== FALSE) {
+              $title .= strip_tags($sub_build[$title_key]['source']['#markup']);
+              break;
+            }
+          }
           $build[$key] = array(
             '#type' => 'details',
-            '#title' => t($definition['label']),
+            '#title' => t($definition['label']) . $title,

I think title should come first before the label definition, eg. "Page Display" vs. "Display Page".

Also, it would be great to look for a 'label' key as well. So what I would do is

$keys = array_keys($sub_build);
if (isset($sub_build['label'])) { use that }
elseif (isset($sub_build['title'])) { use that }
else {
  your foreach with strpos for BOTH title and label :) as in strpos(.. 'label') || strpos(... 'title')
}
Schnitzel’s picture

Status: Needs work » Needs review
FileSize
3.97 KB

update of the patch, now searching for direct title or label elements before searching for elements which contain these words

Gábor Hojtsy’s picture

Status: Needs review » Fixed

I committed this at http://drupalcode.org/project/config_translation.git/commit/8ed56dcc385e... thanks! Only slightly edited.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.