Problem/Motivation
in the translation add/edit form, fields that are not translated (have the same value in the content and all translations) have a (all languages) hint on them. The parts of a synchronized field that are the same in all languages do not have a hint. This is confusing/misleading.
Proposed resolution
Put a note that the field is sync'd in the edit

Remaining tasks
- (done) create initial patch to add the hint
- review approach and suggest better strategy (see #18)
- iterate on improving patch (doc on creating patch: http://drupal.org/node/1424598 includes link to interdiff instructions)
- add screenshots of interface
- improve steps to test
Steps to test
It helps to do this once without the patch to see the interface before.
Then repeat with the patch.
- install a fresh drupal 8 [with the most recent patch applied] (from git or simplytest.me)
- enable the content translation module under Extend
- configure it to add a couple languages
- configure the content language settings to turn on translation for content that has something to synchronize, like images. Article works.
- Create article and add an image.
User interface changes
No ui changes
API changes
No API changes expected.
| Comment | File | Size | Author |
|---|---|---|---|
| #29 | sync-hint-1909218-29.patch | 4.08 KB | pancho |
| #25 | addlanguageshintbefore1.png | 51.76 KB | andymartha |
| #25 | addlanguageshintbefore2.png | 42.73 KB | andymartha |
| #25 | addlanguageshintafter1.png | 139.06 KB | andymartha |
| #18 | sync-hint-1909218-18.patch | 4.06 KB | dsnopek |
Comments
Comment #1
yesct commentedComment #2
yesct commentedpostponing on #1807692: Introduce a column synchronization capability and use it to translate alt and titles through the image field widget
will need some change to issue summary to reflect improved ui in the original issue.
Comment #3
gábor hojtsy#1807692: Introduce a column synchronization capability and use it to translate alt and titles through the image field widget got committed.
Comment #4
yesct commentedthe hint should probably just be (all languages)
"synchronized" is not in the ui anymore.
Comment #5
dsnopekSo... I was looking for a D8MI issue that I could write the initial patch for, and this one seemed promising (yay, no patch yet!) but I got stuck on what should actually be done (from a UX perspective), before I could even begin to think about how to implement it in code.
The original description suggests putting "(all languages)" on the Image field label to indicate the image will be synchronized to all language versions. And we're indicating the "Alternative text" is translatable by adding nothing to it's label. However, in pratice that looks like this (real Drupal 8 site mod'ed slightly with Firebug):
The potential problem is from a UX perspective, is that it looks like the "(all languages)" concerns everything in the Image field, including the "Alternative text"!
Maybe we should mark translatable sub-fields with "(translatable)" when not everything is? So, something like this:
Or maybe the "(all languages)" bit should appear somewhere else, closer to the thumbnail so it's clearer that this affects only the image file?
In any case, once I know what should actually be done, I'd be happy to take a stab at the initial patch. :-)
Thanks in advance for any feedback!
Comment #6
dsnopekEr, I didn't mean to add accessibility. :-)
Comment #7
dsnopekEr, what is going on with tags! I just want them to remain as they were when I got here. Sorry for the mess...
Comment #8
dsnopekAnd fixed my type-o in the title. Double extra sorry for the mess! ;-)
Comment #9
dsnopekJammed with YesCT on this! Here are mock-ups of the 3 most reasonable states of the translation add/edit form...
Case #1: Nothing on the image field is translatable, it will be the same for all languages:
Case #2: Only the Alternative text is translatable, the File will be the same for all languages:
Case #3: Everything (both the File and the Alternative text) are translatable:
This issue is to make this happen! I'm going to take a stab at it...
Comment #10
dsnopekI didn't create mock-ups for the some of the possible configurations that don't make sense. Here is an issue to decide if we should actually disallow these insane configurations: #1938422: When configuring which parts of an image field are translatable, should we allow insane combinations?
Comment #11
dsnopekJammed some more with YesCT and decided that Case #2 still doesn't make the reality of the configuration very evident to users. That is:
The one idea we had was to put a message above or below the field when the images were re-ordered or an image was removed. This would be similar to the message from core/misc/tabledrag.js that tells you that weight changes won't be saved until the form is submitted.
The goal is: we don't want to users to be surprised when suddenly the image field changes for all languages and they didn't expect it.
Comment #12
gábor hojtsyI think printing a message AFTER the file was removed might be too late. Reordering you can fix, but file remove you cannot. So maybe a permanent description for that case too?
Comment #13
dsnopek@Gábor Hojtsy: Yeah, you're right... The question is where to put that? Below every "Remove" button? That seems ... not optimal. :-)
Maybe
window.confirm(Drupal.t('Remove this image will remove it for all languages. Are you sure you want to continue?'));or something like that?Comment #14
dsnopekWhile working on this I've kept having to fight with this bug #1938870: After changing the cardinality of the field_image created by the standard profile, images can no longer be uploaded which I've just finished figuring out how to reproduce.
Comment #15
gábor hojtsyYes, a confirm like that maybe on the first one and then not afterwards? Sounds like it could be tedious to always click through all the time. Alternatively change button label to Remove from all translations?
Comment #16
yesct commented@dsnopek Thanks for being so thoughtful with this.
I suggest adding a warning to the "changes in order are not saved until, it's saved" or whatever that message is, to warn that the change will effect every translation.
I also suggest trying #15
when it does remove from all translations.
Lets get a patch in for that and then we can ask for a usability review on it.
Comment #17
dsnopekAbout an hour ago I sat down to finally write this patch and I got stuck on some other bug that's preventing me from uploading images: http://drupal.org/node/1416878#comment-7236512
Unhappy face. :-/
I'll try to get back into this tomorrow!
Comment #18
dsnopekI've attached an initial patch. It desperately needs review!
There lots of ugly things in there where I just don't know the correct approach because I'm not that familiar with all these new systems. For example:
$entity_ng->getPropertyDefinition()how can I tell if a property is a field? Right now, I'm just callingfield_info_instance()and seeing if something gets returned.These are only a few of the many terrible things going on in this patch. ;-)
Oh, and I haven't addressed any of the reordering or remove button stuff yet (discussed in comments #11-13)...
Thanks in advance!
David.
Comment #19
dsnopekForgot to mark as 'needs review'!
Comment #20
gábor hojtsyFunction intros should be on one line. Further explanation should be on another line and an empty line inbetween.
Yeah FAPI will call it back, so it will be called from outside the class. Leave it public and remove this note.
Not yet repeating?
Comment #21
yesct commentedFor someone looking to get involved, doing a manual review and/or posting updated screenshots would be great.
For experienced folks, giving advice on approach that should be used would be helpful.
this is kind of both needs review and needs work. :)
Comment #22
dsnopek@Gabor: Thanks!
Right but I felt it should match it's brother: addTranslatabilityClue(), which is protected. It's in there because FAPI calls entityFormSharedElements(), which is public. Anyway, yeah, consistancy is nice but probably doesn't matter.
Yeah, basically needs the same code for Entity and EntityNG. I've been testing with Node which is EntityNG and didn't want to copy-paste the same code for Entity. I'll refactor to a function so it adheres to DRY in a subsequent patch.
Thanks again for the review!
Comment #23
dsnopekEr, tags always seem to get messed up! Returning to how YesCT had them.
Comment #24
yesct commentedI updated issue summary with steps to test.
Improve those by editing the issue summary and posting a comment with results of what you tried. Anyone can do that.
Comment #25
andymartha commentedHmm, after applying patch sync-hint-1909218-18.patch by dsnopek in #18 to Drupal 8, I ran into a number of errors. See screenshots. Good first start and let's keep trying! I may be doing something wrong too, but I tried to follow all the steps cleanly from the issue steps to test.
Comment #26
dsnopekIn core terms, my patch is *old*. :-) So, I'm not surprised it breaks. I'll try to find some time to get it working with current HEAD.
Comment #27
pixeliteAt the moment, it seems like the patch doesn't add translation hints to the image field. I enabled translation on the article content type and the image field. In the field edit page, I made only the alt text and title text translatable:
Here's a screenshot of the image field (with the image file synchronized and the alt text translatable). I would think we would want to add an (all languages) hint to the image file upload itself and a (language-specific) hint to the alt text label. I've added these to the screenshot in red:
Comment #28
gábor hojtsyComment #29
panchoStraight reroll of #18 after #2024867: Rename translation_entity to content_translation.
Comment #30
panchoIn any case there's more to do.
Comment #30.0
panchoadded steps to test and updated remaining tasks
Comment #31
klonosComment #40
penyaskitoI think I duplicated this in #3152587: Add a mark when editing a field property will affect all the translations as we do with fields themselves. There are some bits here that I like more, and there I workaround-ed a fix for