- Issue created by @Harshita mehra
- Status changed to Needs review
over 1 year ago 12:19pm 29 June 2023 - last update
over 1 year ago 9 pass - 🇮🇳India Harshita mehra
Hello Maintainers,
I have provided a patch to fix this issue.
Kindly review it.Thanks!
- 🇮🇳India Raveen Kumar
@Harshita,
a) I have reviewed the code in the patch. The warning message you mentioned is related to Drupal coding standards and best practices. In Drupal, when working with translations, it is recommended to use the $this->t() method instead of the global t() function within classes.b) By using $this->t() instead of t() within classes, you ensure that the translation service is properly injected and available for use. It also improves the testability and maintainability of your code.
Your Patch is good to go. And Thank you.
- Merge request !8Issue #3371326: Replace the t() calls to $this->t() in classes. → (Merged) created by Unnamed author
- last update
over 1 year ago 9 pass - Status changed to RTBC
over 1 year ago 6:04am 30 June 2023 - 🇮🇳India Akshay kashyap
@Harshita mehna
Thanks for the work.
I have reviewed and tested #2 It is applied successfully and looks good to me. This patch: Remove t() and add $this->t() in the "MenuTrailByPathSettingsForm.php" file.
I have attached the before and after images. Please check.
Moving to RTBC
- Status changed to Needs work
about 1 year ago 10:04pm 29 November 2023 - 🇨ðŸ‡Switzerland berdir Switzerland
This is using $this in a static method, so that definitely doesn't work.
- Assigned to nitin_lama
- last update
about 1 year ago 9 pass - Issue was unassigned.
- Status changed to Needs review
about 1 year ago 12:22pm 1 December 2023 -
berdir →
committed 35137a88 on 2.x authored by
Raveen Thakur →
Issue #3371326 by Harshita mehna, nitin_lama: Replace the t() calls to $...
-
berdir →
committed 35137a88 on 2.x authored by
Raveen Thakur →
- Status changed to Fixed
4 months ago 9:37pm 22 August 2024 Automatically closed - issue fixed for 2 weeks with no activity.