Add Italian se dictionary file - thx HG3112 :)

Work on #7503
This commit is contained in:
niksedk 2023-10-11 08:52:48 +02:00
parent 8ed96e2b24
commit e826a79776
7 changed files with 46 additions and 12 deletions

View File

@ -0,0 +1,7 @@
<words>
<word>a</word>
<word>e</word>
<word>è</word>
<word>i</word>
<word>o</word>
</words>

View File

@ -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\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\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\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.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\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 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\nl_NL_se.xml'));
DeleteFile(ExpandConstant('{userappdata}\Subtitle Edit\Dictionaries\pt_PT_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\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\???_OCRFixReplaceList_User.xml'), False, True, False);
DelTree(ExpandConstant('{userappdata}\Subtitle Edit\Dictionaries\*.dic'), False, True, False); DelTree(ExpandConstant('{userappdata}\Subtitle Edit\Dictionaries\*.dic'), False, True, False);
DelTree(ExpandConstant('{userappdata}\Subtitle Edit\Dictionaries\*.aff'), False, True, False); DelTree(ExpandConstant('{userappdata}\Subtitle Edit\Dictionaries\*.aff'), False, True, False);

View File

@ -1042,7 +1042,16 @@ namespace Nikse.SubtitleEdit.Core.Common
word = word.Trim(); word = word.Trim();
if (word.Length > 0) 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(); var userWords = new XmlDocument();
if (File.Exists(userWordsXmlFileName)) if (File.Exists(userWordsXmlFileName))
{ {
@ -1093,7 +1102,17 @@ namespace Nikse.SubtitleEdit.Core.Common
{ {
userWordList.Clear(); userWordList.Clear();
var userWordDictionary = new XmlDocument(); 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)) if (File.Exists(userWordListXmlFileName))
{ {
userWordDictionary.Load(userWordListXmlFileName); userWordDictionary.Load(userWordListXmlFileName);
@ -1106,6 +1125,9 @@ namespace Nikse.SubtitleEdit.Core.Common
} }
} }
} }
return userWordListXmlFileName; return userWordListXmlFileName;
} }

View File

@ -43,7 +43,7 @@ namespace Nikse.SubtitleEdit.Forms
return; return;
} }
string language = comboBoxDictionaries.Text; var language = comboBoxDictionaries.Text;
if (language.IndexOf('[') >= 0) if (language.IndexOf('[') >= 0)
{ {
language = language.Substring(language.IndexOf('[')).TrimStart('['); language = language.Substring(language.IndexOf('[')).TrimStart('[');

View File

@ -683,14 +683,17 @@ namespace Nikse.SubtitleEdit.Forms
Action = CommandLineConverter.BatchAction.BeautifyTimeCodes, Action = CommandLineConverter.BatchAction.BeautifyTimeCodes,
Control = groupBoxBeautifyTimeCodes, Control = groupBoxBeautifyTimeCodes,
}, },
new FixActionItem //new FixActionItem
{ //{
Text = LanguageSettings.Current.GoogleTranslate.Title, // Text = LanguageSettings.Current.GoogleTranslate.Title,
Checked = Configuration.Settings.Tools.BatchConvertBeautifyTimeCodes, // Checked = Configuration.Settings.Tools.BatchConvertBeautifyTimeCodes,
Action = CommandLineConverter.BatchAction.AutoTranslate, // Action = CommandLineConverter.BatchAction.AutoTranslate,
Control = groupBoxAutoTranslate, // Control = groupBoxAutoTranslate,
}, //},
}; };
groupBoxAutoTranslate.Visible = false;
foreach (var fixItem in fixItems) foreach (var fixItem in fixItems)
{ {
var listViewItem = new ListViewItem { Tag = fixItem }; var listViewItem = new ListViewItem { Tag = fixItem };

View File

@ -264,7 +264,7 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
private void ButtonAddToDictionaryClick(object sender, EventArgs e) private void ButtonAddToDictionaryClick(object sender, EventArgs e)
{ {
string s = textBoxWord.Text.Trim(); var s = textBoxWord.Text.Trim();
Word = s; Word = s;
if (s.Length == 0 || s.Contains(' ')) if (s.Length == 0 || s.Contains(' '))
{ {

View File

@ -1230,7 +1230,7 @@ namespace Nikse.SubtitleEdit.Forms.Translate
if (listViewSelected.SelectedItems.Count > 0) if (listViewSelected.SelectedItems.Count > 0)
{ {
var first = listViewSelected.TopItem.Index; var first = listViewSelected.TopItem.Index;
int index = listViewSelected.SelectedItems[0].Index; var index = listViewSelected.SelectedItems[0].Index;
if (index < listViewOther.Items.Count) if (index < listViewOther.Items.Count)
{ {
listViewOther.SelectIndexAndEnsureVisible(index, false); listViewOther.SelectIndexAndEnsureVisible(index, false);