Skip to content

Commit

Permalink
Run formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
Mc-muffin committed Nov 21, 2024
1 parent 509aed4 commit 5c2f7c8
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion TranslationApp/fMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,7 @@ private void fMain_Resize(object sender, EventArgs e)
middleColumn.Size = new Size((int)(ClientSize.Width * 0.4f), middleColumn.Height);
//rightColumn.Size = new Size((int)(ClientSize.Width * 0.3f), rightColumn.Height);
}
else if(WindowState == FormWindowState.Normal)
else if (WindowState == FormWindowState.Normal)
{
leftColumn.Size = new Size((int)(ClientSize.Width * 0.3f), leftColumn.Height);
middleColumn.Size = new Size((int)(ClientSize.Width * 0.35f), middleColumn.Height);
Expand Down
1 change: 0 additions & 1 deletion TranslationLib/EntryFound.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public class EntryFound
public string Section { get; set; }
public int Id { get; set; }
public XMLEntry Entry { get; set; }

public string Category { get; set; }

}
Expand Down
6 changes: 3 additions & 3 deletions TranslationLib/XMLEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ public bool IsFound(string text, bool matchWholeEntry, bool matchCase, bool matc
textCompare = JapaneseText;
else
textCompare = EnglishText;
if (matchWholeEntry)

if (matchWholeEntry)
return textCompare != null ? textCompare == text : false;

if (matchCase)
return textCompare != null ? textCompare.Contains(text) : false;

Expand Down
24 changes: 12 additions & 12 deletions TranslationLib/XMLFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ public void UpdateAllEntryText()
var speakerDict = keys.Zip(values, (k, v) => new { k, v })
.ToDictionary(x => x.k, x => x.v);

foreach (var XMLSection in Sections.Where(x=>x.Entries.Where(y => y.SpeakerId != null).Count() > 0))
foreach (var XMLSection in Sections.Where(x => x.Entries.Where(y => y.SpeakerId != null).Count() > 0))
{
foreach (var XMLEntry in XMLSection.Entries)
{
List<string> ls = new List<string>();

if (XMLEntry.SpeakerId != null)
{
foreach (var id in XMLEntry.SpeakerId)
Expand All @@ -49,8 +49,8 @@ public void UpdateAllEntryText()

XMLEntry.SpeakerName = string.Join(" / ", ls);
}
else
XMLEntry.SpeakerName = null;
else
XMLEntry.SpeakerName = null;
}
}
}
Expand Down Expand Up @@ -106,7 +106,7 @@ public List<string> GetSectionNames()

public void SaveToDisk()
{

var sectionsElements = Sections.Where(s => s.Name != "All strings").Select(GetXmlSectionElement);
List<XElement> allSections = new List<XElement>();

Expand Down Expand Up @@ -182,7 +182,7 @@ public void SaveAsCsv(string path)
if (entry.SpeakerId != null)
{
foreach (var id in entry.SpeakerId)
{
{
if (!string.IsNullOrEmpty(en_names[id]))
en.Add(en_names[id]);
if (!string.IsNullOrEmpty(jp_names[id]))
Expand All @@ -205,14 +205,14 @@ public void SaveAsCsv(string path)
"\"" + jp_name + "\"" + "," +
"\"" + jp_text.Replace("\"", "\"\"") + "\"" + "," +
"\"" + en_name + "\"" + "," +
"\"" + en_text.Replace("\"", "\"\"") + "\"" + "," +
"\"" + en_text.Replace("\"", "\"\"") + "\"" + "," +
"\"" + entry.Notes + "\""
);
}
}
}
}

private XElement GetXmlSpeakerElement(List<XMLEntry> SpeakerList)
{
var speakerEntry = new List<XElement>
Expand Down Expand Up @@ -306,7 +306,7 @@ private static XElement GetXMLEntryElement(XMLEntry entry, bool isLegacy)
public List<EntryFound> SearchJapanese(string folder, int fileId, string text, bool matchWholeentry, bool matchCase, bool matchWholeWord, string language)
{
List<EntryFound> res = new List<EntryFound>();
foreach( XMLSection section in Sections)
foreach (XMLSection section in Sections)
{
if (section.Name != "All strings")
{
Expand All @@ -331,9 +331,9 @@ private List<EntryFound> SearchSpeaker(string folder, int fileId, string text, b
{
List<EntryFound> res = new List<EntryFound>();
List<int> foundIndexes;
foundIndexes = Enumerable.Range(0, Speakers.Count)
.Where(e => Speakers[e].IsFound(text, matchWholeEntry, matchCase, matchWholeWord, language))
.ToList();
foundIndexes = Enumerable.Range(0, Speakers.Count)
.Where(e => Speakers[e].IsFound(text, matchWholeEntry, matchCase, matchWholeWord, language))
.ToList();

if (foundIndexes.Count > 0)
{
Expand Down
7 changes: 4 additions & 3 deletions TranslationLib/XMLFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public void LoadXMLs()
{
foreach (var file in fileList)
{
if (file.EndsWith(".xml", StringComparison.OrdinalIgnoreCase)) {
if (file.EndsWith(".xml", StringComparison.OrdinalIgnoreCase))
{
XMLFiles.Add(LoadXML(file));
}
}
Expand Down Expand Up @@ -241,10 +242,10 @@ public List<EntryFound> SearchJapanese(string japText, bool matchWholeEntry, boo
{
List<EntryFound> dict = new List<EntryFound>();

for(int i=0; i<XMLFiles.Count; i++)
for (int i = 0; i < XMLFiles.Count; i++)
{
var res = XMLFiles[i].SearchJapanese(Name, i, japText, matchWholeEntry, matchCase, matchWholeWord, language);
if(res.Count() > 0)
if (res.Count() > 0)
dict.AddRange(res);
}
return dict;
Expand Down
6 changes: 3 additions & 3 deletions TranslationLib/XMLSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public List<EntryFound> SearchJapanese(string folder, int fileId, string section
foundIndexes = Enumerable.Range(0, Entries.Count)
.Where(e => Entries[e].IsFound(text, matchWholeEntry, matchCase, matchWholeWord, language))
.ToList();

if (foundIndexes.Count > 0)
{

foreach (int index in foundIndexes)
{
EntryFound entry = new EntryFound();
Expand All @@ -57,7 +57,7 @@ public List<EntryFound> SearchJapanese(string folder, int fileId, string section
entry.Entry.Status = "To Do";
res.Add(entry);
}

}
return res;
}
Expand Down

0 comments on commit 5c2f7c8

Please sign in to comment.