From 52e95dc9595d940ceaad939a0c9af176ae7986ba Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Sat, 16 Apr 2022 18:06:06 +0900 Subject: [PATCH] don't use i18n namespaces there's no need to keep reloading different parts of the object we already cached --- app/components/ContextMenu.tsx | 12 ++--- app/components/ListPlayerControls.tsx | 4 +- app/components/NothingHere.tsx | 4 +- app/navigation/BottomTabNavigator.tsx | 10 ++-- app/navigation/LibraryTopTabNavigator.tsx | 18 +++++-- app/navigation/RootNavigator.tsx | 4 +- app/screens/ArtistView.tsx | 8 +-- app/screens/Home.tsx | 6 +-- app/screens/LibraryAlbums.tsx | 6 +-- app/screens/LibraryArtists.tsx | 6 +-- app/screens/Search.tsx | 31 +++++++++--- app/screens/SearchResultsView.tsx | 4 +- app/screens/ServerView.tsx | 27 ++++++----- app/screens/Settings.tsx | 59 ++++++++++++++--------- 14 files changed, 120 insertions(+), 79 deletions(-) diff --git a/app/components/ContextMenu.tsx b/app/components/ContextMenu.tsx index b8ff6a4..c10e557 100644 --- a/app/components/ContextMenu.tsx +++ b/app/components/ContextMenu.tsx @@ -164,12 +164,12 @@ const OptionStar = withSuspenseMemo<{ additionalText?: string }>(({ id, type, additionalText: text }) => { const { query, toggle } = useStar(id, type) - const { t } = useTranslation('context.actions') + const { t } = useTranslation() return ( } - text={(query.data ? t('unstar') : t('star')) + (text ? ` ${text}` : '')} + text={(query.data ? t('unstar') : t('context.actions.star')) + (text ? ` ${text}` : '')} onSelect={() => toggle.mutate()} /> ) @@ -180,7 +180,7 @@ const OptionViewArtist = withSuspenseMemo<{ artist?: string artistId?: string }>(({ navigation, artist, artistId }) => { - const { t } = useTranslation('resources.artist.actions') + const { t } = useTranslation() if (!artist || !artistId) { return <> @@ -192,7 +192,7 @@ const OptionViewArtist = withSuspenseMemo<{ name="microphone" size={26} text={t('view')} - onSelect={() => navigation.navigate('artist', { id: artistId, title: artist })} + onSelect={() => navigation.navigate('resources.artist.actions.artist', { id: artistId, title: artist })} /> ) }) @@ -202,7 +202,7 @@ const OptionViewAlbum = withSuspenseMemo<{ album?: string albumId?: string }>(({ navigation, album, albumId }) => { - const { t } = useTranslation('resources.album.actions') + const { t } = useTranslation() if (!album || !albumId) { return <> @@ -214,7 +214,7 @@ const OptionViewAlbum = withSuspenseMemo<{ name="compact-disc" size={26} text={t('view')} - onSelect={() => navigation.navigate('album', { id: albumId, title: album })} + onSelect={() => navigation.navigate('resources.album.actions.album', { id: albumId, title: album })} /> ) }) diff --git a/app/components/ListPlayerControls.tsx b/app/components/ListPlayerControls.tsx index 7bf6ad2..4ecb354 100644 --- a/app/components/ListPlayerControls.tsx +++ b/app/components/ListPlayerControls.tsx @@ -17,7 +17,7 @@ const ListPlayerControls = withSuspenseMemo<{ disabled?: boolean }>(({ listType, style, play, shuffle, disabled }) => { const [downloaded, setDownloaded] = useState(false) - const { t } = useTranslation('resources') + const { t } = useTranslation() return ( @@ -34,7 +34,7 @@ const ListPlayerControls = withSuspenseMemo<{ -