Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The use of Select media can be, is for me, a bit confusing. Especially for already added media. Also, "Add" is used throughout Drupal in other places.
Current UI (with the edit patch):
Proposed change:
Comment | File | Size | Author |
---|---|---|---|
#22 | media-change_widget_labels-1399140-22.diff | 507 bytes | ParisLiakos |
#16 | change_widget_labels.diff | 1.63 KB | arthurf |
#6 | change_media_widget_button_labels-1339140-6.patch | 1.49 KB | mpgeek |
#4 | patched-button-labels.jpg | 23.39 KB | mpgeek |
#4 | change_media_widget_button_labels-1399140-4.patch | 1.75 KB | mpgeek |
Comments
Comment #1
Dave ReidPostponing until #1213252: Allow media file's fields to be edited in a modal or after upload in the media widget lands.
Comment #2
Dave ReidI'm mostly in favor of this, although I think it would be good to rename 'Select' for a record that has an existing file to 'Replace'?
Comment #3
tsvenson CreditAttribution: tsvenson commentedYes, "Replace" is a better word than "Change" so +1 for that.
Comment #4
mpgeek CreditAttribution: mpgeek commentedChanged the labels like so...
Select Media = Replace
Edit Media = Edit
Remove media = Remove
... and when there's no file yet for the element, you get Choose instead of "Replace". See screenshot, patch attached.
Comment #5
mpgeek CreditAttribution: mpgeek commentedComment #6
mpgeek CreditAttribution: mpgeek commentedAfter #1452832: What is the best way to modify the buttons in the media widget? and unstable6, the patch at #4 no longer applies. Here's another if you think simpler language is good for defaults. But as that issue points out, this is now easily overridden by well-placed alter hooks.
Comment #7
cecrs CreditAttribution: cecrs commentedWorks beautifully, thanks! Just a general note, one-word buttons tend to work better in english anyway, in that the button text on smaller screens (or when the widget is placed inside a two column layout) doesn't wrap to two lines.
Comment #8
arthurf CreditAttribution: arthurf commentedPatch applies cleanly on 2.x, works as advertized
Comment #9
ParisLiakos CreditAttribution: ParisLiakos commentedMaybe Add is better than Choose?
Comment #10
arthurf CreditAttribution: arthurf commentedThat should probably be ! empty($file) ? t('Replace') : t('Choose') to not throw a php warning
Comment #11
ParisLiakos CreditAttribution: ParisLiakos commented$file is always set (see here)
$file = $fid ? file_load($fid) : FALSE;
Comment #12
arthurf CreditAttribution: arthurf commentedWoops, sorry, only read the patch there. We can probably change this line then:
obviously not necessary but keeps things a bit neater.
Comment #13
ParisLiakos CreditAttribution: ParisLiakos commentedi seriously dont like choose..select or add is far more better
Comment #14
arthurf CreditAttribution: arthurf commentedI agree with rootatwc on select. We should also pay attention to this issue as well: http://drupal.org/node/1807832
Comment #15
tsvenson CreditAttribution: tsvenson commentedJust want to tune in to the chorus in #13 and #14 and say that "Add" is the preferred for me to. "Choose" doesn't work as there is nothing visible for the user to select from.
Comment #16
arthurf CreditAttribution: arthurf commentedRerolled patch with request from rootatwc
Comment #17
arthurf CreditAttribution: arthurf commentedSetting correct status
Comment #18
ParisLiakos CreditAttribution: ParisLiakos commentedThanks for rerolling this arthur..
i think its ready now
Comment #19
ParisLiakos CreditAttribution: ParisLiakos commentedcommited
http://drupalcode.org/project/media.git/commit/06d0a36
Thanks
Given that this change will break translations, do we want to backport it?
Comment #20
Rob C CreditAttribution: Rob C commented1 thing i did just notice is the 'add' button changed somewhere, but not sure if that's related / where it was 'introduced':
The 'Add' button now reads 'Replace'. Just a minor thing.
Comment #21
Dave ReidYeah this is why keeping 'Select' would have been nice. If we have Add vs Replace you have two swap out the text using JavaScript. Swapping it out via JavaScript means that you are no longer able to override the button text since the strings are hard-coded in the JS, or you'd need to provide the text in a data attribute of the button, which at that point seems like we're just adding unnecessary complexity.
Comment #22
ParisLiakos CreditAttribution: ParisLiakos commentedagreed
Comment #23
arthurf CreditAttribution: arthurf commentedWorks as advertised, looks good to me!
Comment #24
ParisLiakos CreditAttribution: ParisLiakos commentedCommitted http://drupalcode.org/project/media.git/commit/e94ee0a
Comment #25.0
(not verified) CreditAttribution: commentedMissed a g for the file