Extract `scripts` and `support` dirs alongside the library.
Summary:
Fixes T16387
I thought for a long time about how to do this, including at various points considering:
- Making the code work on directories instead of libraries
- Adding a `--nolib` or something like it to do that
- Adding a `--extradirs` argument instead of hardcoding `scripts` and `support`
In the end, though, I went with this. The reason is that this script has (AFAIK) two consumers:
- `bin/i18n validate` (from D26572)
- WMF downstream code to provide source strings to translatewiki.net
WMF downstream code doesn't care how it gets the strings to use (there's a script that passes various sets of arguments), but `bin/i18n validate` does. It works by taking all loaded libraries and running extractions on them, and assumes that provides all of the strings it cares about. For that to work, there has to be one canonical way to extract strings from a library, and this is it ...
Test Plan:
- Run `bin/i18n extract`
- See more strings inside `src/.cache/i18n_strings.json`
Reviewers: O1 Blessed Committers, aklapper
Reviewed By: O1 Blessed Committers, aklapper
Subscribers: aklapper, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T16387
Differential Revision: https://we.phorge.it/D26606