From e19ac55847d5d560e15f1e25a21482e17a324c1f Mon Sep 17 00:00:00 2001 From: Jorrin Date: Sun, 24 Mar 2024 23:55:58 +0100 Subject: [PATCH] add pretty language to menu selection --- src/components/player/atoms/settings/SettingsMenu.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/player/atoms/settings/SettingsMenu.tsx b/src/components/player/atoms/settings/SettingsMenu.tsx index e47dc6f5..8198d87b 100644 --- a/src/components/player/atoms/settings/SettingsMenu.tsx +++ b/src/components/player/atoms/settings/SettingsMenu.tsx @@ -36,6 +36,11 @@ export function SettingsMenu({ id }: { id: string }) { t("player.menus.subtitles.unknownLanguage") : undefined; + const selectedAudioLanguagePretty = currentAudioTrack + ? getPrettyLanguageNameFromLocale(currentAudioTrack.language) ?? + t("player.menus.subtitles.unknownLanguage") + : undefined; + const source = usePlayerStore((s) => s.source); const downloadable = source?.type === "file" || source?.type === "hls"; @@ -55,7 +60,7 @@ export function SettingsMenu({ id }: { id: string }) { {currentAudioTrack && ( router.navigate("/audio")} - rightText={currentAudioTrack ? currentAudioTrack.label : ""} + rightText={selectedAudioLanguagePretty ?? undefined} > {t("player.menus.settings.audioItem")}