aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2026-05-16 09:57:06 +0200
committerShadowghost <Ghost_of_Stone@web.de>2026-05-16 09:57:06 +0200
commitea8f6c51fd1013b6c841fb74a7fcde532d57d8da (patch)
tree53ccd2afeda449f22e4198dfcf3b78993938a654 /Jellyfin.Server
parentd71194aa8cb07d998c0ed15df964c7c1259e7f17 (diff)
parentc4a21cb3224b284ecde65cf978a12de82d9f910c (diff)
Merge remote-tracking branch 'upstream/master' into search-rebased
Diffstat (limited to 'Jellyfin.Server')
-rw-r--r--Jellyfin.Server/Startup.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/Jellyfin.Server/Startup.cs b/Jellyfin.Server/Startup.cs
index f6a4ae7d6e..1802440dc4 100644
--- a/Jellyfin.Server/Startup.cs
+++ b/Jellyfin.Server/Startup.cs
@@ -1,4 +1,5 @@
using System;
+using System.Globalization;
using System.IO;
using System.Net;
using System.Net.Http;
@@ -6,6 +7,7 @@ using System.Net.Http.Headers;
using System.Net.Mime;
using System.Text;
using Emby.Server.Implementations.EntryPoints;
+using Emby.Server.Implementations.Localization;
using Jellyfin.Api.Middleware;
using Jellyfin.Database.Implementations;
using Jellyfin.LiveTv.Extensions;
@@ -22,6 +24,7 @@ using MediaBrowser.Controller.Extensions;
using MediaBrowser.XbmcMetadata;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Localization;
using Microsoft.AspNetCore.StaticFiles;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
@@ -127,6 +130,25 @@ namespace Jellyfin.Server
services.AddHlsPlaylistGenerator();
services.AddLiveTvServices();
+ var serverUICulture = _serverConfigurationManager.Configuration.UICulture;
+ if (string.IsNullOrEmpty(serverUICulture))
+ {
+ serverUICulture = "en-US";
+ }
+
+ CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo(serverUICulture);
+
+ services.Configure<RequestLocalizationOptions>(options =>
+ {
+ var supportedUICultures = LocalizationManager.GetSupportedUICultures();
+ options.SupportedCultures = supportedUICultures;
+ options.SupportedUICultures = supportedUICultures;
+ options.DefaultRequestCulture = new RequestCulture(serverUICulture);
+ options.ApplyCurrentCultureToResponseHeaders = true;
+ options.FallBackToParentCultures = true;
+ options.FallBackToParentUICultures = true;
+ });
+
services.AddHostedService<RecordingsHost>();
services.AddHostedService<AutoDiscoveryHost>();
services.AddHostedService<NfoUserDataSaver>();
@@ -168,6 +190,8 @@ namespace Jellyfin.Server
mainApp.UseCors();
+ mainApp.UseRequestLocalization();
+
if (config.RequireHttps && _serverApplicationHost.ListenWithHttps)
{
mainApp.UseHttpsRedirection();