Skip to content

feat(CherryMarkdown): add Language parameter#486

Merged
ArgoZhang merged 2 commits intomasterfrom
feature/cherrymarkdown-locale
Jul 14, 2025
Merged

feat(CherryMarkdown): add Language parameter#486
ArgoZhang merged 2 commits intomasterfrom
feature/cherrymarkdown-locale

Conversation

@MadLongTom
Copy link
Copy Markdown
Member

@MadLongTom MadLongTom commented Jul 14, 2025

Link issues

fixes #485

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Add locale parameter to CherryMarkdown component to support customizable language

New Features:

  • Introduce a new Locale parameter on CherryMarkdown with default "zh-CN"

Enhancements:

  • Pass the Locale value to the JavaScript init call

@bb-auto
Copy link
Copy Markdown

bb-auto Bot commented Jul 14, 2025

Thanks for your PR, @MadLongTom. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Jul 14, 2025

Reviewer's Guide

Introduces a new Locale parameter to the CherryMarkdown component and integrates it into the JavaScript initialization call to enable language customization.

Sequence diagram for CherryMarkdown initialization with Locale parameter

sequenceDiagram
    participant CherryMarkdown
    participant JSInterop
    CherryMarkdown->>JSInterop: InvokeVoidAsync("init", Id, Interop, { Value, IsSupportMath, IsViewer, Locale, Editor, Toolbars }, "Upload")
    Note right of JSInterop: JS receives Locale for language customization
Loading

Class diagram for CherryMarkdown with new Locale parameter

classDiagram
    class CherryMarkdown {
        +bool IsViewer
        +string Locale = "zh-CN"
        +Task InvokeInitAsync()
    }
Loading

File-Level Changes

Change Details Files
Add Locale parameter to component
  • Defined a new [Parameter] property Locale with default value "zh-CN"
  • Added XML documentation for the Locale property
src/components/BootstrapBlazor.CherryMarkdown/Components/CherryMarkdown/CherryMarkdown.razor.cs
Include Locale in init payload
  • Updated InvokeInitAsync call to pass Locale in the anonymous init object
src/components/BootstrapBlazor.CherryMarkdown/Components/CherryMarkdown/CherryMarkdown.razor.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#485 Add a locale parameter to the CherryMarkdown component to support internationalization.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@bb-auto bb-auto Bot requested a review from ArgoZhang July 14, 2025 01:39
@bb-auto bb-auto Bot added the enhancement New feature or request label Jul 14, 2025
@bb-auto bb-auto Bot added this to the v9.2.0 milestone Jul 14, 2025
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey @MadLongTom - I've reviewed your changes - here's some feedback:

  • Ensure the corresponding JavaScript init function is updated to consume and apply the new Locale parameter when rendering.
  • Consider constraining Locale to a predefined list of supported culture codes or using an enum to avoid invalid string values.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Ensure the corresponding JavaScript init function is updated to consume and apply the new Locale parameter when rendering.
- Consider constraining Locale to a predefined list of supported culture codes or using an enum to avoid invalid string values.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@ArgoZhang ArgoZhang changed the title feat(CherryMarkdown): add locale parameter feat(CherryMarkdown): add Language parameter Jul 14, 2025
@ArgoZhang ArgoZhang merged commit de649a6 into master Jul 14, 2025
1 check passed
@ArgoZhang ArgoZhang deleted the feature/cherrymarkdown-locale branch July 14, 2025 02:03
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

Successfully merging this pull request may close these issues.

feat(CherryMarkdown): add Language parameter

2 participants