-
-
Notifications
You must be signed in to change notification settings - Fork 365
feat(JsonLocalizationOptions): add DisableGetLocalizerFromService parameter #5164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's Guide by SourceryThis pull request introduces a new Sequence diagram for string localization with new control optionssequenceDiagram
participant C as Client
participant JSL as JsonStringLocalizer
participant S as Service
participant RM as ResourceManager
participant J as JSON Files
C->>JSL: GetStringSafely(name)
alt DisableGetLocalizerFromService is false
JSL->>S: GetStringFromService(name)
S-->>JSL: localized string
end
alt DisableGetLocalizerFromResourceManager is false
JSL->>RM: GetStringFromResourceManager(name)
RM-->>JSL: localized string
end
JSL->>J: GetStringFromJson(name)
J-->>JSL: localized string
JSL-->>C: final localized string
Class diagram showing changes to JsonLocalizationOptions and BootstrapBlazorOptionsclassDiagram
class JsonLocalizationOptions {
+bool DisableGetLocalizerFromService
+bool DisableGetLocalizerFromResourceManager
+bool UseKeyWhenValueIsNull
+bool IgnoreLocalizerMissing
}
class BootstrapBlazorOptions {
+bool? DisableGetLocalizerFromService
+bool? DisableGetLocalizerFromResourceManager
+bool? IgnoreLocalizerMissing
}
JsonLocalizationOptions --|> LocalizationOptions
note for JsonLocalizationOptions "Added new options for controlling
localizer behavior"
Flow diagram for string localization processflowchart TD
A[Get String Request] --> B{DisableGetLocalizerFromService?}
B -->|No| C[Try Service]
B -->|Yes| D{DisableGetLocalizerFromResourceManager?}
C -->|Not Found| D
D -->|No| E[Try Resource Manager]
D -->|Yes| F[Try JSON Files]
E -->|Not Found| F
F -->|Not Found| G[Return null]
F -->|Found| H[Return String]
E -->|Found| H
C -->|Found| H
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ArgoZhang - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5164 +/- ##
===========================================
+ Coverage 99.98% 100.00% +0.01%
===========================================
Files 634 634
Lines 28122 28145 +23
Branches 4043 4049 +6
===========================================
+ Hits 28118 28145 +27
+ Misses 4 0 -4 ☔ View full report in Codecov by Sentry. |
add DisableGetLocalizerFromService parameter
Summary of the changes (Less than 80 chars)
简单描述你更改了什么, 不超过80个字符;如果有关联 Issue 请在下方填写相关编号
Description
fixes #5163
Regression?
[If yes, specify the version the behavior has regressed from]
[是否影响老版本]
Risk
[Justify the selection above]
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Add a
DisableGetLocalizerFromServiceparameter toJsonLocalizationOptionsto control whether to get localized strings from the injected service.New Features:
DisableGetLocalizerFromServiceparameter toJsonLocalizationOptions.DisableGetLocalizerFromResourceManagerparameter toJsonLocalizationOptions.Tests: