55
66namespace Masa . BuildingBlocks . Globalization . I18n ;
77
8+ // ReSharper disable once InconsistentNaming
89public 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