(
file_paths: list[str], *, check_translation_outdated: bool = True
)
| 432 | |
| 433 | |
| 434 | def translate_source_files( |
| 435 | file_paths: list[str], *, check_translation_outdated: bool = True |
| 436 | ) -> None: |
| 437 | unique_paths = list(dict.fromkeys(file_paths)) |
| 438 | if not unique_paths: |
| 439 | return |
| 440 | concurrency = min(6, len(unique_paths)) |
| 441 | if concurrency <= 1: |
| 442 | translate_single_source_file( |
| 443 | unique_paths[0], check_translation_outdated=check_translation_outdated |
| 444 | ) |
| 445 | return |
| 446 | with ThreadPoolExecutor(max_workers=concurrency) as executor: |
| 447 | futures = [ |
| 448 | executor.submit( |
| 449 | translate_single_source_file, |
| 450 | path, |
| 451 | check_translation_outdated=check_translation_outdated, |
| 452 | ) |
| 453 | for path in unique_paths |
| 454 | ] |
| 455 | for future in futures: |
| 456 | future.result() |
| 457 | |
| 458 | |
| 459 | def main(): |
no test coverage detected