Skip to content

Commit 0431fce

Browse files
committed
2 parents 84b5663 + 6c3d412 commit 0431fce

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Contrib/Globalization/Masa.Contrib.Globalization.I18n.Dcc/Extensions/I18nResourceExtensions.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@
55

66
namespace Masa.BuildingBlocks.Globalization.I18n;
77

8+
// ReSharper disable once InconsistentNaming
89
public static class I18nResourceExtensions
910
{
11+
// ReSharper disable once InconsistentNaming
1012
public static I18nResource UseDcc(
1113
this I18nResource i18nResource,
1214
string appId,
1315
string configObjectPrefix,
1416
params CultureModel[] supportedCultures)
1517
=> i18nResource.UseDcc(appId, configObjectPrefix, supportedCultures.ToList());
1618

19+
// ReSharper disable once InconsistentNaming
1720
public static I18nResource UseDcc(
1821
this I18nResource i18nResource,
1922
string appId,
@@ -23,10 +26,9 @@ public static I18nResource UseDcc(
2326
var serviceProvider = MasaApp.GetServices().BuildServiceProvider();
2427
var masaConfiguration = serviceProvider.GetRequiredService<IMasaConfiguration>();
2528
var contributors =
26-
(supportedCultures.Any() ? supportedCultures :
27-
serviceProvider.GetRequiredService<IOptions<CultureSettings>>().Value.SupportedCultures)
28-
.Select(supportedCulture
29-
=> new DccI18nResourceContributor(appId, configObjectPrefix, supportedCulture.Culture, masaConfiguration)).ToList();
29+
(supportedCultures.Any() ? supportedCultures : serviceProvider.GetRequiredService<IOptions<CultureSettings>>().Value.SupportedCultures)
30+
.Select(supportedCulture => new DccI18nResourceContributor(appId, configObjectPrefix, supportedCulture.Culture, masaConfiguration))
31+
.ToList();
3032
foreach (var contributor in contributors)
3133
{
3234
i18nResource.AddContributor(contributor.CultureName, contributor);

0 commit comments

Comments
 (0)