Skip to content

Resolve DRUP-317 "Files attachments"

p requested to merge DRUP-317-files-attachments into 8.x-9.x

New TMGMT's feature support (file attachments translation):

  1. Introduced callback controller for downloading file attachments (/tmgmt-smartling-callback/{job}/{file})
  2. Callback controllers (download file and download attachment controllers) schedule for download into the download queue instead of downloading right away.
  3. Requesting translation for a Drupal node (entity) also requests all attached files to the node/entity. TRs/TSs for attachments are created (one TMGMT Job can result in N TRs now). TRs for attachment have asset key as {"file_id": "79", "tmgmt_job_id": "44"}, TRs for source content are not changed - {"tmgmt_job_id": "44"}. File name for source file stays the same as - JobID<N>_<source_locale>_<target_locale>.xml, file name for attachments has pattern as JobID<N>_<source_locale>_<target_locale>_<attached_file_name>.<attachment_extension>.
  4. Introduced tmgmt_smartling_attachment_filename_alter hook for altering attachment file name (the same as tmgmt_smartling_filename_alter hook).
  5. Refactored TranslationRequestManager - all the methods related to TRs (upsert/get/search) now can work with files if additional parameter is passed.
  6. Now module requires TMGMT Extension Suit >= 8.x-9.3 because it needs updated ExtendedTranslatorPluginInterface (it introduced methods for file attachments like isAttachmentReadyForDownload, downloadAttachmentTranslation, and getAttachmentFileName).
  7. Deleting TMGMT Job in Drupal results in deleting not only own source file, but also related file attachments.
  8. Refactoring: used FlowScheduler service provided by TMGMT Extension Suite for scheduling source/attachments for uploading/downloading instead of manually composing queue items data.

Merge request reports

Loading