Merge pull request #8086 from ivandrofly/issues/linux-lang-issue-8084

Fixes #8084
This commit is contained in:
Nikolaj Olsson 2024-03-28 14:39:11 +01:00 committed by GitHub
commit af80665222
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -491,7 +491,13 @@ namespace Nikse.SubtitleEdit.Forms.Translate
var installedLanguages = new List<string>(); var installedLanguages = new List<string>();
foreach (InputLanguage language in InputLanguage.InstalledInputLanguages) foreach (InputLanguage language in InputLanguage.InstalledInputLanguages)
{ {
var iso639 = Iso639Dash2LanguageCode.GetTwoLetterCodeFromEnglishName(language.LayoutName); var layoutName = language.LayoutName;
// related to https://github.com/SubtitleEdit/subtitleedit/issues/8084
if (string.IsNullOrEmpty(layoutName))
{
continue;
}
var iso639 = Iso639Dash2LanguageCode.GetTwoLetterCodeFromEnglishName(layoutName);
if (!string.IsNullOrEmpty(iso639) && !installedLanguages.Contains(iso639)) if (!string.IsNullOrEmpty(iso639) && !installedLanguages.Contains(iso639))
{ {
installedLanguages.Add(iso639.ToLowerInvariant()); installedLanguages.Add(iso639.ToLowerInvariant());