Skip to content

Commit

Permalink
Change the wording and change the check romanization logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy840119 committed Mar 10, 2024
1 parent 8dc43ab commit ad1b9a3
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ protected override NavigationTextContainer CreateTextContainer()

protected override NavigationState GetState(Lyric[] lyrics)
{
// technically, all non-english lyric should have romaji.
if (lyrics.All(hasRomaji))
// technically, all non-english lyric should have romanisation.
if (lyrics.All(hasRomanisation))
return NavigationState.Done;

// not all (japanese) lyric contains ruby, so it's ok with that.
if (lyrics.Any(hasRuby) || lyrics.Any(hasRomaji))
if (lyrics.Any(hasRuby) || lyrics.Any(hasRomanisation))
return NavigationState.Working;

return NavigationState.Initial;

static bool hasRuby(Lyric lyric)
=> lyric.RubyTags.Any();

static bool hasRomaji(Lyric lyric)
=> lyric.RubyTags.Any();
static bool hasRomanisation(Lyric lyric)
=> lyric.TimeTags.Any(x => !string.IsNullOrEmpty(x.RomanisedSyllable));
}

protected override LocalisableString GetNavigationText(NavigationState value) =>
Expand Down

0 comments on commit ad1b9a3

Please sign in to comment.