|
[Startup.cs]
public void ConfigureServices(IServiceCollection services)
{
services.AddSyncfusionBlazor();
services.AddLocalization(options => options.ResourcesPath = "Resources");
services.Configure<RequestLocalizationOptions>(options =>
{
// // define the list of cultures your app will support
var supportedCultures = new List<CultureInfo>()
{
new CultureInfo("en-US"),
new CultureInfo("de")
};
// set the default culture
options.DefaultRequestCulture = new RequestCulture("de");
options.DefaultRequestCulture.Culture.NumberFormat.CurrencySymbol = supportedCultures[1].NumberFormat.CurrencySymbol;
options.SupportedCultures = supportedCultures;
options.SupportedUICultures = supportedCultures;
options.RequestCultureProviders = new List<IRequestCultureProvider>() {
new QueryStringRequestCultureProvider()
};
});
services.AddRazorPages();
services.AddServerSideBlazor();
services.AddSingleton(typeof(ISyncfusionStringLocalizer), typeof(SampleLocalizer));
services.AddSingleton<WeatherForecastService>();
} |
|
[index.razor]
@using Syncfusion.Blazor.Inputs
<SfNumericTextBox TValue="int?" Format="c2"></SfNumericTextBox> |