From 6cf421f24fa46876e3e23acc215551024ada1180 Mon Sep 17 00:00:00 2001 From: Lei Nelissen Date: Mon, 2 Nov 2020 22:50:00 +0100 Subject: [PATCH] Implement locales in codebase --- src/localisation/lang/en.json | 1 + src/localisation/types.ts | 1 + src/screens/Music/index.tsx | 9 +++++---- src/screens/Music/stacks/Album.tsx | 3 ++- src/screens/Music/stacks/RecentAlbums.tsx | 7 ++++--- src/screens/Music/stacks/Search.tsx | 7 ++++--- src/screens/Onboarding/index.tsx | 9 +++++---- src/screens/Player/components/Queue.tsx | 5 +++-- src/screens/Settings/components/Cache.tsx | 7 ++++--- src/screens/Settings/components/Library.tsx | 11 ++++++----- src/screens/Settings/index.tsx | 3 ++- src/screens/index.tsx | 7 ++++--- src/screens/modals/SetJellyfinServer/index.tsx | 5 +++-- src/screens/modals/TrackPopupMenu.tsx | 5 +++-- 14 files changed, 47 insertions(+), 33 deletions(-) diff --git a/src/localisation/lang/en.json b/src/localisation/lang/en.json index 8d8af2f..f3b1e3b 100644 --- a/src/localisation/lang/en.json +++ b/src/localisation/lang/en.json @@ -6,6 +6,7 @@ "clear-queue": "Clear Queue", "no-results": "No results...", "album": "Album", + "albums": "Albums", "all-albums": "All Albums", "search": "Search", "music": "Music", diff --git a/src/localisation/types.ts b/src/localisation/types.ts index 3101d57..d9092fc 100644 --- a/src/localisation/types.ts +++ b/src/localisation/types.ts @@ -5,6 +5,7 @@ export type LocaleKeys = 'play-next' | 'clear-queue' | 'no-results' | 'album' + | 'albums' | 'all-albums' | 'search' | 'music' diff --git a/src/screens/Music/index.tsx b/src/screens/Music/index.tsx index 6589427..800b7ad 100644 --- a/src/screens/Music/index.tsx +++ b/src/screens/Music/index.tsx @@ -6,6 +6,7 @@ import Album from './stacks/Album'; import RecentAlbums from './stacks/RecentAlbums'; import Search from './stacks/Search'; import { THEME_COLOR } from 'CONSTANTS'; +import { t } from '@localisation'; const Stack = createStackNavigator(); @@ -17,10 +18,10 @@ const navigationOptions = { function MusicStack() { return ( - - - - + + + + ); } diff --git a/src/screens/Music/stacks/Album.tsx b/src/screens/Music/stacks/Album.tsx index 34024d0..cda4b4d 100644 --- a/src/screens/Music/stacks/Album.tsx +++ b/src/screens/Music/stacks/Album.tsx @@ -15,6 +15,7 @@ import TouchableHandler from 'components/TouchableHandler'; import useCurrentTrack from 'utility/useCurrentTrack'; import { colors } from 'components/Colors'; import TrackPlayer from 'react-native-track-player'; +import { t } from '@localisation'; type Route = RouteProp; @@ -114,7 +115,7 @@ const Album: React.FC = () => { {album?.Name} {album?.AlbumArtist} -