# shellcheck shell=dash disable=SC2034

___x_cmd_writer_get___style(){
    local style=
    ___x_cmd_writer_cur style:= 2>/dev/null
    x_="${style:-"$___X_CMD_WRITER_DEFAULT_OUTPUT_STYLE"}"
}


___x_cmd_writer_tran_lang_(){
    case "$1" in
        zh)     x_="Chinese"    ;;
        en)     x_="English"    ;;
        fr)     x_="French"     ;;
        de)     x_="German"     ;;
        ja)     x_="Japanese"   ;;
        es)     x_="Spanish"    ;;
        ru)     x_="Russian"    ;;
        ko)     x_="Korean"     ;;
        *)      # TODO
                x_="$1"
                ;;
    esac
}

# ___x_cmd_writer_request "${___X_CMD_DEFAULT_LANGUAGE:-"en"}" abstract "$@"
___x_cmd_writer_request(){
    local x_; local style;
    local NO_PIPE_DATA_SIGN_DISPLAY=1
    local lang="$1";
    local type="$2"; shift 2
    x_=;    ___x_cmd_writer_tran_lang_ "$lang"; lang="$x_"
    x_=;    ___x_cmd_writer_get___style;        style="$x_"

    writer:debug --lang "$lang" --type "$type" --style "$style" --minion "$___X_CMD_ROOT_MOD/writer/lib/minion/${type}.yml"
    STYLE="$x_" LANGUAGE="$lang" ___x_cmd chat --send --type "writer,${type}" --without-repl --history 0 \
        --minion "$___X_CMD_ROOT_MOD/writer/lib/minion/${type}.yml" --no-empty-question "$@"
}




