Skip to content

Conversation

@skytin1004
Copy link
Collaborator

@skytin1004 skytin1004 commented Sep 12, 2025

Purpose

  • Include Jupyter notebooks in outdated checks and orphan cleanup to keep translations accurate.
  • Improve CLI UX by splitting retranslation progress into separate bars for notebooks and markdowns.
  • Make markdown metadata parsing robust to unlabeled HTML comments, unblocking tests and legacy files.

Description

  • Project-wide

    • Added notebook awareness across the translation lifecycle:
      • Outdated checks now consider .ipynb files.
      • Orphan cleanup deletes translated notebooks whose original has moved/been removed.
      • Directory synchronization treats .ipynb as relevant when creating/removing language directories.
    • Improved progress reporting by splitting retranslation into:
      • “📓 Retranslating outdated notebooks”
      • “📝 Retranslating outdated markdowns”
  • Why necessary

    • Previously, notebooks were not consistently handled in outdated checks or orphan cleanup, causing stale translated notebooks to persist.
    • The single progress bar obscured which file types were being processed.
    • Tests used an unlabeled metadata format; the strict parser caused orphan cleanup to skip files.

Related Issue

Does this introduce a breaking change?

When developers merge from main and run the server, azd up, or azd deploy, will this produce an error?

  • Yes
  • No

Type of change

  • Bugfix
  • Feature
  • Code style update (e.g., formatting, local variables)
  • Refactoring (no functional or API changes)
  • Documentation content changes
  • Other... Please describe:

Checklist

Before submitting your pull request, please confirm the following:

  • I have thoroughly tested my changes: I confirm that I have run the code and manually tested all affected areas.
  • All existing tests pass: I have run all tests and confirmed that nothing is broken.
  • I have added new tests (if applicable): Tests around notebook orphan cleanup and unlabeled metadata parsing are covered by existing suites.
  • I have followed the Co-op Translator’s coding conventions.
  • I have documented my changes (if applicable): Updated behavior is reflected in logs and code comments.

Additional context

  • Logs now clearly indicate per-type retranslation progress and notebook orphan deletions.
  • The metadata parser change is backward compatible and handles legacy content without affecting current labeled format.

…gress by type

Body:

ProjectTranslator.check_and_retry_translations: delegate to manager’s check_outdated_files again
TranslationManager.check_outdated_files: delegate to get_outdated_translations + retranslate_outdated_files (includes notebooks). When update=True, treat all existing translations (md/ipynb) as outdated
TranslationManager.retranslate_outdated_files: split progress bars into notebooks and markdowns for clearer UX
update black style in config
@github-actions github-actions bot added the core Related to any changes in core source files label Sep 12, 2025
@skytin1004 skytin1004 changed the title fix: include notebooks in outdated checks and split retranslation progress by type Core: Include notebooks in outdated checks and split retranslation progress by type Sep 12, 2025
@skytin1004 skytin1004 marked this pull request as ready for review September 12, 2025 07:56
@skytin1004
Copy link
Collaborator Author

I have reviewed the changes and everything looks good.

@skytin1004 skytin1004 merged commit 6133c01 into Azure:main Sep 12, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Related to any changes in core source files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant