Further refinement of BCP 47 language labeling support

This commit is contained in:
dyphire
2025-07-30 22:15:37 +08:00
parent f9c4c9b345
commit 2007815fa6
8 changed files with 84 additions and 27 deletions

View File

@@ -128,7 +128,8 @@ namespace Emby.Server.Implementations.Localization
}
string name = parts[3];
if (string.IsNullOrWhiteSpace(name))
string displayname = parts[3];
if (string.IsNullOrWhiteSpace(displayname))
{
continue;
}
@@ -138,6 +139,10 @@ namespace Emby.Server.Implementations.Localization
{
continue;
}
else if (twoCharName.Contains('-', StringComparison.OrdinalIgnoreCase))
{
name = twoCharName;
}
string[] threeLetterNames;
if (string.IsNullOrWhiteSpace(parts[1]))
@@ -153,7 +158,7 @@ namespace Emby.Server.Implementations.Localization
iso6392BtoTdict.TryAdd(parts[1], parts[0]);
}
list.Add(new CultureDto(name, name, twoCharName, threeLetterNames));
list.Add(new CultureDto(name, displayname, twoCharName, threeLetterNames));
}
_cultures = list;