Fix localization lookup

This commit is contained in:
Shadowghost
2026-06-26 08:20:55 +02:00
parent b9db4566a7
commit f398b6d08b
3 changed files with 21 additions and 67 deletions

View File

@@ -344,6 +344,20 @@ namespace Jellyfin.Server.Implementations.Tests.Localization
Assert.NotEqual("Default", translated);
}
[Fact]
public void GetLocalizedString_WithBcp47NormalizationToUppercaseRegion_ReturnsTranslation()
{
var localizationManager = Setup(new ServerConfiguration
{
UICulture = "en-US"
});
// he-IL normalizes to the underscore resource he_IL. The resource lookup is case-sensitive,
// so the region casing has to be preserved or the file is not found and we fall back to en-US.
var translated = localizationManager.GetLocalizedString("Books", "he-IL");
Assert.Equal("ספרים", translated);
}
[Fact]
public void GetServerLocalizedString_UsesServerCulture()
{