Skip to content

Commit

Permalink
Adjust behavior for showing other translations
Browse files Browse the repository at this point in the history
  • Loading branch information
fortiersteven authored and Mc-muffin committed Apr 2, 2024
1 parent e1869f6 commit d921fbd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions TranslationApp/fMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public partial class fMain : Form
private static List<EntryFound> OtherTranslations;
private Dictionary<string, Color> ColorByStatus;
private string gameName;
private int nbJapaneseDuplicate;

private readonly string MULTIPLE_STATUS = "<Multiple Status>";
private readonly string MULTIPLE_SELECT = "<Multiple Entries Selected>";
Expand Down Expand Up @@ -364,7 +365,7 @@ private void ShowOtherTranslations()

int distinctCount = OtherTranslations.Select(x => x.Entry.EnglishText).Distinct().Count();

if (distinctCount > 0)
if (nbJapaneseDuplicate > 0)
lNbOtherTranslations.Text = $"({distinctCount} other translation(s) found)";
else
lNbOtherTranslations.Text = "";
Expand Down Expand Up @@ -461,8 +462,12 @@ private void LoadEntryData(ListBox lb)
else
Project.CurrentFolder.Translations.TryGetValue(currentEntry.JapaneseText, out TranslationEntry);

nbJapaneseDuplicate = 0;
if (TranslationEntry != null && TranslationEntry.Count > 1)
lblJapanese.Text = $@"Japanese ({TranslationEntry.Count - 1} duplicate(s) found)";
{
nbJapaneseDuplicate = TranslationEntry.Count - 1;
lblJapanese.Text = $@"Japanese ({nbJapaneseDuplicate} duplicate(s) found)";
}
else
lblJapanese.Text = $@"Japanese";

Expand Down

0 comments on commit d921fbd

Please sign in to comment.