diff options
author | Anderson Shindy Oki <[email protected]> | 2024-08-25 22:46:57 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2024-08-25 22:46:57 +0900 |
commit | 4887066000a461d2026e95ba8d493bd667d9bfb2 (patch) | |
tree | 660b7092dcfd8a99373f6d5eb2ef2b2fdda05829 /frontend | |
parent | 609349b4002290e771935c7e6d02263c3fdd7ce4 (diff) | |
download | bazarr-4887066000a461d2026e95ba8d493bd667d9bfb2.tar.gz bazarr-4887066000a461d2026e95ba8d493bd667d9bfb2.zip |
Fixed chinese audio language (#2632)
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/src/components/bazarr/AudioList.tsx | 3 | ||||
-rw-r--r-- | frontend/src/pages/views/ItemOverview.tsx | 3 | ||||
-rw-r--r-- | frontend/src/utilities/languages.ts | 4 |
3 files changed, 8 insertions, 2 deletions
diff --git a/frontend/src/components/bazarr/AudioList.tsx b/frontend/src/components/bazarr/AudioList.tsx index f1af7ff3c..f0dc07c0d 100644 --- a/frontend/src/components/bazarr/AudioList.tsx +++ b/frontend/src/components/bazarr/AudioList.tsx @@ -1,6 +1,7 @@ import { FunctionComponent } from "react"; import { Badge, BadgeProps, Group, GroupProps } from "@mantine/core"; import { BuildKey } from "@/utilities"; +import { normalizeAudioLanguage } from "@/utilities/languages"; export type AudioListProps = GroupProps & { audios: Language.Info[]; @@ -16,7 +17,7 @@ const AudioList: FunctionComponent<AudioListProps> = ({ <Group gap="xs" {...group}> {audios.map((audio, idx) => ( <Badge color="blue" key={BuildKey(idx, audio.code2)} {...badgeProps}> - {audio.name} + {normalizeAudioLanguage(audio.name)} </Badge> ))} </Group> diff --git a/frontend/src/pages/views/ItemOverview.tsx b/frontend/src/pages/views/ItemOverview.tsx index d03da3b80..36d296850 100644 --- a/frontend/src/pages/views/ItemOverview.tsx +++ b/frontend/src/pages/views/ItemOverview.tsx @@ -31,6 +31,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { Language } from "@/components/bazarr"; import { BuildKey } from "@/utilities"; import { + normalizeAudioLanguage, useLanguageProfileBy, useProfileItemsToLanguages, } from "@/utilities/languages"; @@ -87,7 +88,7 @@ const ItemOverview: FunctionComponent<Props> = (props) => { icon={faMusic} title="Audio Language" > - {v.name} + {normalizeAudioLanguage(v.name)} </ItemBadge> )) ?? [], [item?.audio_language], diff --git a/frontend/src/utilities/languages.ts b/frontend/src/utilities/languages.ts index 1b59aa4e7..7885e9667 100644 --- a/frontend/src/utilities/languages.ts +++ b/frontend/src/utilities/languages.ts @@ -51,3 +51,7 @@ export function useLanguageFromCode3(code3: string) { [data, code3], ); } + +export const normalizeAudioLanguage = (name: string) => { + return name === "Chinese Simplified" ? "Chinese" : name; +}; |