Auto-translate new Google Drive files with formatting intact
Drop a document in one folder and get German, French, and Spanish copies back, with the original layout, tables, and styling untouched.
Integrations
DeepL
Google Drive
Slack Bot
Type
Categories
- Operations
- Marketing
Every 30 minutes, watch a Google Drive folder for newly added documents and translate each one into our target languages using DeepL's document translation, which preserves the original layout, tables, and styling instead of handing back bare text. I will supply the source folder, the target languages, and the Slack channel. Default the languages to German (DE), French (FR), and Spanish (ES).
Start with Google Drive List Files, scoped to the source folder using Drive query syntax such as '<SOURCE_FOLDER_ID>' in parents and trashed = false, narrowed to files added or changed since the last run with a createdTime or modifiedTime filter. Never descend into the Translated subfolders, and never treat a file that already lives in one of them as a source document.
Before translating anything, list what is already in each Translated language subfolder and skip any source file that already has a counterpart there. Reruns must never duplicate work or burn DeepL quota on a document that was already translated.
Fetch the file bytes with Google Drive Download File Content. If the source is a native Google Doc, Sheet, or Slide, that call will not work, so use Export Google Workspace File first: export Docs to .docx, Sheets to .xlsx, and Slides to .pptx. DeepL document translation accepts .docx, .pptx, .xlsx, .pdf, .txt, and .html, so skip anything outside that set and mention the skip in the recap.
For each target language, send the file to DeepL Upload and Translate Document. The response returns a document_id and a document_key. The key is returned only once, at upload, and cannot be retrieved later, so hold on to both values because the key is required for the status check and for the download.
Poll DeepL Check Document Status with that id and key until the status reports done, waiting a few seconds between checks rather than hammering it. Do not call the download before the status is done, because DeepL rejects an early request for the result.
Then call DeepL Download Translated Document. Downloading a translated document deletes it server side and invalidates the document id, so there is exactly one chance to save each file. Write it to Drive before moving on to the next language or the next document.
Save each translation with Google Drive Upload File (Multipart) into a Translated subfolder per language, creating that folder with Create Folder when it does not exist yet. Name the output after the source file with a language suffix, like contract_DE.docx. Multipart upload covers files up to 5MB; for a larger deck use the resumable upload path instead.
If DeepL reports that the character quota for the current billing period is exhausted, stop translating and say so plainly in the recap rather than failing silently. Calling DeepL Check Usage and Limits at the start of a run is a reasonable way to catch this before uploading anything.
Finish by posting a recap to Slack with Send a Message, listing each file translated, the languages produced for it, links to the new Drive files, and anything that failed with a short reason, including files skipped as already translated or as an unsupported type. If nothing new was found, stay quiet rather than posting an empty recap.
What it does
- Checks your chosen Google Drive folder every 30 minutes for newly added documents.
- Translates each one into German, French, and Spanish, or whichever languages you pick, while keeping the original layout, tables, images, and styling in place.
- Files every translation back into Drive in a Translated folder per language, named like contract_DE.docx so you can find it instantly.
- Posts a Slack recap of what was translated, into which languages, and anything that needs a second look.
What you’ll need
- A Google Drive account and a folder where new documents land.
- A DeepL account on a plan that includes document translation.
- A Slack workspace and a channel for the recap.
- Source files in Word, PowerPoint, Excel, PDF, text, or HTML format. Native Google Docs, Sheets, and Slides are converted for you automatically.
How to customize it
- Change which folder gets watched and how often it runs, from every few minutes to once a day.
- Pick your target languages. German, French, and Spanish are the defaults, and DeepL supports many more.
- Choose which Slack channel gets the recap, or send it to one person as a direct message.
Use cases
- Document Processing
- Content Generation
- Data Sync