(language: Annotated[str, typer.Option(envvar="LANGUAGE")])
| 212 | |
| 213 | @app.command() |
| 214 | def translate_lang(language: Annotated[str, typer.Option(envvar="LANGUAGE")]) -> None: |
| 215 | paths_to_process = list(iter_en_paths_to_translate()) |
| 216 | print("Original paths:") |
| 217 | for p in paths_to_process: |
| 218 | print(f" - {p}") |
| 219 | print(f"Total original paths: {len(paths_to_process)}") |
| 220 | missing_paths: list[Path] = [] |
| 221 | skipped_paths: list[Path] = [] |
| 222 | for p in paths_to_process: |
| 223 | lang_path = generate_lang_path(lang=language, path=p) |
| 224 | if lang_path.exists(): |
| 225 | skipped_paths.append(p) |
| 226 | continue |
| 227 | missing_paths.append(p) |
| 228 | print("Paths to skip:") |
| 229 | for p in skipped_paths: |
| 230 | print(f" - {p}") |
| 231 | print(f"Total paths to skip: {len(skipped_paths)}") |
| 232 | print("Paths to process:") |
| 233 | for p in missing_paths: |
| 234 | print(f" - {p}") |
| 235 | print(f"Total paths to process: {len(missing_paths)}") |
| 236 | for p in missing_paths: |
| 237 | print(f"Translating: {p}") |
| 238 | translate_page(language="es", en_path=p) |
| 239 | print(f"Done translating: {p}") |
| 240 | |
| 241 | |
| 242 | def get_llm_translatable() -> list[str]: |
nothing calls this directly
no test coverage detected