{"result":{"depiction_url":null,"edges":{"in_module":{"objects":[{"created":"2026-10-06T11:43:52Z","object_id":{"id":2761,"is_a":["text","documentation","reference","module"],"name":"doc_external_1_mod_translate_deepl","title":"mod_translate_deepl","uri":"https:\/\/zotonic.com\/id\/2761"},"seq":1}],"predicate":{"id":333,"is_a":["meta","predicate"],"name":"in_module","title":{"_type":"trans","tr":{"en":"In module"}},"uri":"https:\/\/zotonic.com\/id\/in_module"}},"refers":{"objects":[{"created":"2026-10-06T11:43:52Z","object_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"seq":1000000}],"predicate":{"id":2409,"is_a":["meta","predicate"],"name":"refers","title":{"_type":"trans","tr":{"en":"Refers"}},"uri":"https:\/\/zotonic.com\/id\/refers"}},"subject":{"objects":[{"created":"2026-10-06T11:43:52Z","object_id":{"id":2555,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/2555"},"seq":1},{"created":"2026-10-06T11:43:52Z","object_id":{"id":2564,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_backend_developer","title":"Backend developer","uri":"https:\/\/zotonic.com\/id\/2564"},"seq":2},{"created":"2026-10-06T11:43:52Z","object_id":{"id":2588,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_localization_and_translation","title":"Localization and translation","uri":"https:\/\/zotonic.com\/id\/2588"},"seq":3},{"created":"2026-10-06T11:43:52Z","object_id":{"id":2599,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_api_and_integration","title":"API and integration","uri":"https:\/\/zotonic.com\/id\/2599"},"seq":4},{"created":"2026-10-06T11:43:52Z","object_id":{"id":2625,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_model","title":"Model","uri":"https:\/\/zotonic.com\/id\/2625"},"seq":5},{"created":"2026-10-06T11:43:52Z","object_id":{"id":2668,"is_a":["categorization","keyword","keyword_data_type"],"name":"zotonic_topic_language_code","title":"Language code","uri":"https:\/\/zotonic.com\/id\/2668"},"seq":6},{"created":"2026-10-06T11:43:52Z","object_id":{"id":2669,"is_a":["categorization","keyword","keyword_data_type"],"name":"zotonic_topic_translated_text","title":"Translated text","uri":"https:\/\/zotonic.com\/id\/2669"},"seq":7}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":2762,"is_a":["text","documentation","reference","model"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2762"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_external_1_m_translate_deepl","page_url":{"en":"https:\/\/zotonic.com\/docs\/2762\/m_translate_deepl","x-default":"https:\/\/zotonic.com\/docs\/2762\/m_translate_deepl"},"preview_url":null,"resource":{"version":18,"pivot_location_lat":null,"title":"m_translate_deepl","is_authoritative":true,"body":"<p>Translates lists of texts using the DeepL API and exposes whether an API key\nhas been configured.<\/p>\n<h2>Model API<\/h2>\n<table class=\"table\"><thead><tr><th>Method<\/th><th>Path<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>get<\/code><\/td><td><code>is_configured<\/code><\/td><td>Return whether <code>mod_translate_deepl.api_key<\/code> is nonempty.<\/td><\/tr><\/tbody><\/table>\n<p>Templates can read <code>m.translate_deepl.is_configured<\/code>. This public read returns\nonly a boolean; it does not disclose the API key or verify its validity with\nDeepL. Unknown model paths return <code>{error, enoent}<\/code>. Translation itself is not\nexposed as a model API path.<\/p>\n<h2>Erlang API<\/h2>\n<p><code>is_configured(Context)<\/code> performs the same local configuration check.<\/p>\n<p><code>translate(SourceLanguage, TargetLanguage, Texts, Context)<\/code> accepts a list of\nbinary texts and returns <code>{ok, TranslatedTexts}<\/code> or <code>{error, Reason}<\/code>. For\nexample, an already authorized caller can translate two texts with:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">m_translate_deepl:translate(en, nl, [&lt;&lt;&quot;Hello&quot;&gt;&gt;, &lt;&lt;&quot;Welcome&quot;&gt;&gt;], Context).\n<\/code><\/pre>\n<p>Language codes are converted to binaries before sending the request. An\nundefined or empty source language, <code>x-default<\/code>, or <code>x-none<\/code> omits the source\nlanguage from the request so DeepL can detect it. The target language is\nrequired. HTML tag handling is enabled, with <code>code<\/code> elements ignored.<\/p>\n<p>The model posts JSON to <code>\/v2\/translate<\/code>, using the configured API key for\n<code>DeepL-Auth-Key<\/code> authorization. A key containing <code>:fx<\/code> selects the free\nendpoint; other keys select the paid endpoint.<\/p>\n<p>A missing key returns <code>{error, api_key}<\/code>. Recognized unsupported-language\nresponses return <code>{error, source_language}<\/code> or <code>{error, target_language}<\/code>.\nUnexpected successful response shapes return <code>{error, unknown_response}<\/code>;\nother request failures are returned as <code>{error, Reason}<\/code>. Requests are not\nretried by this model.<\/p>\n<h2>Access control<\/h2>\n<p>The exported <code>translate\/4<\/code> function does not perform an ACL check. Callers must\nhave authorized the operation before calling it. The <code>mod_translate_deepl<\/code>\nnotification observer checks <code>use.mod_translate_deepl<\/code> and is the integration\npoint for Zotonic&#39;s translation service.<\/p>","slug":"m_translate_deepl","doc_module_config":[],"is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"1b9335f2be87a08078cf803fc85d0378f3ee4ba9477b0e83446cbad06c02373f","is_featured":false,"content_group_id":{"id":2551,"is_a":["meta","content_group"],"name":"content_group_imported_docs","title":"Imported documentation","uri":"https:\/\/zotonic.com\/id\/content_group_imported_docs"},"external_module_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"git_url":"https:\/\/github.com\/driebit\/zotonic_mod_translate_deepl","category_id":{"id":322,"is_a":["meta","category"],"name":"model","title":"Models","uri":"https:\/\/test.zotonic.com\/id\/322"},"doc_source_path":".\/src\/models\/m_translate_deepl.erl","publication_start":"2026-10-06T11:43:52Z","github_url":"https:\/\/github.com\/driebit\/zotonic_mod_translate_deepl","pivot_location_lng":null,"doc_source_kind":"external","name":"doc_external_1_m_translate_deepl","is_unfindable":false,"is_published":true,"pivot_geocode":null,"external_module_title":"DeepL","created":"2026-10-06T11:43:52Z","uri":null,"doc_status":"current","is_dependent":false,"is_external_module":true,"publication_end":"9999-06-01T00:00:00Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"privacy":0,"doc_source_commit":"56fe0e842fe325b2f19fe4b886ba61ec3abba725","creator_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"modified":"2026-10-06T11:43:53Z","title_slug":"m_translate_deepl"},"uri":"https:\/\/zotonic.com\/id\/2762","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2762"}},"status":"ok"}