- Issue created by @unqunq
- π¬π§United Kingdom unqunq
I haven't tested recently so unless you are aware of a duplicate ticket this is still an issue.
- π¬π§United Kingdom MrDaleSmith
Can confirm the issue exists, and is because the entire translation process has been coded on the assumption that all fields have only one translatable string that is contained in a "value" key. As the text with summary field stores any custom summary in a "summary", this gets skipped.
The solution would seem to be to create a specific FieldTextExtractor plugin that specifically handles text_with_summary field types for pushing the data into the translated field, but we will also need to make changes to the AiTranslateController so that it actually translates both values: I wonder if we should include in the extractor plugins some kind of field template that the controller can use to identify what values need to be sent for translation? Otherwise we might need to include a lot of if statements in translateSingleText().
I'm a little nervous of doing anything with this until https://www.drupal.org/project/ai/issues/3478721 π Discuss: Unify translate operations over ai Active (and possibly https://www.drupal.org/project/ai/issues/3480683 π Use core Json::encode() and Json::decode everywhere possible Active ) have been merged, however. We may be best to postpone whilst those are reviewed?
- πΊπΈUnited States apmsooner
Adding related issue: https://www.drupal.org/project/ai/issues/3529802 β¨ Don't hardcode 'value' key for textual field translation Active . What was merged however will not immediately solve this as the TextFieldExtractor is still just hardcoding the 'value' property. The proper fix would be to use the new '_columns' property similar to what I did in the related custom_field patch (https://git.drupalcode.org/project/custom_field/-/merge_requests/137.diff) so that for that particular field type the 'summary' property would also get translated. Similarly, the link, image, and file field types should be addressed in their own plugins to account for the translatable properties. Basically any field types that have translatable properties other than 'value' would need plugins created.
- πΊπΈUnited States apmsooner
Handled in https://www.drupal.org/project/ai/issues/3531717 β¨ Add text extractor plugins for image and link field types Active . Please help test the patch.