diff options
| author | Cody Robibero <cody@robibe.ro> | 2026-06-27 10:02:33 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-27 10:02:33 -0400 |
| commit | 75d71cb73cb0b1e64b893b72afec1d59963e7e56 (patch) | |
| tree | 8e8f4d02276e8ff863a02ca4331ad875d93d2b27 /Emby.Server.Implementations/Localization/LocalizationManager.cs | |
| parent | 310a47c1d4f241346cc4cda4e025758bf1e6247c (diff) | |
| parent | c158418e0b6e2449c91e022c7cc23981658b5449 (diff) | |
Merge branch 'master' into clean-orphaned-people
Diffstat (limited to 'Emby.Server.Implementations/Localization/LocalizationManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Localization/LocalizationManager.cs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/Localization/LocalizationManager.cs b/Emby.Server.Implementations/Localization/LocalizationManager.cs index 843e35afcc..6971431155 100644 --- a/Emby.Server.Implementations/Localization/LocalizationManager.cs +++ b/Emby.Server.Implementations/Localization/LocalizationManager.cs @@ -566,11 +566,15 @@ namespace Emby.Server.Implementations.Localization private static string GetResourceFilename(string culture) { - var parts = culture.Split('-'); + // Region codes may use a '-' (BCP-47, e.g. "pt-BR") or '_' (e.g. "es_419", "ar_SA") separator. + // Normalize the casing (lower-case language, upper-case region) while preserving the separator + // so the result matches the embedded resource file name, which is case-sensitive. + var separatorIndex = culture.IndexOfAny(['-', '_']); - if (parts.Length == 2) + if (separatorIndex > 0) { - culture = parts[0].ToLowerInvariant() + "-" + parts[1].ToUpperInvariant(); + var separator = culture[separatorIndex]; + culture = culture[..separatorIndex].ToLowerInvariant() + separator + culture[(separatorIndex + 1)..].ToUpperInvariant(); } else { |
