Browse Source
Merge pull request #656 from colinin/Fix-Localization-Resource-Name-Deplication
fix: fix duplication of localized resource names.
pull/712/head
yx lin
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
14 additions and
7 deletions
-
aspnet-core/modules/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageAppService.cs
-
aspnet-core/modules/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceAppService.cs
|
|
|
@ -27,7 +27,10 @@ namespace LINGYUN.Abp.AspNetCore.Mvc.Localization |
|
|
|
UiCultureName = l.UiCultureName, |
|
|
|
DisplayName = l.DisplayName, |
|
|
|
FlagIcon = l.FlagIcon |
|
|
|
}).OrderBy(l => l.CultureName).ToList()); |
|
|
|
}) |
|
|
|
.OrderBy(l => l.CultureName) |
|
|
|
.DistinctBy(l => l.CultureName) |
|
|
|
.ToList()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -21,12 +21,16 @@ namespace LINGYUN.Abp.AspNetCore.Mvc.Localization |
|
|
|
|
|
|
|
public virtual Task<ListResultDto<ResourceDto>> GetListAsync() |
|
|
|
{ |
|
|
|
var resources = _localizationOptions.Resources.Select(x => new ResourceDto |
|
|
|
{ |
|
|
|
Name = x.Value.ResourceName, |
|
|
|
DisplayName = x.Value.ResourceName, |
|
|
|
Description = x.Value.ResourceName, |
|
|
|
}).OrderBy(l => l.Name); |
|
|
|
var resources = _localizationOptions |
|
|
|
.Resources |
|
|
|
.Select(x => new ResourceDto |
|
|
|
{ |
|
|
|
Name = x.Value.ResourceName, |
|
|
|
DisplayName = x.Value.ResourceName, |
|
|
|
Description = x.Value.ResourceName, |
|
|
|
}) |
|
|
|
.OrderBy(l => l.Name) |
|
|
|
.DistinctBy(l => l.Name); |
|
|
|
|
|
|
|
return Task.FromResult(new ListResultDto<ResourceDto>(resources.ToList())); |
|
|
|
} |
|
|
|
|