New: Add Afrikaans language

pull/10715/head
Barry Mieny 4 months ago committed by Bogdan
parent 71ccebd0f5
commit 4b4e598b67

@ -62,7 +62,8 @@ namespace NzbDrone.Core.Test.Languages
new object[] { 47, Language.Slovenian },
new object[] { 48, Language.Malayalam },
new object[] { 49, Language.Kannada },
new object[] { 50, Language.Albanian }
new object[] { 50, Language.Albanian },
new object[] { 51, Language.Afrikaans }
};
public static object[] ToIntCases =
@ -119,7 +120,8 @@ namespace NzbDrone.Core.Test.Languages
new object[] { Language.Slovenian, 47 },
new object[] { Language.Malayalam, 48 },
new object[] { Language.Kannada, 49 },
new object[] { Language.Albanian, 50 }
new object[] { Language.Albanian, 50 },
new object[] { Language.Afrikaans, 51 }
};
[Test]

@ -53,5 +53,14 @@ namespace NzbDrone.Core.Test.ParserTests
var result = IsoLanguages.Find(isoCode);
result.Language.Should().Be(Language.Telugu);
}
[TestCase("af")]
[TestCase("afr")]
[TestCase("af-ZA")]
public void should_return_afrikaans(string isoCode)
{
var result = IsoLanguages.Find(isoCode);
result.Language.Should().Be(Language.Afrikaans);
}
}
}

@ -452,6 +452,14 @@ namespace NzbDrone.Core.Test.ParserTests
result.Should().Contain(Language.Albanian);
}
[TestCase("Movie Title (2024) Afrikaans 1080p HD AVC MP4 x264 .9.8GB TEAMTR")]
[TestCase("Movie.Title.2024.Afrikaans.1080p.AMZN.WEB-DL.DD+2.0.x264-Telly")]
public void should_parse_language_afrikaans(string postTitle)
{
var result = LanguageParser.ParseLanguages(postTitle);
result.Should().Contain(Language.Afrikaans);
}
[TestCase("Movie.Title.en.sub")]
[TestCase("Movie Title.eng.sub")]
[TestCase("Movie.Title.eng.forced.sub")]

@ -63,6 +63,8 @@ namespace NzbDrone.Core.ImportLists.TMDb
[FieldOption(Hint = "Kannada")]
kn,
[FieldOption(Hint = "Albanian")]
sq
sq,
[FieldOption(Hint = "Afrikaans")]
af
}
}

@ -121,6 +121,7 @@ namespace NzbDrone.Core.Languages
public static Language Malayalam => new Language(48, "Malayalam");
public static Language Kannada => new Language(49, "Kannada");
public static Language Albanian => new Language(50, "Albanian");
public static Language Afrikaans => new Language(51, "Afrikaans");
public static Language Any => new Language(-1, "Any");
public static Language Original => new Language(-2, "Original");
@ -181,6 +182,7 @@ namespace NzbDrone.Core.Languages
Malayalam,
Kannada,
Albanian,
Afrikaans,
Any,
Original
};

@ -60,6 +60,7 @@ namespace NzbDrone.Core.Parser
new IsoLanguage("ml", "", "mal", "Malayalam", Language.Malayalam),
new IsoLanguage("kn", "", "kan", "Kannada", Language.Kannada),
new IsoLanguage("sq", "", "sqi", "Albanian", Language.Albanian),
new IsoLanguage("af", "", "afr", "Afrikaans", Language.Afrikaans),
};
private static readonly Dictionary<string, Language> AlternateIsoCodeMappings = new ()

@ -234,6 +234,11 @@ namespace NzbDrone.Core.Parser
languages.Add(Language.Albanian);
}
if (lowerTitle.Contains("afrikaans"))
{
languages.Add(Language.Afrikaans);
}
// Case sensitive
var caseSensitiveMatches = CaseSensitiveLanguageRegex.Matches(title);

Loading…
Cancel
Save