diff options
| author | Cody Robibero <cody@robibe.ro> | 2026-06-27 09:46:45 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-27 09:46:45 -0400 |
| commit | ed5e868a6bb5f124565bc2fb2c4c9f798af7f450 (patch) | |
| tree | 34ba5286e94399ebc1e6f67177ee0466ce3380ee /tests | |
| parent | 58de9b7a9934568c835853e2da728c4ef5083a1a (diff) | |
| parent | f398b6d08b46544f61523c6871624201a2b54dfc (diff) | |
Merge pull request #17187 from Shadowghost/fix-localization-lookup
Fix localization lookup
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Jellyfin.Server.Implementations.Tests/Localization/LocalizationManagerTests.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/Jellyfin.Server.Implementations.Tests/Localization/LocalizationManagerTests.cs b/tests/Jellyfin.Server.Implementations.Tests/Localization/LocalizationManagerTests.cs index 3b8fe5ca60..bdb726f06d 100644 --- a/tests/Jellyfin.Server.Implementations.Tests/Localization/LocalizationManagerTests.cs +++ b/tests/Jellyfin.Server.Implementations.Tests/Localization/LocalizationManagerTests.cs @@ -345,6 +345,20 @@ namespace Jellyfin.Server.Implementations.Tests.Localization } [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() { var localizationManager = Setup(new ServerConfiguration |
