Problem/Motivation

Deepl supports the translation of specific file types, see https://developers.deepl.com/docs/api-reference/document

Proposed resolution

Support translation of documents

Remaining tasks

  1. Write a merge request
  2. Review
  3. Commit

User interface changes

To be determined.

API changes

To be determined.

Data model changes

To be determined.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

idebr created an issue. See original summary.

steffenr’s picture

Version: 2.2.x-dev » 2.3.x-dev
steffenr’s picture

@idebr: If you are still interested in the issue, you may provide more information on what should be taken into account.
By means of the documentation, the task of translating documents is related to "real files", which are uploaded to drupal.
I'm not sure, if this is even possible within tmgmt.

steffenr’s picture

Priority: Normal » Minor
idebr’s picture

My project requirement is pretty basic:
- Upload a file in a node
- Automatically translate the file when translating the node using Deepl

This is supported by tmgmt, see #2276825: Translate files / attachments

The priority for automatic translations for documents in my project has been lowered, so I don't expect to do any development on this feature in the short term

idebr’s picture

Status: Active » Needs work

TMGMT enables additional settings when a translator plugin includes "files = TRUE" in its annotation

I will continue to iterate on this issue next week.

idebr’s picture

Status: Needs work » Needs review
  1. Translatable files are now added as a separate batch operation per file, see \Drupal\tmgmt_deepl\DeeplTranslatorBatchInterface::translateDocumentOperation
  2. A document is translated by Deepl through \Drupal\tmgmt_deepl\DeeplTranslatorApiInterface::translateDocument
steffenr’s picture

It would be nice, if you could add testing instructions on how to use the document translation.
I think i'll find some time next week for further testing - right now i'm heavily involved in projects at work.

idebr’s picture

TMGMT supports translation of files on a conceptual level, see https://www.drupal.org/node/3392215

The mimetypes that should be translated can be selected at /admin/tmgmt/settings under 'File translation'

Assuming you have a working setup with nodes, you can add a 'File upload' field to the content type and check the option 'Users may translate this field' in the field settings.

idebr’s picture

DeeplTranslatorBatch:: getTranslationOptions() is a bit messy right now since the settings priority is currently not implemented (Job settings > Translator settings > Translator plugin defaults). I filed a follow-up issue to start smoothing this out, see #3544849: Provide sensible default settings

  • steffenr committed 04ac6f08 on 2.3.x authored by idebr
    Issue #3494249: Support translation of documents
    
steffenr’s picture

Status: Needs review » Fixed
StatusFileSize
new389.29 KB
new416.27 KB

I've build up a simple setup with a basic content type containing a translatable file field.
After attaching a PDF file and hitting the translation workflow the PDF is being translated without issues.
The translated file gets attached to the translated node and results look fine. DeepL is doing a good job while translating and keeps the structure/ formatting of the document.
I've attached the PDF as an example in here.

The MR will be merged into 2.3.x.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.