Skip to content

Commit

Permalink
Merge en-GB, en-US to en
Browse files Browse the repository at this point in the history
  • Loading branch information
Wayne-KTCSZ committed Feb 2, 2024
1 parent 01138de commit 30037cb
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 851 deletions.
12 changes: 6 additions & 6 deletions src/EasyFrameWork/Modules/MutiLanguage/LanguageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ public ServiceResult<LanguageEntity> Add(LanguageEntity item)
}
public LanguageEntity Get(string lanKey, string cultureName)
{
LanguageEntity languageEntity = null;
if (GetAllFromCache().TryGetValue(lanKey, out ConcurrentDictionary<string, LanguageEntity> cultureLan))
{
cultureLan.TryGetValue(cultureName, out languageEntity);
}
return languageEntity;
if (!GetAllFromCache().TryGetValue(lanKey, out ConcurrentDictionary<string, LanguageEntity> cultureLan)) return null;

if (cultureLan.TryGetValue(cultureName, out LanguageEntity languageEntity)) return languageEntity;

if (cultureLan.TryGetValue(cultureName.Split('-')[0], out languageEntity)) return languageEntity;
return null;
}

public IEnumerable<LanguageEntity> GetCultures(string lanKey)
Expand Down
Loading

0 comments on commit 30037cb

Please sign in to comment.