New: Add 'zhtw' and 'yue' language codes as Chinese language

Closes #6363
This commit is contained in:
Stevie Robinson 2024-01-16 06:52:40 +01:00 committed by GitHub
parent 091449d9bf
commit 666455f9b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -64,7 +64,9 @@ namespace NzbDrone.Core.Parser
{ "cze", Language.Czech }, { "cze", Language.Czech },
{ "dut", Language.Dutch }, { "dut", Language.Dutch },
{ "mac", Language.Macedonian }, { "mac", Language.Macedonian },
{ "rum", Language.Romanian } { "rum", Language.Romanian },
{ "yue", Language.Chinese },
{ "zhtw", Language.Chinese }
}; };
public static IsoLanguage Find(string isoCode) public static IsoLanguage Find(string isoCode)
@ -86,6 +88,10 @@ namespace NzbDrone.Core.Parser
return isoLanguages.FirstOrDefault(); return isoLanguages.FirstOrDefault();
} }
else if (AlternateIsoCodeMappings.TryGetValue(isoCode, out var alternateLanguage))
{
return Get(alternateLanguage);
}
else if (langCode.Length == 3) else if (langCode.Length == 3)
{ {
// Lookup ISO639-2T code // Lookup ISO639-2T code
@ -96,10 +102,6 @@ namespace NzbDrone.Core.Parser
return All.FirstOrDefault(l => l.ThreeLetterCode == langCode); return All.FirstOrDefault(l => l.ThreeLetterCode == langCode);
} }
else if (AlternateIsoCodeMappings.TryGetValue(isoCode, out var alternateLanguage))
{
return Get(alternateLanguage);
}
return null; return null;
} }