subissue from #2004176: [META] Unify Content, String and Configuration Translation UI for accessibility, usability & responsivness, for unify from #2003834: Accessibility fixes
- Add lang="" attribute to String Translation UI Elements
- Add Language Name in Brakets to hidden Text for Screenreaders in String Translation UI
Comments
Comment #1
Schnitzel CreditAttribution: Schnitzel commentedfirst patch
Comment #2
Schnitzel CreditAttribution: Schnitzel commentedComment #4
falcon03 CreditAttribution: falcon03 commented@Schnitzel: thanks for opening this issue. These fixes sound really great. I'll review the patch as soon as possible.
BTW, the patch failed testing, unfortunately. Do you think it can be reviewed in any case?
Comment #5
Schnitzel CreditAttribution: Schnitzel commented@falcon03
yes you can review the patch, the failing test is only a tiny little thing, which will not change any of the structure of the HTML.
thanks!
Comment #6
mgiffordI just scanned through the code, but it looks good. I'll leave @falcon03 to do the testing, but happy with the changes I've seen.
We don't need this in the patch either:
Anyways, happy to see this was caught.
Comment #7
Gábor HojtsyEagerly awaiting testing feedback! :) Thanks!
Comment #8
Gábor HojtsyComment #9
mgiffordSet this up:
admin/config/regional/translate/translate
Looks good except that there's a label without a form element on this page:
This probably should be a new issue though as it's really unrelated to the initial reported error.
Comment #10
Gábor Hojtsy@mgifford: well, the "Source text..." text is a regular form item #type, this is just how Drupal renders those (and those don't have a form element in general). Its the same before/after the patch also. Any other accessibility feedback or should this be ready to go once green?
Comment #11
mgiffordNo, it should be good when it's green. I reviewed the code and it's adding good text changes and semantic ones too.
Will have to hunt down the label separately. Labels need to be associated with form elements strictly in a 1 to 1 relationship.
Comment #12
mgiffordtagging.
Comment #13
mgifford#1: 2004684-string-translation-ui-accessibility-1.patch queued for re-testing.
Comment #15
Gábor HojtsyComment #16
mgiffordI think the test is failing here:
$this->assertNoText('English', t('No way to translate the string to English.'));
But not sure why it's failing as that text seems to exist in the source on /admin/config/regional/translate/translate
Would like to get the test fixed.
Comment #17
Gábor Hojtsy@mgifford: before the patch, the source language name did not show in the UI. The test is asserting it DOES NOT show, and now it shows. So fails. The intent of that assert is to test if English shows up as an option in the "Translation language" select box. It does not show there, but it shows now on every page as part of the source string description.
So one quick fix would be to do something like:
Or if there is some specific method to check for an option existing in a select dropdown. Or if you want to pull out your xpath skills and do an assert xpath on the source to look for an option tag that has 'English' as text, those would be fancier. :)
Can you push this that little forward? Sounds like we are pretty close!
Comment #18
mgiffordI tried the quick fix you expressed. Hopefully the bot likes it.
Comment #20
Gábor Hojtsy#18: 2004684-string-translation-ui-accessibility-18.patch queued for re-testing.
Comment #22
Gábor Hojtsy'Exception' with message 'The configuration directory type staging does not exist.' does not seem to be related to this patch at all :)
Comment #23
Gábor Hojtsy#18: 2004684-string-translation-ui-accessibility-18.patch queued for re-testing.
Comment #24
Gábor HojtsyOk, so this proves it works now :) Let's get in a real test assertion on it :)
I think something like this is more fancy to say the thing we are looking for to not be there:
This expresses that the edit-langcode select list does not have an 'en' option. More foolproof than just asserting for >English<. I just had time to look up this more fancy way, I don't easily recall the assert methods I don't regularly use :) Sorry for not coming with this option first :)
Comment #25
mgiffordFilenames changed too. Thanks Gabor. Here's the new patch.
Comment #26
Gábor HojtsyLooks all good to me as long as it passes :)
Comment #27
effulgentsia CreditAttribution: effulgentsia commentedHere and elsewhere, the class name needs to be changed, because of #1363112: Simplify names of "element-x" helper classes.
Comment #28
mgiffordAnnoying.. Where's the search/replace on all existing patches to update strings like that.....
Thanks effulgentsia!
Comment #29
Gábor HojtsyAll righto!
Comment #30
Dries CreditAttribution: Dries commentedCommitted to 8.x. Thanks!
Comment #31
Gábor HojtsyWoot, thanks @falcon03, @Schnitzel, @mgifford!
Comment #33
Gábor HojtsyYay!