Problem/Motivation
Drupal 8 installer in a non-English language exposes too much translation complexity without really adding value to the end-user. This gives the translation tasks too much weight and adds to a picture that interface translation was something incredibly complex and heavyweight with Drupal. While to some extent this might be true in code, it shouldn't be in the UI.
Proposed resolution
Merge "Translate Configuration" and "Finish Translations" steps.
Remaining tasks
Review, Commit.
User interface changes
One step less in installer in non-English installations.
Before
After
API changes
None.
Beta phase evaluation
Prioritized changes | The main goal of this issue is usability in the installer to make it less intimidating. |
---|---|
Disruption | Non disruptive for core/contributed and custom modules/themes. Contributed install profiles may need to change but only if they add tasks relative to the one removed or provide a replacement for the ones modified. We are not aware of such install profiles in existence ATM. There is also an API addition to support a list of batches instead of just one batch in installer tasks to support this change. |
Comment | File | Size | Author |
---|---|---|---|
#55 | interdiff.txt | 565 bytes | Gábor Hojtsy |
#55 | install-merge-translate-tasks-1993452-55.patch | 8.75 KB | Gábor Hojtsy |
#53 | interdiff.txt | 3.54 KB | Gábor Hojtsy |
#53 | install-merge-translate-tasks-1993452-53.patch | 8.67 KB | Gábor Hojtsy |
#45 | after-merge-Spanish.jpg | 203.88 KB | bannorb |
Comments
Comment #1
Gábor HojtsyI think at least putting them into a consecutive batch for a start would be great. I don't think reworking the batch API at this point in time is useful.
Comment #2
PanchoOkay, so here's the patch.
Quickly tested and seemed to work, but don't know if it's ready for review.
Comment #3
PanchoRead all documentation and found out that the Batch API should support most everything we want. So we can do better, even if the test says green.
Comment #4
Gábor Hojtsy@Pancho: still working on this? I think would be a great improvement!
Comment #5
PanchoThanks for the reminder, @Gábor.
Yes, I think I have a 95% working patch. I'm gonna take another look at it tonight.
Comment #6
Gábor HojtsyYay, thanks!
Comment #7
PanchoIt unfortunately wasn't 95% working, and digging through the quite messy code of the locale subsystem is a bit cumbersome, but I'm gonna finish it ASAP.
Comment #8
jair CreditAttribution: jair commentedNeeds reroll
Comment #9
Albert Volkman CreditAttribution: Albert Volkman commentedRe-roll.
Comment #11
Gábor HojtsyDoes not pass anymore unfortunately :/
Comment #11.0
Gábor Hojtsyfix
Comment #12
Sutharsan CreditAttribution: Sutharsan commentedPatch #9 rerolled.
Comment #14
Sutharsan CreditAttribution: Sutharsan commented12: install_merge_translate_tasks-1993452-12.patch queued for re-testing.
Comment #15
Alumei CreditAttribution: Alumei commentedRe-rolled patch from #12 still applies successfully.
Comment #16
Alumei CreditAttribution: Alumei commented12: install_merge_translate_tasks-1993452-12.patch queued for re-testing.
Comment #17
Gábor HojtsySo I wanted to post an even more horror screenshot but that turns out it is actually due to more steps added in the multilingual demo profile :D This would have been it:
Comment #18
Sutharsan CreditAttribution: Sutharsan commentedThis is horror indeed. Needs reroll too.
Comment #19
basvanderveen CreditAttribution: basvanderveen commentedI will try to reroll this patch
Comment #20
Gábor HojtsyYay #drupalhugs :)
Comment #21
rvilarAttached a new patch rerolled from the latest one.
Installation tested and completed, but the steps are not merged.
Comment #23
rvilarSorry, I've attached the wrong patch. Now I attach the correct one.
Comment #24
YesCT CreditAttribution: YesCT commentedapplies, so removing the needs reroll tag.
Comment #25
YesCT CreditAttribution: YesCT commentedI read through this and it makes sense.
I noticed two nits: some trailing whitespace and a comment that got changed and was over 80 chars. just fixed those two things.
Did not yet try this manually.
Comment #26
bwinett CreditAttribution: bwinett commentedI installed Drupal on simplytest.me both without the patch and with the patch. I selected Spanish as the language.
Before the patch, the steps were (I include translations in parentheses):
After the patch, the steps were (I include translations in parentheses):
Comment #27
Gábor HojtsyNice and simple solution that it changes the batch return API slightly to allow for multiple batches. This may have been useful at other translation tasks before, but oh well :) Good now too. Except:
Batch definition*s*, no? (This seems to use good grammar at other instances).
Let's not loose this advantage from before that we processed all languages not just the active language used for translation.
Same here. Keep processing all languages not just the install state language. The reason this is not failing is because the test coverage does not have a config string translataed. See InstallerTranslationMultipleLanguageTest and InstallerTranslationMultipleLanguageForeignTest. If the .po file includes a config value translation as well (from something the system module installs, eg. name of anonymous user), then that would fail on this change. That would actually test this step well too. Adding needs tests tag for this. Should be easy by adding a couple lines to those two tests (to the sample .po file and the assertion to assert with the config API).
Comment #28
Gábor HojtsyThese are minor things, can someone help with them?
Comment #29
Gábor HojtsyThis is theoretically that test.
Comment #31
Gábor HojtsyPHP errors.
Comment #32
penyaskitoIn terms of code and accuracy to the issue summary, this looks good to me. Tested it and works fine.
However, the installations steps still look confusing:
Finish translations? Maybe we can find a better copy?
Comment #33
Gábor HojtsyIs that translation configuration step the very first one? I mean there is only a configuration step for languages :)
I agree the 'Finish translations' step could be named better but that is an existing name with or without this patch. All this patch does is it folds one more step into the finish step :)
Comment #34
penyaskitoNot the first one, those were the three last ones.
Yep, the naming is probably another issue on its own. Let's move forward.
Comment #35
penyaskitoComment #36
penyaskitoComment #37
vijaycs85Looks good. +1 to RTBC
Hope we don't need a CR as it is not 7.x?
Comment #38
Gábor Hojtsy@vijaycs85: No, its a bugfix modifying only internal functions. These are not an API.
Comment #40
Gábor Hojtsy"General error: 2006 MySQL server has gone away"
Comment #42
Gábor HojtsyAssuming no random fail now.
Comment #43
YesCT CreditAttribution: YesCT commenteda recent before and after in the summary would be nice.
Comment #44
Gábor HojtsyUpdated screenshot.
Comment #45
bannorb CreditAttribution: bannorb commentedI tested this through the simplytest.me in Hungarian (Magyar). I noticed the translation for numbers 6 and 8 are the same. I tested in Spanish and matched the results of @bwinett in comment #26.
This seems to fine to me. I don't think it's a problem that the Hungarian translates into the same words for numbers 6 and 8.
Comment #47
bannorb CreditAttribution: bannorb commentedTestbot failed because:
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Setup environment: failed to create checkout database.
Sending for retest.
Comment #49
bannorb CreditAttribution: bannorb commentedThis was already rtbc in comment #34, something happened with the testbot, retested and the test came back pass/green. I'm marking it rtbc again.
Comment #50
alexpottLooks like hook_install_tasks() documentation needs to be updated. But I'm not sure that the solution is correct - it seems odd to return an array of batches. Is there no way of combining install_import_translations_remaining and install_update_configuration_translations in a way that does not result in an install API change?
From the beta evaluation is not correct. Any install profile that adds a batch step would need to change.
Comment #51
Gábor Hojtsy@alexpott: it is an install API change either way because what the returned steps do would change. Also the list of steps would change, so those adding steps inbetween them would need to be aware as well. We tried above to just make the last language step hidden, but then no progress information is displayed on the tasks so this is not useful for long running things.
The issue summary mentioned modules and themes. They cannot add batch steps in the installer. It is true the issue summary did not mention install profiles, and they would need to adapt.
Updated the issue summary. I think the code will be considerably uglier if we are to flatten the batch but will look into that one.
Comment #52
Gábor HojtsySorry I had an outdated memory of the API changes proposed in this patch. Duh. Looking into flattening that batch then.
Comment #53
Gábor HojtsyOk, so looking at the batches to flatten them out, the problem is manyfold. Both batches have their unique callbacks, temporary data and finished callbacks. We could write a post-processor to process those batch arrays into one and create a finished callback that calls back other finished callbacks but not sure implementing that for the protection of the installer API is sane? Also, we can modify the locale batches themselves, but then an installer UX fix spills into locale API changes (IMHO worse than installer API changes).
Let's shoot for allowing arrays of batches in the installer then, which is an API addition for the installer API. As mentioned before we cannot avoid removing an installer step or still returning the same thing from this step that we modify.
Also updated the summary again, should now be correct with the current patch.
Comment #55
Gábor HojtsyOf course the batch is an array, we need to detect a batch vs. a list of batches instead.
Comment #56
penyaskitoPatch works correctly, and reviewed the code and didn't find anything to complain about.
I'm wondering if we need a change record for the API addition.
Comment #57
Gábor HojtsyAdded a mini change notice for the mini API addition. Not sure it is a good idea to document API additions on this small scale, but it will not hurt to have it ready just in case :) https://www.drupal.org/node/2401825
Comment #58
penyaskitoRTBC then. Leaving the publication or not of the change record at committer discretion.
Comment #59
alexpottCommitted 0410129 and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation for to the issue summary.
We are not simulating anything. Fixed on commit.
Comment #61
Gábor HojtsySuperb, thanks a lot! Published the change record at https://www.drupal.org/node/2401825