- Issue created by @mkalkbrenner
- 🇧🇪Belgium svendecabooter Gent
Those seem like some valid points and good improvements to the AI translation system to me.
To implement some of those, some major refactoring might be needed to the AI Translate system, so not sure if they would all be easily doable.Currently the field data gets extracted from the entity, based on the field type of each field.
The 3rd party settings available on a field could be leveraged to configure this some more.
E.g. the ReferenceFieldExtractor plugin already does this, to decide whether to translate a certain entity_reference field or not.
Extending this with the option to "optionally disable translation per field" seems fairly doable.An optional prompt per field is something that would need to be passed along in the metadata of the extracted field values, towards the TextTranslator service. This should also be possible, but would complicate the already somewhat complex array structure of this even more.
Switching providers per field would work in the same way. Actually the \Drupal\ai_translate\TextTranslator::translateContent() method already has a context array parameter implying in the documentation that should be possible, but the implementation code doesn't do anything with it.
We should probably provide a decent framework where configurable context can get passed along during the translation pipeline (text extraction, AI service calling, translation saving), and more events get triggered, so other contrib modules could plugin into that and provide extra tools - if not provided with the ai_translate module itself.
I think this request should probably need some more analysis, and be split out into separate subtasks.
- 🇩🇪Germany mkalkbrenner 🇩🇪
Thanks for considering this.
To get things going, I started working on another contrib module on top of ai_translate.
Maybe we could treat that one as incubator and intermediate solution before moving parts back into ai_translate.
I'll publish that module as soon as the basic stuff is working. - 🇩🇪Germany mkalkbrenner 🇩🇪
BTW, one it is working, I consider to enhance search_api_clir to use it.