Updated for v10 - Get lang files via FileProviders (and support Razor Class Libraries) (#12313)

* Update localized to get the physical paths on .net 6

* Update src/Umbraco.Web.BackOffice/DependencyInjection/UmbracoBuilder.LocalizedText.cs

Co-authored-by: Ronald Barendse <ronald@barend.se>

* Minor amends for variable naming and to resolve warnings on use of explicit types.

Co-authored-by: Ronald Barendse <ronald@barend.se>
Co-authored-by: Andy Butland <abutland73@gmail.com>
This commit is contained in:
Kevin Jump
2022-04-29 11:58:44 +01:00
committed by GitHub
parent cf2b9a0f21
commit 6b5bc7cebd
2 changed files with 46 additions and 23 deletions

View File

@@ -45,7 +45,7 @@ namespace Umbraco.Cms.Infrastructure.DependencyInjection
builder.Services.AddUnique<IPackagingService, PackagingService>();
builder.Services.AddUnique<IServerRegistrationService, ServerRegistrationService>();
builder.Services.AddUnique<ITwoFactorLoginService, TwoFactorLoginService>();
builder.Services.AddTransient(SourcesFactory);
builder.Services.AddTransient(LocalizedTextServiceFileSourcesFactory);
builder.Services.AddUnique(factory => CreatePackageRepository(factory, "createdPackages.config"));
builder.Services.AddUnique<ICreatedPackagesRepository, CreatedPackageSchemaRepository>();
builder.Services.AddSingleton<PackageDataInstallation>();
@@ -77,7 +77,7 @@ namespace Umbraco.Cms.Infrastructure.DependencyInjection
factory.GetRequiredService<FileSystems>(),
packageRepoFileName);
private static LocalizedTextServiceFileSources SourcesFactory(IServiceProvider container)
private static LocalizedTextServiceFileSources LocalizedTextServiceFileSourcesFactory(IServiceProvider container)
{
var hostingEnvironment = container.GetRequiredService<IHostingEnvironment>();
var mainLangFolder = new DirectoryInfo(hostingEnvironment.MapPathContentRoot(WebPath.Combine(Constants.SystemDirectories.Umbraco, "config", "lang")));