Initial commit - MassTech UI

This commit is contained in:
2026-08-05 21:15:18 +03:00
commit 866d22ebbc
5337 changed files with 510980 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.JSInterop;
using SoloX.BlazorJsonLocalization;
namespace UI.Config.Register
{
public class LocalizationHttpClient : HttpClient { }
public static class LocalizationSetup
{
public static IServiceCollection RegLocalization(
this IServiceCollection services,
string address
)
{
services.AddHttpClient<LocalizationHttpClient>(sp =>
{
sp.BaseAddress = new Uri(address);
});
services.AddJsonLocalization(builder =>
{
builder
.UseHttpClientJson(options =>
{
options.ResourcesPath = "resources";
options.Assemblies = [typeof(LayoutLib.RCL.SharedRes).Assembly, typeof(Auth.RCL.SharedRes).Assembly, typeof(ECommerce.RCL.SharedRes).Assembly];
options.HttpClientBuilder = sp => sp.GetRequiredService<IHttpClientFactory>().CreateClient(nameof(LocalizationHttpClient));
});
}, ServiceLifetime.Singleton);
return services;
}
}
}