diff --git a/IFME/Language.cs b/IFME/Language.cs index d366caa..658eb14 100644 --- a/IFME/Language.cs +++ b/IFME/Language.cs @@ -52,5 +52,16 @@ public static string FromFileNameCode(string filePath) var file = Path.GetFileNameWithoutExtension(filePath); return TryParseCode(file.Substring(file.Length - 3)); } + + public static string FromFileNameCode(string filePath, object lastChoice) + { + var file = Path.GetFileNameWithoutExtension(filePath); + var lang = TryParseCode(file.Substring(file.Length - 3)); + + if (string.Equals(lang, "und")) + return lastChoice.ToString(); + + return lang; + } } } diff --git a/IFME/frmMain.Function.cs b/IFME/frmMain.Function.cs index 735b8ed..75e857e 100644 --- a/IFME/frmMain.Function.cs +++ b/IFME/frmMain.Function.cs @@ -303,7 +303,7 @@ private void MediaSubtitleListAdd(string path) Enable = true, FilePath = path, Id = id, - Lang = "und", + Lang = Language.FromFileNameCode(path, cboSubLang.SelectedValue), Codec = string.Empty }); } diff --git a/changelog.txt b/changelog.txt index 2607c21..10234a6 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,7 @@ Version 8.3.4 (Celestial Rhapsody) ---------------------------------- [Fixed] Check Queue Consistency code cause invalid index crash, such old code is removed +[Fixed] When add subtitle, it will use selected language if language code in file name not found Version 8.3.3 (Luminous Veil) -----------------------------