Skip to content

Commit

Permalink
Add banner for no provider subs!
Browse files Browse the repository at this point in the history
  • Loading branch information
Captain Jack Sparrow committed May 24, 2024
1 parent ad85a9f commit 72b034b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/assets/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,9 @@
},
"title": "Subtitles",
"unknownLanguage": "Unknown",
"dropSubtitleFile": "Drop subtitle file here! >_<"
"dropSubtitleFile": "Drop subtitle file here! >_<",
"scrapeButton": "Scrape subtitles",
"empty": "There are no provided subtitles for this."
}
},
"metadata": {
Expand Down
17 changes: 16 additions & 1 deletion src/components/player/atoms/settings/CaptionsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,22 @@ export function CaptionsView({ id }: { id: string }) {
{t("player.menus.subtitles.offChoice")}
</CaptionOption>
<CustomCaptionOption />
{content}
{content.length === 0 ? (
<div className="p-4 rounded-xl bg-video-context-light bg-opacity-10 font-medium text-center">
<div className="flex flex-col items-center justify-center gap-3">
{t("player.menus.subtitles.empty")}
<button
type="button"
onClick={() => router.navigate("/captions/opensubtitles")}
className="p-1 w-3/4 rounded tabbable duration-200 bg-opacity-10 bg-video-context-light hover:bg-opacity-20"
>
{t("player.menus.subtitles.scrapeButton")}
</button>
</div>
</div>
) : (
content
)}
</Menu.ScrollToActiveSection>
</FileDropHandler>
</>
Expand Down

0 comments on commit 72b034b

Please sign in to comment.