import { isArray } from "lodash"; import React, { FunctionComponent, useContext } from "react"; import { useEnabledLanguages, useLanguageProfiles, useLanguages, } from "../../@redux/hooks"; import { Check, CollapseBox, Group, Input, Message, SettingsProvider, useLatest, } from "../components"; import { enabledLanguageKey, languageProfileKey } from "../keys"; import { LanguageSelector, ProfileSelector } from "./components"; import Table from "./table"; const EnabledLanguageContext = React.createContext( [] ); const LanguagesProfileContext = React.createContext< readonly Language.Profile[] >([]); export function useEnabledLanguagesContext() { const list = useContext(EnabledLanguageContext); const latest = useLatest(enabledLanguageKey, isArray); if (latest) { return latest; } else { return list; } } export function useProfilesContext() { const list = useContext(LanguagesProfileContext); const latest = useLatest(languageProfileKey, isArray); if (latest) { return latest; } else { return list; } } interface Props {} const SettingsLanguagesView: FunctionComponent = () => { const languages = useLanguages(); const enabled = useEnabledLanguages(); const profiles = useLanguageProfiles(); return ( Download a single Subtitles file without adding the language code to the filename. We don't recommend enabling this option unless absolutely required (ie: media player not supporting language code in subtitles filename). Results may vary.
Apply only to Series added to Bazarr after enabling this option. Apply only to Movies added to Bazarr after enabling this option.
); }; export default SettingsLanguagesView;