Loading
Decouple component_tree translation logic from TMGMT
The logic that extracts a component tree's translatable strings and writes translations back is moved out of ComponentTreeFieldProcessor (which extends a tmgmt_content class, so it only loads with TMGMT installed) into a standalone ComponentTreeTranslator service under src/Translation/. ComponentTreeFieldProcessor becomes a thin TMGMT adapter that delegates to it. ComponentInputsTranslatablesExtractor moves to src/Translation/ alongside it. Behavior is unchanged; code is moved, not rewritten.
This is needed to avoid duplication in https://git.drupalcode.org/project/canvas_translate
AI-Generated: Yes (Used Claude Code (Claude Opus) to perform the extract/move/rewire, write the new kernel test, and run the test suite).
Testing instructions
- Check out the MR branch.
- Run the new TMGMT-free guard test (passes with no tmgmt installed):
composer run phpunit -- tests/src/Kernel/Translation/ComponentTreeTranslatorTest.php - Confirm existing translation behavior is unchanged:
composer run phpunit -- tests/src/Functional/ContentWithComponentTreeTmgmtUiTest.phpcomposer run phpunit -- tests/src/Functional/ConfigWithComponentTreeTmgmtUiTest.php
Closes #3591754
Edited by Lauri Timmanee