"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.OpAddI18nKeyCommand = void 0;
const commander_1 = require("commander");
const chalk_1 = __importDefault(require("chalk"));
const OperationExecutor_1 = require("../services/OperationExecutor");
const core_1 = require("@myycontext/core");
exports.OpAddI18nKeyCommand = new commander_1.Command("op:add-i18n-key")
    .description("Add an i18n translation key")
    .argument("<key>", "translation key")
    .argument("<value>", "translation value")
    .option("--locale <locale>", "locale (default: en)")
    .action(async (key, value, options) => {
    const executor = new OperationExecutor_1.OperationExecutor();
    const op = (0, core_1.createOperation)("add-i18n-key", `Add i18n key: ${key}`, {
        key,
        value,
        locale: options.locale || "en",
    });
    const result = await executor.execute(op);
    if (result.success) {
        console.log(chalk_1.default.green(`\n  ✓ Added i18n key "${key}" → "${value}" (${options.locale || "en"})\n`));
    }
    else {
        console.error(chalk_1.default.red(`\n  ✗ Failed: ${result.error}\n`));
        process.exit(1);
    }
});
//# sourceMappingURL=op-add-i18n-key.js.map