mirror of
https://github.com/fergalmoran/Readarr.git
synced 2025-12-22 09:29:59 +00:00
Fixed: Account for ISO 639 B vs T
This commit is contained in:
@@ -13,6 +13,31 @@ namespace NzbDrone.Core.Books.Calibre
|
|||||||
private static readonly Dictionary<string, string> ByThree;
|
private static readonly Dictionary<string, string> ByThree;
|
||||||
private static readonly Dictionary<string, string> NameMap;
|
private static readonly Dictionary<string, string> NameMap;
|
||||||
|
|
||||||
|
// generated from https://www.loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt
|
||||||
|
public static readonly Dictionary<string, string> BtoTmap = new ()
|
||||||
|
{
|
||||||
|
{ "alb", "sqi" },
|
||||||
|
{ "arm", "hye" },
|
||||||
|
{ "baq", "eus" },
|
||||||
|
{ "bur", "mya" },
|
||||||
|
{ "chi", "zho" },
|
||||||
|
{ "cze", "ces" },
|
||||||
|
{ "dut", "nld" },
|
||||||
|
{ "fre", "fra" },
|
||||||
|
{ "geo", "kat" },
|
||||||
|
{ "ger", "deu" },
|
||||||
|
{ "gre", "ell" },
|
||||||
|
{ "ice", "isl" },
|
||||||
|
{ "mac", "mkd" },
|
||||||
|
{ "mao", "mri" },
|
||||||
|
{ "may", "msa" },
|
||||||
|
{ "per", "fas" },
|
||||||
|
{ "rum", "ron" },
|
||||||
|
{ "slo", "slk" },
|
||||||
|
{ "tib", "bod" },
|
||||||
|
{ "wel", "cym" }
|
||||||
|
};
|
||||||
|
|
||||||
public static HashSet<string> KnownLanguages { get; }
|
public static HashSet<string> KnownLanguages { get; }
|
||||||
|
|
||||||
static Extensions()
|
static Extensions()
|
||||||
@@ -74,6 +99,11 @@ namespace NzbDrone.Core.Books.Calibre
|
|||||||
{
|
{
|
||||||
return raw;
|
return raw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (BtoTmap.TryGetValue(raw, out var mapped))
|
||||||
|
{
|
||||||
|
return mapped;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NameMap.TryGetValue(raw, out var langByName) ? langByName : null;
|
return NameMap.TryGetValue(raw, out var langByName) ? langByName : null;
|
||||||
|
|||||||
Reference in New Issue
Block a user