diff --git a/src/lib/types.ts b/src/lib/types.ts index 740e45a..fcc77c1 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -88,6 +88,7 @@ export const typingSettingsDefault = { showRomaji: false, showRomajiOnError: true, hideRepeated: false, + ignoreEnglish: false, }; export type TypingSettings = typeof typingSettingsDefault; diff --git a/src/lib/ui/player/IMEHelper.ts b/src/lib/ui/player/IMEHelper.ts index e978c4e..94b6b99 100644 --- a/src/lib/ui/player/IMEHelper.ts +++ b/src/lib/ui/player/IMEHelper.ts @@ -49,4 +49,6 @@ export function dedupLines(lrc: LyricLine[], hide: boolean) { seen.add(key); return true; }); -} \ No newline at end of file +} + +export const isEnglish = (str: string | undefined) => str && /^[a-zA-Z\s.,'!?]+$/.test(str) \ No newline at end of file diff --git a/src/lib/ui/player/Lyrics.svelte b/src/lib/ui/player/Lyrics.svelte index debf27d..033abaa 100644 --- a/src/lib/ui/player/Lyrics.svelte +++ b/src/lib/ui/player/Lyrics.svelte @@ -1,7 +1,7 @@