Skip to content

Conversation

@skytin1004
Copy link
Collaborator

Purpose

Add support for selective translation of Jupyter notebook files through a new CLI option, allowing users to translate only notebook files when needed instead of processing all file types.

Description

This PR introduces a new --notebook/-n CLI option that enables users to translate only Jupyter notebook files (.ipynb). This complements the existing --markdown and --images options, providing more granular control over translation workflows.

Key Changes:

  • CLI Enhancement: Added --notebook/-n flag to the translate command
  • Improved Logic: Enhanced translation mode determination to handle notebook-only translation
  • Updated Pipeline: Modified ProjectTranslator and TranslationManager to support selective notebook translation
  • Better UX: Updated help text and usage examples to include notebook translation scenarios

Usage Example:

# Translate only notebook files
translate -l "ko" -n
translate -l "ko" --notebook

# Update existing notebook translations
translate -l "ko" -n -u

# Multiple languages for notebooks only
translate -l "ko ja fr" --notebook

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?
If you're not sure, try it out on an old environment.

  • 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): I have written tests that cover the new functionality introduced by my code changes.
  • I have followed the Co-op Translators coding conventions: My code adheres to the style guide and coding conventions outlined in the repository.
  • I have documented my changes (if applicable): I have updated the documentation to reflect the changes where necessary.

Additional context

@github-actions github-actions bot added core Related to any changes in core source files tests labels Jul 9, 2025
@skytin1004 skytin1004 changed the title Add CLI option for selective notebook file translation (-n/--notebook) Core: Add CLI option for selective notebook file translation (-n/--notebook) Jul 9, 2025
Copy link
Collaborator Author

@skytin1004 skytin1004 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reviewed the changes and everything looks good.

@skytin1004 skytin1004 merged commit 67dfd3c into Azure:main Jul 9, 2025
1 check 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 tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant