{"result":{"depiction_url":null,"edges":{"in_module":{"objects":[{"created":"2026-10-06T13:25:44Z","object_id":{"id":2763,"is_a":["text","documentation","reference","module"],"name":"doc_external_2_mod_translate_argos","title":"mod_translate_argos","uri":"https:\/\/zotonic.com\/id\/2763"},"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"}},"subject":{"objects":[{"created":"2026-10-06T13:25:44Z","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-06T13:25:44Z","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-06T13:25:44Z","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-06T13:25:44Z","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-06T13:25:44Z","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-06T13:25:44Z","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-06T13:25:44Z","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":2764,"is_a":["text","documentation","reference","model"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2764"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_external_2_m_translate_argos","page_url":{"en":"https:\/\/zotonic.com\/docs\/2764\/m_translate_argos","x-default":"https:\/\/zotonic.com\/docs\/2764\/m_translate_argos"},"preview_url":null,"resource":{"version":17,"pivot_location_lat":null,"title":"m_translate_argos","is_authoritative":true,"body":"<p>Translate plain text and HTML with Argos Translate and manage its language\npackages through a shared local Python worker.<\/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>Whether a Python command is configured.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>packages<\/code><\/td><td>Available and installed package information; requires <code>use.mod_admin_config<\/code>.<\/td><\/tr><\/tbody><\/table>\n<p>For example, templates can read <code>m.translate_argos.is_configured<\/code> and\n<code>m.translate_argos.packages<\/code>. The configuration check does not verify that Python\ncan start, Argos is installed, or the required language packages are available.\nUnknown paths return <code>{error, enoent}<\/code>. Translation is an Erlang API, not a model\nPOST endpoint.<\/p>\n<p>The package result contains <code>packages<\/code> and <code>error<\/code>. Each package includes its\nname, source and target language codes and names, available and installed\nversions, and <code>installed<\/code> and <code>outdated<\/code> flags. Some worker errors are returned\nas an empty package list with <code>error<\/code>, <code>error_reason<\/code>, and <code>error_message<\/code> for\ndisplay; access and timeout errors remain <code>{error, Reason}<\/code> results.<\/p>\n<h2>Erlang API<\/h2>\n<p><code>translate\/4<\/code> translates a list of binary plain texts. <code>translate_html\/4<\/code>\nsegments HTML and restores its structure after translation. <code>translate_tags\/4<\/code>\nis the lower-level tagged-text interface used by the HTML helper. All three\ntake source language, target language, texts, and context, and return\n<code>{ok, TranslatedTexts}<\/code> or <code>{error, Reason}<\/code>.<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">m_translate_argos:translate(en, nl, [&lt;&lt;&quot;Hello&quot;&gt;&gt;, &lt;&lt;&quot;Welcome&quot;&gt;&gt;], Context).\n<\/code><\/pre>\n<p>Both languages are required: missing or sentinel source\/target languages return\n<code>{error, source_language}<\/code> or <code>{error, target_language}<\/code>. Codes are lowercased\nand regional variants reduced to their primary language. Plain and tagged\ntranslations are batched, preserving order; the first failed batch ends the call.<\/p>\n<p><code>packages\/1<\/code>, <code>package\/2<\/code>, <code>install_package\/2<\/code>, and <code>update_packages\/1<\/code> support\npackage administration. <code>install_python\/0<\/code> installs dependencies in the shared\nvirtual environment; <code>ensure_python\/0<\/code> checks imports and installs if needed.\nWorker startup is lazy and shared by all sites. <code>timeout\/1<\/code> reads the site&#39;s\nrequest timeout, with a default of <code>120000<\/code> milliseconds.<\/p>\n<h2>Access control<\/h2>\n<p>Direct Erlang translation and package functions do not perform ACL checks.\nCallers must authorize their operation first. The <code>mod_translate_argos<\/code>\ntranslation observer checks <code>use.mod_translate_argos<\/code>; package model reads and\nadmin postbacks check <code>use.mod_admin_config<\/code>.<\/p>","slug":"m_translate_argos","doc_module_config":[],"is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"eba78b95d53155d4bd3cb1c5b42f715fb0bc034fb1dfae524cd55d5e045b874f","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":2,"is_a":[],"name":null,"title":null,"uri":"https:\/\/zotonic.com\/id\/2"},"git_url":"https:\/\/github.com\/zotonic\/zotonic_mod_translate_argos","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_argos.erl","publication_start":"2026-10-06T13:25:44Z","github_url":"https:\/\/github.com\/zotonic\/zotonic_mod_translate_argos","pivot_location_lng":null,"doc_source_kind":"external","name":"doc_external_2_m_translate_argos","is_unfindable":false,"is_published":true,"pivot_geocode":null,"external_module_title":"Argos Translate","created":"2026-10-06T13:25:44Z","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":"307f3989fd0c679722188a1874ccb3dc30571a8c","creator_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"modified":"2026-10-06T13:25:45Z","title_slug":"m_translate_argos"},"uri":"https:\/\/zotonic.com\/id\/2764","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2764"}},"status":"ok"}