diff --git a/tools/translate_crowdin.py b/tools/translate_crowdin.py index ad300e57..39c76679 100644 --- a/tools/translate_crowdin.py +++ b/tools/translate_crowdin.py @@ -36,7 +36,6 @@ NS = {"x": XLIFF_NS} REPO_ROOT = Path(__file__).resolve().parent.parent WORK_DIR = REPO_ROOT / ".crowdin-translate" BUNDLES_DIR = WORK_DIR / "bundles" -DEFAULT_OUTPUT_DIR = WORK_DIR / "translated" ERRORS_DIR = WORK_DIR / "errors" DOMAIN_PROMPT_CACHE_DIR = WORK_DIR / "domain-prompt-cache" @@ -876,7 +875,7 @@ def build_parser() -> argparse.ArgumentParser: p.add_argument("--skip-upload", action="store_true", help="Skip uploading translations to Crowdin") p.add_argument("--output-dir", type=Path, default=None, - help=f"Output directory (default: {DEFAULT_OUTPUT_DIR})") + help="Output directory (default: /translated/)") p.add_argument("--include-docs", action="store_true", help="Include /docs/ files in translation (skipped by default)") p.add_argument("-v", "--verbose", action="store_true", @@ -927,8 +926,12 @@ def main() -> None: else: bundle_dir = download_bundle(args.bundle_id) - output_dir = args.output_dir or DEFAULT_OUTPUT_DIR + if args.output_dir: + output_dir = args.output_dir + else: + output_dir = bundle_dir / "translated" output_dir.mkdir(parents=True, exist_ok=True) + log.info("Output directory: %s", output_dir) exclude_paths: list[str] | None = None if args.include_docs else ["/docs/"] if exclude_paths: