import { FunctionComponent } from "react"; import { Text as MantineText } from "@mantine/core"; import { useLanguageProfiles, useLanguages } from "@/apis/hooks"; import { Check, Chips, CollapseBox, Layout, Message, Section, Selector, } from "@/pages/Settings/components"; import { defaultUndAudioLang, defaultUndEmbeddedSubtitlesLang, enabledLanguageKey, languageProfileKey, } from "@/pages/Settings/keys"; import { useSettingValue } from "@/pages/Settings/utilities/hooks"; import { useEnabledLanguages } from "@/utilities/languages"; import { LanguageSelector, ProfileSelector } from "./components"; import EqualsTable from "./equals"; import Table from "./table"; export function useLatestEnabledLanguages() { const { data } = useEnabledLanguages(); const latest = useSettingValue(enabledLanguageKey); if (latest) { return latest; } else { return data; } } export function useLatestProfiles() { const { data = [] } = useLanguageProfiles(); const latest = useSettingValue(languageProfileKey); if (latest) { return latest; } else { return data; } } const SettingsLanguagesView: FunctionComponent = () => { const { data: languages } = useLanguages(); const { data: undAudioLanguages } = useEnabledLanguages(); const { data: undEmbeddedSubtitlesLanguages } = useEnabledLanguages(); 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.
Treat the following languages as equal across all providers.
{ return { label: v.name, value: v.code2 }; })} settingOptions={{ onSubmit: (v) => (v === null ? "" : v), }} > { return { label: v.name, value: v.code2 }; })} settingOptions={{ onSubmit: (v) => (v === null ? "" : v), }} >
If enabled, Bazarr will look at the names of all tags of a Series from Sonarr (or a Movie from Radarr) to find a matching Bazarr language profile tag. It will use as the language profile the FIRST tag from Sonarr/Radarr that matches the tag of a Bazarr language profile EXACTLY. If multiple tags match, there is no guarantee as to which one will be used, so choose your tag names carefully. Also, if you update the tag names in Sonarr/Radarr, Bazarr will detect this and repeat the matching process for the affected shows. However, if a show's only matching tag is removed from Sonarr/Radarr, Bazarr will NOT remove the show's existing language profile for that reason. But if you wish to have language profiles removed automatically by tag value, simply enter a list of one or more tags in the{" "} Remove Profile Tags {" "} entry list below. If your video tag matches one of the tags in that list, then Bazarr will remove the language profile for that video. If there is a conflict between profile selection and profile removal, then profile removal wins out and is performed. values?.map((item) => item.replace(/[^a-z0-9_-]/gi, "").toLowerCase(), ) } > Enter tag values that will trigger a language profile removal. Leave empty if you don't want Bazarr to remove language profiles.
Will apply only to Series added to Bazarr after enabling this option. Will apply only to Movies added to Bazarr after enabling this option.
); }; export default SettingsLanguagesView;