Browse Source
refactor: remove unused resource variable and update test to exclude parent cultures
pull/25227/head
maliming
5 months ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
2 changed files with
1 additions and
3 deletions
-
framework/src/Volo.Abp.Localization/Volo/Abp/Localization/VirtualFiles/VirtualFileLocalizationResourceContributorBase.cs
-
framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpStringLocalizerFactory_Tests.cs
|
|
|
@ -20,7 +20,6 @@ public abstract class VirtualFileLocalizationResourceContributorBase : ILocaliza |
|
|
|
private Dictionary<string, ILocalizationDictionary>? _dictionaries; |
|
|
|
private bool _subscribedForChanges; |
|
|
|
private readonly object _syncObj = new object(); |
|
|
|
private LocalizationResourceBase _resource = default!; |
|
|
|
|
|
|
|
protected VirtualFileLocalizationResourceContributorBase(string virtualPath) |
|
|
|
{ |
|
|
|
@ -29,7 +28,6 @@ public abstract class VirtualFileLocalizationResourceContributorBase : ILocaliza |
|
|
|
|
|
|
|
public virtual void Initialize(LocalizationResourceInitializationContext context) |
|
|
|
{ |
|
|
|
_resource = context.Resource; |
|
|
|
_virtualFileProvider = context.ServiceProvider.GetRequiredService<IVirtualFileProvider>(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -113,7 +113,7 @@ public class AbpStringLocalizerFactory_Tests : AbpIntegratedTest<AbpLocalization |
|
|
|
var localizer = _factory.CreateByResourceNameOrNull("LocalizationTestFilesSplit"); |
|
|
|
localizer.ShouldNotBeNull(); |
|
|
|
|
|
|
|
var allStrings = localizer.GetAllStrings().ToList(); |
|
|
|
var allStrings = localizer.GetAllStrings(includeParentCultures: false).ToList(); |
|
|
|
|
|
|
|
allStrings.ShouldContain(ls => ls.Name == "Base.Id" && ls.Value == "Id"); |
|
|
|
allStrings.ShouldContain(ls => ls.Name == "Base.Name" && ls.Value == "Name"); |
|
|
|
|