1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +01:00

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
This commit is contained in:
Perry 2024-05-08 10:48:27 -04:00 committed by root
parent af300016b6
commit 29cbb0a658

View file

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