diff --git a/Dictionaries/it_IT_se.xml b/Dictionaries/it_IT_se.xml new file mode 100644 index 000000000..6789baa68 --- /dev/null +++ b/Dictionaries/it_IT_se.xml @@ -0,0 +1,7 @@ + + a + e + รจ + i + o + \ No newline at end of file diff --git a/installer/Subtitle_Edit_Installer.iss b/installer/Subtitle_Edit_Installer.iss index 436163908..d34275e8a 100644 --- a/installer/Subtitle_Edit_Installer.iss +++ b/installer/Subtitle_Edit_Installer.iss @@ -236,6 +236,7 @@ Source: ..\Dictionaries\fi_FI_se.xml; DestDir: {userappdata}\Subtit Source: ..\Dictionaries\nl_NL_se.xml; DestDir: {userappdata}\Subtitle Edit\Dictionaries; Flags: ignoreversion onlyifdoesntexist; Components: main Source: ..\Dictionaries\pt_PT_se.xml; DestDir: {userappdata}\Subtitle Edit\Dictionaries; Flags: ignoreversion onlyifdoesntexist; Components: main Source: ..\Dictionaries\ru_RU_se.xml; DestDir: {userappdata}\Subtitle Edit\Dictionaries; Flags: ignoreversion onlyifdoesntexist; Components: main +Source: ..\Dictionaries\it_IT_se.xml; DestDir: {userappdata}\Subtitle Edit\Dictionaries; Flags: ignoreversion onlyifdoesntexist; Components: main Source: ..\Dictionaries\en_US.aff; DestDir: {userappdata}\Subtitle Edit\Dictionaries; Flags: ignoreversion onlyifdoesntexist; Components: main Source: ..\Dictionaries\en_US.dic; DestDir: {userappdata}\Subtitle Edit\Dictionaries; Flags: ignoreversion onlyifdoesntexist; Components: main Source: ..\Dictionaries\dan_WordSplitList.txt; DestDir: {userappdata}\Subtitle Edit\Dictionaries; Flags: ignoreversion onlyifdoesntexist; Components: main @@ -716,6 +717,7 @@ begin DeleteFile(ExpandConstant('{userappdata}\Subtitle Edit\Dictionaries\nl_NL_se.xml')); DeleteFile(ExpandConstant('{userappdata}\Subtitle Edit\Dictionaries\pt_PT_se.xml')); DeleteFile(ExpandConstant('{userappdata}\Subtitle Edit\Dictionaries\ru_RU_se.xml')); + DeleteFile(ExpandConstant('{userappdata}\Subtitle Edit\Dictionaries\it_IT_se.xml')); DelTree(ExpandConstant('{userappdata}\Subtitle Edit\Dictionaries\???_OCRFixReplaceList_User.xml'), False, True, False); DelTree(ExpandConstant('{userappdata}\Subtitle Edit\Dictionaries\*.dic'), False, True, False); DelTree(ExpandConstant('{userappdata}\Subtitle Edit\Dictionaries\*.aff'), False, True, False); diff --git a/src/libse/Common/Utilities.cs b/src/libse/Common/Utilities.cs index 65341f953..19e7afff4 100644 --- a/src/libse/Common/Utilities.cs +++ b/src/libse/Common/Utilities.cs @@ -1042,7 +1042,16 @@ namespace Nikse.SubtitleEdit.Core.Common word = word.Trim(); if (word.Length > 0) { - string userWordsXmlFileName = DictionaryFolder + languageName + "_user.xml"; + var userWordsXmlFileName = DictionaryFolder + languageName + "_user.xml"; + if (!File.Exists(userWordsXmlFileName) && languageName != null && languageName.Length> 2) + { + var newFileName = DictionaryFolder + languageName.Substring(0,2).ToLowerInvariant() + "_user.xml"; + if (File.Exists(newFileName)) + { + userWordsXmlFileName = newFileName; + } + } + var userWords = new XmlDocument(); if (File.Exists(userWordsXmlFileName)) { @@ -1093,7 +1102,17 @@ namespace Nikse.SubtitleEdit.Core.Common { userWordList.Clear(); var userWordDictionary = new XmlDocument(); - string userWordListXmlFileName = DictionaryFolder + languageName + "_user.xml"; + var userWordListXmlFileName = DictionaryFolder + languageName + "_user.xml"; + + if (!File.Exists(userWordListXmlFileName) && languageName != null && languageName.Length > 2) + { + var newFileName = DictionaryFolder + languageName.Substring(0, 2).ToLowerInvariant() + "_user.xml"; + if (File.Exists(newFileName)) + { + userWordListXmlFileName = newFileName; + } + } + if (File.Exists(userWordListXmlFileName)) { userWordDictionary.Load(userWordListXmlFileName); @@ -1106,6 +1125,9 @@ namespace Nikse.SubtitleEdit.Core.Common } } } + + + return userWordListXmlFileName; } diff --git a/src/ui/Forms/AddToUserDic.cs b/src/ui/Forms/AddToUserDic.cs index c725da210..c96f443b1 100644 --- a/src/ui/Forms/AddToUserDic.cs +++ b/src/ui/Forms/AddToUserDic.cs @@ -43,7 +43,7 @@ namespace Nikse.SubtitleEdit.Forms return; } - string language = comboBoxDictionaries.Text; + var language = comboBoxDictionaries.Text; if (language.IndexOf('[') >= 0) { language = language.Substring(language.IndexOf('[')).TrimStart('['); diff --git a/src/ui/Forms/BatchConvert.cs b/src/ui/Forms/BatchConvert.cs index 14f7c965a..de79c348a 100644 --- a/src/ui/Forms/BatchConvert.cs +++ b/src/ui/Forms/BatchConvert.cs @@ -683,14 +683,17 @@ namespace Nikse.SubtitleEdit.Forms Action = CommandLineConverter.BatchAction.BeautifyTimeCodes, Control = groupBoxBeautifyTimeCodes, }, - new FixActionItem - { - Text = LanguageSettings.Current.GoogleTranslate.Title, - Checked = Configuration.Settings.Tools.BatchConvertBeautifyTimeCodes, - Action = CommandLineConverter.BatchAction.AutoTranslate, - Control = groupBoxAutoTranslate, - }, + //new FixActionItem + //{ + // Text = LanguageSettings.Current.GoogleTranslate.Title, + // Checked = Configuration.Settings.Tools.BatchConvertBeautifyTimeCodes, + // Action = CommandLineConverter.BatchAction.AutoTranslate, + // Control = groupBoxAutoTranslate, + //}, }; + + groupBoxAutoTranslate.Visible = false; + foreach (var fixItem in fixItems) { var listViewItem = new ListViewItem { Tag = fixItem }; diff --git a/src/ui/Forms/Ocr/OCRSpellCheck.cs b/src/ui/Forms/Ocr/OCRSpellCheck.cs index d1e314489..d301d5aaa 100644 --- a/src/ui/Forms/Ocr/OCRSpellCheck.cs +++ b/src/ui/Forms/Ocr/OCRSpellCheck.cs @@ -264,7 +264,7 @@ namespace Nikse.SubtitleEdit.Forms.Ocr private void ButtonAddToDictionaryClick(object sender, EventArgs e) { - string s = textBoxWord.Text.Trim(); + var s = textBoxWord.Text.Trim(); Word = s; if (s.Length == 0 || s.Contains(' ')) { diff --git a/src/ui/Forms/Translate/AutoTranslate.cs b/src/ui/Forms/Translate/AutoTranslate.cs index 60bc5cff0..71bdf1001 100644 --- a/src/ui/Forms/Translate/AutoTranslate.cs +++ b/src/ui/Forms/Translate/AutoTranslate.cs @@ -1230,7 +1230,7 @@ namespace Nikse.SubtitleEdit.Forms.Translate if (listViewSelected.SelectedItems.Count > 0) { var first = listViewSelected.TopItem.Index; - int index = listViewSelected.SelectedItems[0].Index; + var index = listViewSelected.SelectedItems[0].Index; if (index < listViewOther.Items.Count) { listViewOther.SelectIndexAndEnsureVisible(index, false);