notion-deepl is a CLI tool to translate Notion pages with Deepl
go install github.com/Kwintenvdb/notion-deepl
You can use this CLI tool to translate Notion pages (or blocks) using the DeepL API.
- Go 1.18+
- A DeepL API key. A free API subscription is sufficient.
- A Notion API key. You will need to create your own Notion integration and enable it for the pages you wish to translate.
This tool was developed mostly for personal usage. As a result, several limitations exist at this moment:
- Formatting and rich text markup are mostly not preserved.
- Databases cannot be translated, though individual database pages can be.
- Tables cannot be translated.
- Blocks are currently translated in sequence. This may be further optimized in the future, but is currently limited by Notion's rate-limiting.
Usage:
notion-deepl [flags]
Flags:
-b, --block-id string The Notion block ID to translate (required)
-d, --deepl-api-key string DeepL API key (required: if not provided, the DEEPL_API_KEY environment variable will be used)
-f, --formality string The formality of the translation (options: default, more, less, prefer_more, prefer_less) (default "default")
-h, --help help for notion-deepl
-n, --notion-api-key string Notion API key (required: if not provided, the NOTION_API_KEY environment variable will be used)
-s, --source-language string The source language (optional: will be automatically detected for each block if not specified)
-t, --target-language string The target language (required)
See the DeepL API docs for which source language and target language options are supported.
The page you want to translate (or blocks within this page) must be connected to your Notion integration before executing the translation. See the Notion docs for how to create and integrate a personal integration with a page.
Read here for how to get a block ID of a Notion page or block.
notion-deepl --source-language=EN --target-language=NL --block-id=91ada48a2a3b4a939f5e1f0e510c4d3d
notion-deepl --notion-api-key=[YOUR NOTION API KEY]
--deepl-api-key=[YOUR DEEPL API KEY]
--source-language=EN
--target-language=NL
--block-id=91ada48a2a3b4a939f5e1f0e510c4d3d
--formality=prefer_less