PhoenixKit.Modules.Publishing.Web.Editor.Translation (phoenix_kit v1.7.43)
Copy Markdown View SourceAI translation functionality for the publishing editor.
Handles translation workflow, Oban job enqueuing, and translation progress tracking.
Summary
Functions
Checks if AI translation is available (AI module enabled + endpoints configured).
Builds warnings for the translation confirmation modal.
Actually enqueues the translation job (after confirmation if needed).
Enqueues translation job with validation and warnings. Returns {:noreply, socket} for use in handle_event.
Gets all target languages for translation (all except primary).
Gets the default AI endpoint ID from settings.
Gets target languages for translation (missing languages only).
Lists available AI endpoints for translation.
Clears completed translation status when switching languages.
Checks if the source content is blank.
Starts translation to the current (non-primary) language.
Functions
Checks if AI translation is available (AI module enabled + endpoints configured).
Builds warnings for the translation confirmation modal.
Actually enqueues the translation job (after confirmation if needed).
Enqueues translation job with validation and warnings. Returns {:noreply, socket} for use in handle_event.
Gets all target languages for translation (all except primary).
Gets the default AI endpoint ID from settings.
Gets target languages for translation (missing languages only).
Lists available AI endpoints for translation.
Clears completed translation status when switching languages.
Checks if the source content is blank.
Starts translation to the current (non-primary) language.