Closed (duplicate)
Project:
Drupal core
Version:
9.0.x-dev
Component:
views_ui.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
22 Jan 2020 at 11:50 UTC
Updated:
23 Mar 2020 at 22:17 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
hardik_patel_12 commentedKindly review a patch.
Comment #3
hardik_patel_12 commentedComment #4
naresh_bavaskarLooks fine.
Comment #5
alexpottThere's usages of
t()inthat can be converted to $this->t().
The usage in core/modules/views_ui/src/ViewUI.php can't be changed because this class is not injectable with services atm.
Also I suspect there is a meta issue for fixing all the usages of t() where appropriate that this should linked to and checked that it is following the scope agreed on that issue.
Comment #6
hardik_patel_12 commentedConverted t() with $this->t() in more files of views_ui module.Kindly review a new patch.
Comment #7
hardik_patel_12 commentedComment #8
naresh_bavaskarComment #9
naresh_bavaskarLooks fine for me.
Comment #10
andypostCreated Meta issue as #5 suggested
Also fixed CS and replaced usage in
core/modules/views_ui/src/ViewUI.phpComment #11
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!