Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a feature to display the currently translated file #16

Open
skytin1004 opened this issue Sep 28, 2024 · 0 comments
Open

Add a feature to display the currently translated file #16

skytin1004 opened this issue Sep 28, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@skytin1004
Copy link
Collaborator

Please provide us with the following information:

Current Behavior

During the translation of markdown and image files, the progress bar only shows the overall progress, without indicating which file is currently being processed.

Translating markdown files:  67%|████████████████████████████████████                  | 2/3 [02:05<01:02, 62.46s/it]

Expected/Desired Behavior

Enhance the progress display to show the filename of the current file being translated, for both markdown and image translation processes. This will provide users with better visibility into the translation process and help in tracking the progress of specific files.

Suggested Implementation

  • For Markdown Translation:
    • Modify the translate_all_markdown_files function to include the current file name in the progress bar description.
    • Example code snippet:
      with tqdm(total=total_files, desc="Translating markdown files") as progress_bar:
          for md_file_path in markdown_files:
              md_file_path = md_file_path.resolve()
              for language_code in self.language_codes:
                  progress_bar.set_description(f"Translating {md_file_path.name} to {language_code}")
                  await self.translate_markdown(md_file_path, language_code)
                  progress_bar.update(1)
  • For Image Translation:
    • Modify the translate_all_image_files function to show the current file name in the progress bar description.
    • Example code snippet:
      with tqdm(total=len(tasks), desc="Translating images") as progress_bar:
          for task in tasks:
              image_file_name = task.__self__.image_path.name
              progress_bar.set_description(f"Translating {image_file_name}")
              await task()
              progress_bar.update(1)

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

azd version?

run azd version and copy paste here.

Versions

Mention any other details that might be useful

  • This feature would be beneficial in scenarios with large batches of files to keep track of which files have been processed.
  • It will also help in identifying specific files that might be causing delays during translation.

Thanks! We'll be in touch soon.

@skytin1004 skytin1004 added the enhancement New feature or request label Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant