-
-
Notifications
You must be signed in to change notification settings - Fork 382
feat(JsonStringLocalizer): remove mssing localizer item cache #7812
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
Changes from 3 commits
fd359b3
8ffbe08
bf5a058
aab39b7
c8a1a38
675aa67
1cf8635
e77e6c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ internal class JsonStringLocalizerFactory : ResourceManagerStringLocalizerFactor | |
| private readonly JsonLocalizationOptions _jsonLocalizationOptions; | ||
| private readonly ILocalizationMissingItemHandler _localizationMissingItemHandler; | ||
| private string? _typeName; | ||
| private JsonStringLocalizer? _localizer; | ||
|
|
||
| /// <summary> | ||
| /// <para lang="zh">构造函数</para> | ||
|
|
@@ -108,5 +109,19 @@ protected override string GetResourcePrefix(string baseResourceName, string base | |
| /// </summary> | ||
| /// <param name="assembly"><para lang="zh">The assembly to create a <see cref="ResourceManagerStringLocalizer"/> for</para><para lang="en">The assembly to create a <see cref="ResourceManagerStringLocalizer"/> for</para></param> | ||
| /// <param name="baseName"><para lang="zh">The base name of the resource to search for</para><para lang="en">The base name of the resource to search for</para></param> | ||
| protected override ResourceManagerStringLocalizer CreateResourceManagerStringLocalizer(Assembly assembly, string baseName) => new JsonStringLocalizer(assembly, _typeName!, baseName, _jsonLocalizationOptions, _loggerFactory.CreateLogger<JsonStringLocalizer>(), ResourceNamesCache, _localizationMissingItemHandler); | ||
| protected override ResourceManagerStringLocalizer CreateResourceManagerStringLocalizer(Assembly assembly, string baseName) | ||
| { | ||
| _localizer = new JsonStringLocalizer(assembly, _typeName!, baseName, _jsonLocalizationOptions, _loggerFactory.CreateLogger<JsonStringLocalizer>(), ResourceNamesCache, _localizationMissingItemHandler); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (bug_risk): Tracking only the last created Because the factory only keeps a single To align
|
||
| return _localizer; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// <para lang="zh">清除缓存方法</para> | ||
| /// <para lang="en">Reset cache method</para> | ||
| /// <para>v<version>10.5.0</version></para> | ||
| /// </summary> | ||
| public void Reset() | ||
| { | ||
| _localizer?.ResetMissingMainifestCache(); | ||
| } | ||
|
ArgoZhang marked this conversation as resolved.
Outdated
|
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.