aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/pages/Settings/Languages/index.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/pages/Settings/Languages/index.tsx')
-rw-r--r--frontend/src/pages/Settings/Languages/index.tsx46
1 files changed, 44 insertions, 2 deletions
diff --git a/frontend/src/pages/Settings/Languages/index.tsx b/frontend/src/pages/Settings/Languages/index.tsx
index 726992916..4616ab1ab 100644
--- a/frontend/src/pages/Settings/Languages/index.tsx
+++ b/frontend/src/pages/Settings/Languages/index.tsx
@@ -1,8 +1,20 @@
import { useLanguageProfiles, useLanguages } from "@/apis/hooks";
import { useEnabledLanguages } from "@/utilities/languages";
import { FunctionComponent } from "react";
-import { Check, CollapseBox, Layout, Message, Section } from "../components";
-import { enabledLanguageKey, languageProfileKey } from "../keys";
+import {
+ Check,
+ CollapseBox,
+ Layout,
+ Message,
+ Section,
+ Selector,
+} from "../components";
+import {
+ defaultUndAudioLang,
+ defaultUndEmbeddedSubtitlesLang,
+ enabledLanguageKey,
+ languageProfileKey,
+} from "../keys";
import { useSettingValue } from "../utilities/hooks";
import { LanguageSelector, ProfileSelector } from "./components";
import Table from "./table";
@@ -31,6 +43,8 @@ export function useLatestProfiles() {
const SettingsLanguagesView: FunctionComponent = () => {
const { data: languages } = useLanguages();
+ const { data: und_audio_languages } = useEnabledLanguages();
+ const { data: und_embedded_subtitles_languages } = useEnabledLanguages();
return (
<Layout name="Languages">
<Section header="Subtitles Language">
@@ -54,6 +68,34 @@ const SettingsLanguagesView: FunctionComponent = () => {
options={languages ?? []}
></LanguageSelector>
</Section>
+
+ <Section header="Default Unknown Track Language">
+ <Selector
+ clearable
+ settingKey={defaultUndAudioLang}
+ label="Treat unknown language audio track as (changing this will trigger missing subtitles calculation)"
+ placeholder="Select languages"
+ options={und_audio_languages.map((v) => {
+ return { label: v.name, value: v.code2 };
+ })}
+ settingOptions={{
+ onSubmit: (v) => (v === null ? "" : v),
+ }}
+ ></Selector>
+
+ <Selector
+ clearable
+ settingKey={defaultUndEmbeddedSubtitlesLang}
+ label="Treat unknown language embedded subtitles track as (changing this will trigger full subtitles indexation using cache)"
+ placeholder="Select languages"
+ options={und_embedded_subtitles_languages.map((v) => {
+ return { label: v.name, value: v.code2 };
+ })}
+ settingOptions={{
+ onSubmit: (v) => (v === null ? "" : v),
+ }}
+ ></Selector>
+ </Section>
<Section header="Languages Profiles">
<Table></Table>
</Section>