Files
radzen-blazor/RadzenBlazorDemos/Program.cs
Vladimir Enchev e5bd0343fa Add built-in German, French, Spanish, Italian and Japanese translations
Ship satellite resource files (RadzenStrings.{de,fr,es,it,ja}.resx) with all
535 strings translated, so components localize out of the box via the standard
.NET ResourceManager.

Make culture handling reactive everywhere:
- RadzenDatePicker rebuilds its month/year lists when Culture or the
  DefaultCulture cascade changes (previously cached at init).
- Scheduler views, HtmlEditor tools and the spreadsheet ChartOverlay localize
  through their parent component's UICulture instead of CurrentUICulture;
  spreadsheet dialogs honor a DefaultUICulture cascade. UICulture is added to
  IScheduler/ISpreadsheet as default interface members, so this is non-breaking.

Update the Localization demo with an interactive language switcher (cascading
DefaultUICulture + DefaultCulture) backed by an ILocalizer so it works in-place
on Blazor WebAssembly.
2026-06-15 18:45:19 +03:00

35 lines
1.1 KiB
C#

using System;
using System.Net.Http;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.DependencyInjection;
using RadzenBlazorDemos.Services;
using Radzen;
using RadzenBlazorDemos.Data;
using RadzenBlazorDemos;
using Microsoft.Extensions.Configuration;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddDbContextFactory<NorthwindContext>();
builder.Services.AddScoped<ILocalizer, DemoLocalizer>();
builder.Services.AddRadzenComponents();
builder.Services.AddRadzenQueryStringThemeService();
builder.Services.AddScoped<ExampleService>();
builder.Services.AddScoped<NorthwindService>();
builder.Services.AddScoped<NorthwindODataService>();
builder.Services.AddSingleton<GitHubService>();
builder.Services.AddAIChatService(options =>
{
options.Proxy = "api/chat/completions";
options.Model = "@cf/meta/llama-3.1-8b-instruct";
options.SystemPrompt = "You are a helpful AI code assistant.";
options.Temperature = 0.7;
});
await builder.Build().RunAsync();