Make i18n string extraction ignore strings in test case files

Summary:
Do not extract strings from test case files for localization / translation.
They are not exposed to users, and localizing wastes translators' time.

Closes T15815

Test Plan:
* Install Wikimedia downstream `translations` extension via `git clone https://gerrit.wikimedia.org/r/phabricator/translations` and put it on the same filesystem level as `phorge` and `arcanist`, and follow https://we.phorge.it/w/docs/extensions/install/
* Apply https://gerrit.wikimedia.org/r/c/phabricator/translations/+/1028887 on top, to make the `translations` extension work with upstream Phorge.
* In the downstream `translations` extension path, run `./export.sh`, then run `grep -r "__tests__" .` and get a list of `qqq.json` files with context for strings from test files.
* Apply this patch.
* In the downstream `translations` extension path, run `./export.sh`, then run `grep -r "__tests__" .` to verify that no `qqq.json` files include any strings from test files anymore.

Reviewers: O1 Blessed Committers, aklapper, avivey

Reviewed By: O1 Blessed Committers, aklapper, avivey

Subscribers: avivey, aklapper, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15815

Differential Revision: https://we.phorge.it/D25624
这个提交包含在:
Perry 2024-05-08 10:48:27 -04:00 提交者 root
父节点 af300016b6
当前提交 29cbb0a658
共有 1 个文件被更改,包括 1 次插入0 次删除

查看文件

@ -277,6 +277,7 @@ final class PhabricatorInternationalizationManagementExtractWorkflow
->withType('f')
->withSuffix('php')
->excludePath('*/.*')
->excludePath('*/__tests__/*')
->setGenerateChecksums(true)
->find();