Skip to main content

Module translate_command

Module translate_command 

Source
Expand description

Subtitle translation command implementation.

This module wires CLI argument validation, configuration loading, input collection, safe output resolution, and translation engine invocation.

§Examples

use subx_cli::cli::TranslateArgs;
use subx_cli::commands::translate_command;
use subx_cli::config::TestConfigService;

let args = TranslateArgs {
    paths: vec!["movie.srt".into()],
    input_paths: vec![],
    recursive: false,
    target_language: Some("zh-TW".to_string()),
    source_language: None,
    glossary: None,
    context: None,
    output: None,
    no_extract: false,
    force: false,
    replace: false,
};
let config_service = TestConfigService::with_defaults();
translate_command::execute(args, &config_service).await?;

Structs§

TranslateExecution
Resolved translate command inputs after CLI/config defaulting.
TranslatePayload
Top-level payload for the translate command JSON envelope.
TranslatedFile
Per-file record reported in the translate JSON envelope.

Functions§

execute
Execute the translate command.
execute_with_config
Execute the translate command with an owned configuration service.