Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
locale.module
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
17 Aug 2010 at 14:02 UTC
Updated:
3 Jan 2014 at 01:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mgiffordgo bot go.
Comment #3
bleen commentedmaybe I'm misreading the patch, but shouldn't this line be removed?
Powered by Dreditor.
Comment #4
mgifford@bleen18 - thanks. You're right. Also realized after a few other similar patches that this needs a bit more clean up and a screen shot or two to explain what the labels are that are actually being added.
They are tied to these two pages:
admin/config/regional/language
admin/config/regional/language/configure
Comment #5
ramlev commentedAll tests good, and code ok
Comment #6
dries commentedWouldn't it be better if we consolidated the 'Enabled' and 'Description' columns in http://drupal.org/files/issues/screen-capture-10_3.png? The reason I'm suggesting this is because the description seems to be much better than the invisible text. I don't have the answer -- just bringing it up as a suggestion. Thoughts?
Comment #7
mgifford@Dries that is an interesting idea. I think there are probably a lot of cases where if we simply used the description as the label for the checkbox and presented it in one column it might be clearer. Part of the challenge is in not having the label completely repeat the information provided.
I do think merging them is something we should consider for D8. It may well be better for usability too (reducing a column should make things easier for everyone to understand I expect).
I do think that there does need to be some work looking at how we want to structure this text, even if it is invisible. Do we want it to end with a '.' ? Does it matter if the case isn't correct? It's a checkbox so we're always either enabling or disabling something. Should we start it with "Enable/disable ..." rather than as I have here. Should it be smart enough so that it says "Enable" or "Disable" depending on the checkbox (that would require some jQuery so I'd say this is too complicated for too little value myself)?
I've just been making stuff up in the interim with the previous LABEL issues I've been creating this week.. Largely I've been of the mind that almost anything is an improvement. If it doesn't add confusion to the screen reader user it will help it if we get this into core. However, it will look much more professional if we get this done right & have an understanding documented about how to treat labels (invisible or not) in core forms. Perhaps there is one I'm just not aware of. Any changes that we make to these strings after the release of Drupal 7 can be made without affecting the vast majority of users, so I was pretty confident that we'd be able to work this out without having to slow down the release of core.
In anycase, I think this label would be improved by changing this line:
to
That I think would be a better label than the present description boxes as most of the existing description boxes describe what the the method does rather than what the checkbox does. We'd have to work enable in there somewhere.
Should I just re-roll that?
Comment #8
sunI think I already tried the idea of using checkboxes in a tabledrag for the new Filter format UI, but that did not work out.
Comment #9
mgiffordAfter the discussion here #882688: Label missing in block admin page - I'm wondering if we should be using:
Any thoughts?
Comment #10
bleen commentedor...
'#title' => t('Enable @title language detection method', array('@title' => drupal_strtolower($provider_name))),Comment #11
mgiffordInteresting.. So yes, I think I'd skipped this function:
http://api.drupal.org/api/function/drupal_strtolower
I've converted it to the '@' approach & cleaned up the language.
It's also now running lower case titles for the language detection.
This is a label for a screen reader which won't differentiate for case in this context I am pretty sure. It's better with lower case here, but don't think it's critical.
We'll need to get this looked at & RTBC'd again.
Comment #12
Everett Zufelt commentedLooks good, but I'm not comfortable enough with this module to give an RTBC.
Comment #13
mgifford#11: locale_overview_labels_v3.patch queued for re-testing.
Comment #14
Everett Zufelt commentedSetting to major priority. IMO missing labels, a WCAG 2.0 level A success criteria, is major (if not critical).
Comment #15
bowersox commentedCode looks good. I haven't tested it yet.
Comment #16
mgifford#11: locale_overview_labels_v3.patch queued for re-testing.
Comment #18
mgifford#11: locale_overview_labels_v3.patch queued for re-testing.
Comment #20
mgiffordMissed that this needed to be updated to keep up with core. Trying again.
Comment #21
mgiffordGo bot..
Comment #22
xano@rowis semantically incorrect. Use@languageinstead.I don't see "Enable/Disable language" anywhere in the screenshots. Where is it being used? Also, checkbox titles tell users what happens if they check the checkbox, not what happens if they dont, so use
t('Enable language')ort('Enable @language').Powered by Dreditor.
Comment #23
mgiffordRight now it's actually:
at least if we're looking at the same patch.
Where is the 'Enable/Disable language' string in the patch above?
I think I'm missing something here but not sure what...
@Xano, can you fill me in?
Comment #24
dalin@mgifford great stuff. No idea what @Xano is talking about. Here's some additional thoughts:
This stuff is not theming, it's form building and so shouldn't be in a theme function. We can't put it into the form builder because the checkboxes and radios aren't expanded yet, but perhaps this should go in a #process step.
Otherwise looks great.
Comment #25
xanoI think I accidentally reviewed an older patch. My bad!
Comment #26
catch#82694: System Information: information about the Drupal installation and system environment fixed this, looks like a straight duplicate to me. If that issue missed one I'd suggest opening a new issue since there's a lot of discussion here which is outdated now that other patch is in.
Comment #27
mgiffordI just went here - en/admin/config/regional/language
On a test site & looks like this issue is still there. I haven't done a comprehensive review since I initially posted these errors about missing labels, but I'm sure there are others in D7 that didn't get fixed.
Comment #28
mgifford#20: locale_overview_labels_v4.patch queued for re-testing.
Comment #29
Everett Zufelt commentedApplied and tested with 8.x-dev.
Comment #30
sun#20: locale_overview_labels_v4.patch queued for re-testing.
Comment #31
sunAt minimum, #title_display is duplicated here. Quite possibly, #title is too (out of diff context). In any case, #title should be defined before #title_display.
Since drupal_render() is called on the element, I can only guess that the value in $title is already sanitized to be displayed in HTML. Thus, @title would run check_plain() once again on the already sanitized string, potentially leading to double-escaping.
This issue needs to be verified very carefully.
check_plain() already ran on $provider_name, so @title leads to potential double-escaping.
In this case, I'd recommend to leave the manual check_plain()s intact and pass the original $provider['name'] as value for @title instead.
12 days to next Drupal core point release.
Comment #32
mgiffordI went and tried to implement this but really didn't like that the same value was being checked separately 3X if I left in the @.. I changed it to ! which should pass it through unchecked.
Thanks for this great review. For testing we just need to put in titles for that have bad characters in them like &, # & < right?
Definitely don't want to have this string checked more than once.... Thanks for catching this! As usual a great review.
Comment #33
sunNow you've inconsistently changed the t() tokens - the token in the string subject must match the array key in the passed in replacement token array.
This chunk of code needs an inline comment that explains why the form element properties are manipulated in a theme function instead of already being set in the form constructor.
The reason for doing it in the theme function is that we're theming the form as a table, so the element labels are not visible and do not fit into the table cells. If we wouldn't theme the form as a table, then the regular element labels would be sufficient and perfectly okay. (Obviously, don't copypaste this 1:1, please)
12 days to next Drupal core point release.
Comment #34
mgiffordSorry, I must have just needed for the coffee to settle in or something. Hopefully this is better.
I don't think this quite cuts it for a description:
But hopefully other folks can chime in with a better way to describe it.
This should also be done elsewhere in the code so perhaps there's text we can copy to ensure that there is a consistent description in the code.
Comment #35
sunExceeds 80 chars.
Let's change that into:
"Add invisible labels for the checkboxes and radio buttons in the table for accessibility. These changes are only required and valid when the form is themed as a table, so it would be wrong to perform them in the form constructor."
The similar other changes we applied elsewhere in core do not need this explanation, because we applied them to the form constructors. The situation is a bit special here, since such kind of form structure changes normally do not belong into a theme function. We apply them to the theme function, because the form is themed as a table. If some module would override that theming to not output the form as a table, then the form would contain extremely wonky labels for the checkboxes and radio buttons. Hope it's clear now?
12 days to next Drupal core point release.
Comment #36
mgiffordGets pretty small when it's tabbed in that far, but here it goes. Thanks Sun!
Comment #37
sunThanks, looks good to go for me now.
Comment #38
dries commentedCommitted to 8.x. Moving to 7.x.
Comment #39
Everett Zufelt commentedComment #40
bowersox commented+1 for this. The code looks good (both what was committed to 8.x and is now proposed for 7.x). The labels will help make this form meaningful.
Comment #41
mgiffordTested this and can confirm that the d7 version of my d8 RTBC patch works as expected.
Comment #42
webchickWhile the hidden form elements are probably okay, since they fix a legitimate accessibility bug and are not user-facing the majority of the time, I don't think we can do these in D7:
...
These would break user-facing (well, admin-facing) strings, and this seems to be a small text clarification, not an actual bug fix.
Comment #43
mgiffordI can see the logic behind that decision. I've just removed the modifications to the _locale_languages_configure_form_language_table() function and think the patch will provide the labels as required for D7. It will be more understandable in D8.
I just deleted the code from the existing patch so this needs to be tested for sure.
Comment #44
sun@webchick: The string changes you objected in #42 are not visible anyway...? They are output as 'title' attribute of a checkbox. Only visually impaired users read them.
Comment #45
Everett Zufelt commentedApplied and tested successfully against 7.x
Comment #46
Everett Zufelt commented@Sun
Just saw your comment. Although I understand that the strings are not visible, and would enhance the UI slightly for screen-reader users, I think that it is a good practice to keep strings aligned. Unless there is a strong reason I don't see the need for a string exception for accessibility as a general rule.
Comment #47
webchickGreat, thanks for the re-roll!
Committed to 8.x and 7.x.