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.
After #1838310: Remove st(), get_t() and $t for good landed, the pre-bootstrap translation of installer interface doesn't seem to catch the default language, so doesn't actually translate the interface.
Comment | File | Size | Author |
---|---|---|---|
#21 | drupal-installation_translation-2022549-21-justtests-shouldfail.patch | 5.28 KB | valdo |
#21 | drupal-installation_translation-2022549-21.patch | 6.52 KB | valdo |
#21 | interdiff-2022549-19-21.txt | 1.43 KB | valdo |
#19 | interdiff-18-19.txt | 1.3 KB | YesCT |
#19 | drupal-installation_translation-2022549-19.patch | 6.57 KB | YesCT |
Comments
Comment #1
PanchoAdding tags.
Comment #2
ParisLiakos CreditAttribution: ParisLiakos commentedregression means critical
thanks for opening this Pancho
Comment #3
ParisLiakos CreditAttribution: ParisLiakos commentedthis should fix it...my bad, tags are useless in first steps of installer:/
Comment #4
Gábor HojtsyBring on D8MI sprint, add ui tag.
Comment #5
Tor Arne Thune CreditAttribution: Tor Arne Thune commentedThat did it :)
Comment #6
effulgentsia CreditAttribution: effulgentsia commentedIs it possible for a test to be written for this? I think some things have been committed to HEAD in the last month that make testing the installer possible, at least in theory, but maybe not fully in practice? If it's not possible, then a comment explaining why and linking to what issue is needed to make it possible would help. Thanks.
Comment #7
ParisLiakos CreditAttribution: ParisLiakos commentedi cant make it work...i can make a test fail because of it, but i cant make it pass, the semaphore table blows up, any help appreciated
Comment #8
YesCT CreditAttribution: YesCT commentedComment #10
valdo CreditAttribution: valdo commentedI have partially fixed the problem with the test in #7, the semaphore exception issue doesn't happen anymore, but there is still a @todo in the code - I'm temporarily using hardcoded translated string for "Save and continue" submit button, because the t() is not available early in the installation. This is not very nice because the translation can change and if that happens the test would fail.
I have discussed this with ParisLiakos, we will try to fix this tomorrow.
The attached patch now includes both fix and the test. It's not 100% ready yet, but let's see if it passes.
Comment #11
valdo CreditAttribution: valdo commentedLet's test this.
Comment #13
valdo CreditAttribution: valdo commented#10: drupal-installation_translation-2022549-10.patch queued for re-testing.
Comment #14
valdo CreditAttribution: valdo commentedFixed the issue mentioned in #10 - now we use xpath to get the submit button's value. Please review.
Comment #15
valdo CreditAttribution: valdo commentedThere is also another change in the test compared to the parent InstallerTest class. The installer form submission test now follows the user experience - in first step the language is selected and submitted, then profile is selected on the next page, which already uses the selected translation.
Comment #16
valdo CreditAttribution: valdo commentedDiffs attached:
interdiff-2022549-7-14.txt
- git diff between applied #7 and #14diff-InstallerTranslationTest-InstallerTest.txt
- diff between new test InstallerTranslationTest and its parent class InstallerTest.Comment #17
YesCT CreditAttribution: YesCT commentedThis seems not really to describe what the test is doing.
The test is just checking that on the page right after selecting a language, that the second page is not in english (kind of like, that it's in the language picked)
A.
The assert is actually just checking that those English phrases are not there.
So if another change, changes the phrasing of those english phrases, this test will fail.
It's ok for now I think. But maybe we should point out that we are not actually checking if it's translated to German, we are checking that it's not in english.
B. Why are we asserting two things? I think checking that one thing is not in English is enough to show the page was translated.
C. Why do we continue with the tests after the assertion?
We talked about this, and because if we take out the rest of the test, there is an exception. I think the tests expect the installation to succeed?
D. Since we are continuing, I suggest adding a comment to explain why we go on clicking continue even after we know the the pages are not in English.
Comment #18
valdo CreditAttribution: valdo commentedImplemented suggested changes.
Comment #19
YesCT CreditAttribution: YesCT commentedI just noticed one german was lowercase and one German uppercase.
This fixes that.
I also changed a contraction to be the two words so it is clearer. (I think we try and do that.)
This has tests, removing the needs tests tag.
Comment #20
Sutharsan CreditAttribution: Sutharsan commentedI have reviewed the patch, not tested it. Only one comment:
Using 'translations.use_source' is not required here. The installer uses the local file, and otherwise will try to download the remote. This setting is not used by the installer.
Comment #21
valdo CreditAttribution: valdo commentedI have removed 'translations.use_source' as per Sutharsan's remark.
There was also a bug in the test which just appeared, because of which the "drupal-installation_translation-2022549-19-justtests-shouldfail.patch" passed but was supposed to fail. The "Save and continue" text is the text value of the submit button and this was obviously not properly asserted using the assertNoText() method. I have replaced back with the "Set up database" string as in the original patch.
I have fixed and updated both, patch test with fix and patch test without fix.
Comment #22
YesCT CreditAttribution: YesCT commentedThis works, makes sense, and the test bot agrees and the code looks good.
Comment #23
ParisLiakos CreditAttribution: ParisLiakos commentedwell lets get this in, i dont think we can have a better test than that
Comment #24
alexpottCommitted 2a993a8 and pushed to 8.x. Thanks!
Comment #26
Gábor HojtsyYay!