Allow README translation to reference existing translations (#1028)

Allow reuse of prior translation files as a style and terminology
guide when regenerating README i18n files.
This commit is contained in:
Peter Dave Hello
2026-02-16 13:26:44 +08:00
committed by GitHub
parent a94ddc504f
commit be6437c46f
3 changed files with 36 additions and 1 deletions
+7
View File
@@ -12,6 +12,7 @@ interface CliArgs {
maxBudget?: number;
verbose: boolean;
force: boolean;
useExisting: boolean;
help: boolean;
listLanguages: boolean;
}
@@ -39,6 +40,7 @@ OPTIONS:
--no-preserve-code Translate code blocks too (not recommended)
-m, --model <model> Claude model to use (default: sonnet)
--max-budget <usd> Maximum budget in USD
--use-existing Use existing translation file as a reference
-v, --verbose Show detailed progress
-f, --force Force re-translation ignoring cache
-h, --help Show this help message
@@ -126,6 +128,7 @@ function parseArgs(argv: string[]): CliArgs {
preserveCode: true,
verbose: false,
force: false,
useExisting: false,
help: false,
listLanguages: false,
};
@@ -152,6 +155,9 @@ function parseArgs(argv: string[]): CliArgs {
case "--force":
args.force = true;
break;
case "--use-existing":
args.useExisting = true;
break;
case "--no-preserve-code":
args.preserveCode = false;
break;
@@ -234,6 +240,7 @@ async function main(): Promise<void> {
maxBudgetUsd: args.maxBudget,
verbose: args.verbose,
force: args.force,
useExisting: args.useExisting,
});
// Exit with error code if any translations failed