The translation process can now resume from where it left off in the event of an unexpected interruption.
Since files are only saved once they are fully translated, the system ensures that partially translated files are not left behind, maintaining the integrity of the translation output even when the process is halted.
This allows users to continue the translation process smoothly without having to restart from the beginning, making the translation process more efficient and robust.
(Solved #21)
Example:
If the translation process is stopped midway through, simply rerun the command, and it will pick up from the last completed file instead of restarting from scratch.
# Resuming from where the process left off after an interruption:
translate -add -l "ko"
Batch image and markdown translation tasks in groups of 5 for efficient async processing.
Group translation tasks for both images and markdown files into batches of 5 for more efficient asynchronous processing.
This ensures smoother handling of large sets of files and improves performance in translation tasks.
Update progress bar in real-time using tqdm_asyncio.gather for both images and markdown files.
The progress bar for image and markdown translation now updates in real-time, showing the progress of translation tasks using tqdm_asyncio.gather.
This enhances visibility during the translation process, providing an accurate status of how many files are being processed and completed.
Here is an example:
(.venv) C:\Users\sms79\dev\co_op_translator\src\co_op_translator\test_repo>poetry run translate -l "es" -u
Warning: The update command will delete all existing translations for 'es' and re-translate everything.
Do you want to continue? Type 'yes' to proceed: yes
Proceeding with update...
Translating remaining images: 100%|████████████████████████████████████████████| 3/3 [00:46<00:00, 15.55s/it]
Translating remaining markdown files: 100%|███████████████████████████████████| 1/1 [02:05<00:00, 125.62s/it]
Ensure proper handling of translated files and skipping existing translations when using --add mode.
When using the --add mode, the system properly skips files that have already been translated, avoiding redundant translations.
This improves the efficiency of the translation process, particularly when working with incremental translations.
Added CLI support for modes: --add, --update, --images, --markdown.
New CLI options are added to control the translation process:
--add: Adds new translations without deleting existing ones.
--update: Updates translations by deleting and recreating them.
--images: Only translate image files.
--markdown: Only translate markdown files.
Example Commands
Here are some example commands to demonstrate how the CLI modes can be used:
# Adds a new translation in Spanish without deleting existing translations
translate -l 'es' --add
# Updates only French markdown files by deleting and re-translating
translate -l 'fr' --update --markdown
# Adds a new translation for Korean images only
translate -l 'ko' --images
Improved Resilience in Translation Process
(Solved #21)
Example:
Batch image and markdown translation tasks in groups of 5 for efficient async processing.
Update progress bar in real-time using
tqdm_asyncio.gather
for both images and markdown files.tqdm_asyncio.gather
.Here is an example:
Ensure proper handling of translated files and skipping existing translations when using
--add
mode.--add
mode, the system properly skips files that have already been translated, avoiding redundant translations.Added CLI support for modes:
--add
,--update
,--images
,--markdown
.--add
: Adds new translations without deleting existing ones.--update
: Updates translations by deleting and recreating them.--images
: Only translate image files.--markdown
: Only translate markdown files.Example Commands
Here are some example commands to demonstrate how the CLI modes can be used: