Fix culture

This commit is contained in:
Laura Hausmann 2023-05-16 00:26:57 +02:00
parent 6f5439d1b9
commit d0624f8b26
Signed by: zotan
GPG key ID: D044E84C5BE01605

View file

@ -1,5 +1,7 @@
using System.Globalization;
using System.Reflection;
using AfRApay.Web.Backend.Database;
using Microsoft.AspNetCore.Localization;
using Microsoft.EntityFrameworkCore;
using Swashbuckle.AspNetCore.Filters;
@ -23,6 +25,13 @@ builder.Services.AddControllers();
var app = builder.Build();
var culture = new CultureInfo("de-DE") { NumberFormat = { NumberDecimalSeparator = ".", CurrencyDecimalSeparator = "." } };
app.UseRequestLocalization(options => {
options.DefaultRequestCulture = new RequestCulture(culture);
options.SupportedCultures = new List<CultureInfo> { culture };
});
if (app.Environment.IsDevelopment()) {
app.UseSwagger();
app.UseSwaggerUI();