Closed (duplicate)
Project:
Drupal core
Version:
9.0.x-dev
Component:
update.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Jan 2020 at 06:02 UTC
Updated:
23 Mar 2020 at 22:18 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
hardik_patel_12 commentedKindly review a new patch.
Comment #3
hardik_patel_12 commentedComment #4
Rangaswini commentedComment #5
Rangaswini commentedThank you @Hardik_Patel_12
Above patch LGTM
I have tested the patch, doesn't break any text message as shown in screenshots.
Comment #6
dwwThis can't be RTBC if the bot can't even apply the patch. ;)
Comment #7
longwavePrevious test was against PHP 7.2 but minimum dependency on 7.3 went in since, so retesting on 7.3; RTBC if it passes this time.
Comment #8
dww@longwave re: #7: Ahh, right, makes sense.
Reviewed #2. Changes seem fine.
After applying the patch, the "only" uses of a raw
t()(not$this->t()) are either in the tests/* subdir, or in the following files:DI isn't available in any of those, so I think this patch gets us as far as possible (for now). See also #3100110: Convert update_calculate_project_update_status() into a class for t() conversion while moving some of that procedural code into classes.
Therefore, +1 to RTBC, assuming the bot is happy (which it should be).
Also, added an actual issue summary here and simplifying the title for a better commit message.
Thanks!
-Derek
Comment #9
dwwNot sure what happened to the title change I tried to do in #8. Trying again. ;)
Comment #10
alexpottComment #11
alexpottLet's fix test module code too whilst we at it...
\Drupal\update_test\TestFileTransferWithSettingsForm::getSettingsForm - this will need to use the string translation trait because it is not a real form :) - hmmm actually that asks a deeper question about whether or not \Drupal\Core\FileTransfer\FileTransfer should use the trait. I guess it should be that should be a separate issue.
Can someone create the follow-up and add to the parent issue - and then we can proceed here.
Comment #12
jungle\Drupal\update\Tests\FileTransferAuthorizeFormTest should be \Drupal\Tests\update\Functional\FileTransferAuthorizeFormTest
It's out of the scope of this issue, so I did not touch it.
Comment #13
jungleIssue created as #11 asked
Comment #14
xjmThanks for working on this.
In general, issues should not be scoped by file or module; instead, they should be scoped by making the exact specific change across as much of core as possible. Reference: https://www.drupal.org/core/scope#files
In particular,
t()calls should be replaced based on whether the translation service is already available in the class, and more specifically, based on which base class it extends. (So, for example, one issue for form builders, one for controllers, one for list builders, and then splitting that up further only if the resulting patch is too large to be manageable.) We also need to decide the approach before we proceed with child issues. See #3113904: [META] Replace t() calls inside of classes for more discussion. So, closing as a duplicate of the parent issue in #3113904: [META] Replace t() calls inside of classes .Thanks!