[meta] Remove usage of t() in tests not testing translation

Created on 5 May 2020, over 4 years ago
Updated 25 August 2024, 3 months ago

Problem/Motivation

There is no need to use t() in tests, unless we're testing translations, however in core we do not follow this consistently, which does not set a good example for new contributions.

A rough estimation, adapted from that one of @longwave 🐛 Fix label visibility and add wrapper container for exposed numeric/date filters with multiple form elements Fixed , shows that here are 4247 instances of this as of 22b08be669260979ec6a45676b16be79c89719eb:

$ find core -type f -iname '*Test.php' | xargs grep '[^a-zA-Z]t(' | wc -l
4247

We will need to ensure to leave t() where the test actually tests the translation system.

Proposed resolution

Scan through the list generaged by find core -type f -iname '*Test.php' | xargs grep '[^a-zA-Z]t(' > remove_t_list.txt
Remove any usages of t() if the test is not testing the translation system.

Remaining tasks

  1. Get confirmation about the scope from committer(s) - split up the task by core module or subsystem or something else?
  2. Do it.
  3. Review it.
  4. Commit it.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

N/A

📌 Task
Status

Active

Version

11.0 🔥

Component
Other 

Last updated about 13 hours ago

Created by

🇪🇸Spain Manuel Garcia

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024