Per analysis at T363215
Upstream task: https://we.phorge.it/T15815
Per analysis at T363215
Upstream task: https://we.phorge.it/T15815
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | Pppery | T363364 Phabricator-translations should not extract strings from test cases | |||
Resolved | brennen | T368453 Update to Phorge upstream 2024.19 release |
Surprisingly, the code that does this is upstream:
I think adding ->excludePath ("*/__tests__/*") after https://we.phorge.it/source/phorge/browse/master/src/infrastructure/internationalization/management/PhabricatorInternationalizationManagementExtractWorkflow.php$279 would work, but not sure what upstream uses that workflow for, if anything, and what their view on the matter is.
Or I guess I could propose that exact patch on Wikimedia Gitlab if you don't want to wait for upstream.
Thanks for investing! IMO upstream first makes sense so I filed a ticket at https://we.phorge.it/T15815 , and after applying https://gerrit.wikimedia.org/r/c/phabricator/translations/+/1028887 in a local upstream Phorge checkout I can confirm your one-liner patch does what it should, yay.
@Pppery: Would you like to propose your one-liner in upstream, or do you want me to do that?
Quick commit message proposal for upstream:
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.
I vaguely hope that in late May or in June we'll pull/rebase a more recent Phorge upstream release into Wikimedia Phabricator (because still quite some downstream cleanup work on my list first, once I get to it among a bunch of other things). So I'd wait for upstream here ideally
For the records, we just pulled and deployed the 2024.19 upstream version in Wikimedia Phabricator.