Conversation
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideLocalizes the HostModel Blazor documentation page by replacing hard-coded Chinese text with IStringLocalizer-based resources and wiring up en-US/zh-CN locale entries to support English and Chinese content. Sequence diagram for localized HostModel page renderingsequenceDiagram
actor User
participant Browser
participant HostModel
participant IStringLocalizer_HostModel_ as IStringLocalizer_HostModel
User ->> Browser: Request /host-model
Browser ->> HostModel: Render HostModel
HostModel ->> IStringLocalizer_HostModel: Item[Title]
IStringLocalizer_HostModel -->> HostModel: "Title" string
HostModel ->> IStringLocalizer_HostModel: Item[Recommended]
IStringLocalizer_HostModel -->> HostModel: "Recommended" string
HostModel -->> Browser: Localized HTML content
Browser -->> User: Display localized HostModel page
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Where you cast localized strings to MarkupString (e.g.,
@((MarkupString)Localizer["RecommendServer"].Value)), consider whether HTML is truly required; if not, render as plain text to avoid unnecessary HTML allowance and potential XSS risks from future resource changes. - The
"Recommended"key is reused for different contexts (hosting model, render mode, interactivity); giving these keys more specific names (e.g.,RecommendedForBeginners,RecommendedRenderMode) will make future translation and maintenance clearer.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Where you cast localized strings to MarkupString (e.g., `@((MarkupString)Localizer["RecommendServer"].Value)`), consider whether HTML is truly required; if not, render as plain text to avoid unnecessary HTML allowance and potential XSS risks from future resource changes.
- The `"Recommended"` key is reused for different contexts (hosting model, render mode, interactivity); giving these keys more specific names (e.g., `RecommendedForBeginners`, `RecommendedRenderMode`) will make future translation and maintenance clearer.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the HostModel documentation page to support English (en-US) by switching the page content to use IStringLocalizer and adding the corresponding locale entries.
Changes:
- Localized
HostModel.razorby replacing hard-coded Chinese text withIStringLocalizer<HostModel>lookups. - Added
BootstrapBlazor.Server.Components.Pages.HostModeltranslation entries to bothzh-CN.jsonanden-US.json.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/BootstrapBlazor.Server/Locales/zh-CN.json | Adds HostModel page localization keys/values for Simplified Chinese. |
| src/BootstrapBlazor.Server/Locales/en-US.json | Adds HostModel page localization keys/values for US English. |
| src/BootstrapBlazor.Server/Components/Pages/HostModel.razor | Injects IStringLocalizer<HostModel> and renders localized strings (including HTML via MarkupString). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link issues
fixes #8043
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Localize the HostModel Blazor demo page and add support for en-US content.
New Features:
Enhancements:
Documentation: