Skip to content

doc(Tutorials): update Tutorials sample code#8023

Merged
ArgoZhang merged 3 commits into
mainfrom
doc-nav
May 19, 2026
Merged

doc(Tutorials): update Tutorials sample code#8023
ArgoZhang merged 3 commits into
mainfrom
doc-nav

Conversation

@ArgoZhang
Copy link
Copy Markdown
Member

@ArgoZhang ArgoZhang commented May 19, 2026

Link issues

fixes #8022

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

Localize tutorials navigation and sample content using component-specific resource scopes and update tutorial UI text to be driven by localization resources.

Enhancements:

  • Consolidate tutorials navigation localization to use the TutorialsNavMenu resource scope for both the navigation component and tutorials overview page.
  • Refine the Memorial tutorial sample to obtain button text and step descriptions from localized resources, supporting richer formatted content.

Documentation:

  • Align tutorial sample text and labels with the updated localization model for tutorials content.

Copilot AI review requested due to automatic review settings May 19, 2026 05:10
@bb-auto bb-auto Bot added the documentation Improvements or additions to documentation label May 19, 2026
@bb-auto bb-auto Bot added this to the v10.6.0 milestone May 19, 2026
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented May 19, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Aligns tutorials navigation and pages with proper localization resources and updates the Memorial tutorial sample to use localized text, with corresponding locale entries added/updated.

File-Level Changes

Change Details Files
Unify tutorials navigation menu localization to use the TutorialsNavMenu resource and remove redundant localizer injection.
  • Remove unused Tutorials page using directive from the tutorials navigation menu component code-behind.
  • Replace dual IStringLocalizer injections (for Tutorials and Tutorials) with a single IStringLocalizer.
  • Update all references from TutorialsLocalizer[...] to Localizer[...] in the tutorials navigation menu initialization logic.
src/BootstrapBlazor.Server/Components/Layout/TutorialsNavMenu.razor.cs
Localize the Memorial tutorial sample UI text and instructional labels.
  • Inject IStringLocalizer into the Memorial tutorial component.
  • Replace hard-coded Chinese button label with a localized ToggleButtonText resource entry.
  • Replace hard-coded step titles and description paragraphs with Localizer-based strings, using MarkupString where HTML content is embedded.
src/BootstrapBlazor.Server/Components/Samples/Tutorials/Memorial.razor
Align tutorials page localization with TutorialsNavMenu resources.
  • Change Tutorials page to use IStringLocalizer instead of IStringLocalizer for its texts.
  • Keep existing component card structure but ensure all labels are resolved from the updated localizer.
src/BootstrapBlazor.Server/Components/Pages/Tutorials.razor
Add or update localization resources for tutorials and Memorial sample text in English and Chinese.
  • Introduce or modify en-US resource entries for tutorials summaries and Memorial tutorial labels (e.g., button and step text).
  • Introduce or modify zh-CN resource entries for tutorials summaries and Memorial tutorial labels to match the new localized usage in components.
src/BootstrapBlazor.Server/Locales/en-US.json
src/BootstrapBlazor.Server/Locales/zh-CN.json

Assessment against linked issues

Issue Objective Addressed Explanation
#8022 Update the Tutorials sample component code to the new form for the relevant component (Memorial tutorial), including localized text instead of hard-coded strings.
#8022 Update the Tutorials-related layout/navigation and Tutorials page to use the correct localizer and keys for the tutorial summaries.

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

@ArgoZhang ArgoZhang merged commit 61cb823 into main May 19, 2026
6 checks passed
@ArgoZhang ArgoZhang deleted the doc-nav branch May 19, 2026 05:11
Copy link
Copy Markdown
Contributor

@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 - I've reviewed your changes and they look great!


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.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (5c0ea5f) to head (a1202c8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #8023   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          766       766           
  Lines        34123     34123           
  Branches      4692      4692           
=========================================
  Hits         34123     34123           
Flag Coverage Δ
BB 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Tutorials documentation/sample experience in the BootstrapBlazor.Server site by moving/adding localization strings used by the Tutorials navigation and pages, and by localizing the new “Memorial” tutorial sample UI.

Changes:

  • Moved Tutorials page summary strings into the TutorialsNavMenu localization section and removed the old Pages.Tutorials section (en-US / zh-CN).
  • Localized Memorial.razor UI text via IStringLocalizer<Memorial> and added corresponding locale entries.
  • Updated Tutorials.razor and TutorialsNavMenu.razor.cs to use the new localization mapping.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/BootstrapBlazor.Server/Locales/zh-CN.json Adds/moves Tutorials + Memorial localization keys in zh-CN.
src/BootstrapBlazor.Server/Locales/en-US.json Adds/moves Tutorials + Memorial localization keys in en-US.
src/BootstrapBlazor.Server/Components/Samples/Tutorials/Memorial.razor Replaces hardcoded UI strings with localized strings for the Memorial tutorial.
src/BootstrapBlazor.Server/Components/Pages/Tutorials.razor Switches Tutorials page localization to the updated resource group.
src/BootstrapBlazor.Server/Components/Layout/TutorialsNavMenu.razor.cs Simplifies nav menu localization injection and uses the new localizer source.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@layout TutorialsLayout
@page "/tutorials"
@inject IStringLocalizer<Tutorials> Localizer
@inject IStringLocalizer<TutorialsNavMenu> Localizer
Comment on lines 20 to +22
[Inject]
[NotNull]
private IStringLocalizer<Tutorials>? TutorialsLocalizer { get; set; }

[Inject]
[NotNull]
private IStringLocalizer<Tutorials>? Localizer { get; set; }
private IStringLocalizer<TutorialsNavMenu>? Localizer { get; set; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doc(Tutorials): update Tutorials sample code

2 participants