mirror of
https://github.com/austinried/subtracks.git
synced 2025-12-27 17:19:27 +01:00
* basic i18n poc * translate home, filters, tabs support dot notation in backend for namespaces * i18n context menu, artist filters, list controls also nothings here fix backend not caching fallback * i18n queue, artist view, search/results * i18n settings and server view * Added translation using Weblate (Norwegian Bokmål) * Translated using Weblate (Norwegian Bokmål) Currently translated at 100.0% (6 of 6 strings) Translation: Subtracks/subtracks Translate-URL: https://hosted.weblate.org/projects/subtracks/subtracks/nb_NO/ * Update translation files Updated by "Cleanup translation files" hook in Weblate. Translation: Subtracks/subtracks Translate-URL: https://hosted.weblate.org/projects/subtracks/subtracks/ * Update translation files Updated by "Cleanup translation files" hook in Weblate. Translation: Subtracks/subtracks Translate-URL: https://hosted.weblate.org/projects/subtracks/subtracks/ * Update translation files Updated by "Cleanup translation files" hook in Weblate. Translation: Subtracks/subtracks Translate-URL: https://hosted.weblate.org/projects/subtracks/subtracks/ * fix url escaping * added some mostly naive text overflow fixes rewrote filter context menu as a slide in because the old one apparently can't handle dynamic width * Added translation using Weblate (French) * Translated using Weblate (French) Currently translated at 17.4% (11 of 63 strings) Translation: Subtracks/subtracks Translate-URL: https://hosted.weblate.org/projects/subtracks/subtracks/fr/ * Translated using Weblate (French) Currently translated at 19.0% (12 of 63 strings) Translation: Subtracks/subtracks Translate-URL: https://hosted.weblate.org/projects/subtracks/subtracks/fr/ * Translated using Weblate (French) Currently translated at 40.0% (26 of 65 strings) Translation: Subtracks/subtracks Translate-URL: https://hosted.weblate.org/projects/subtracks/subtracks/fr/ * add weblate and some pretty badges to readme * fix link * Translated using Weblate (French) Currently translated at 50.7% (33 of 65 strings) Translation: Subtracks/subtracks Translate-URL: https://hosted.weblate.org/projects/subtracks/subtracks/fr/ * Translated using Weblate (English) Currently translated at 100.0% (65 of 65 strings) Translation: Subtracks/subtracks Translate-URL: https://hosted.weblate.org/projects/subtracks/subtracks/en/ * Translated using Weblate (French) Currently translated at 90.7% (59 of 65 strings) Translation: Subtracks/subtracks Translate-URL: https://hosted.weblate.org/projects/subtracks/subtracks/fr/ * i18n now playing context type fix overscroll on new filter menu fix getting default namespace from the i18n backend * Translated using Weblate (French) Currently translated at 96.9% (63 of 65 strings) Translation: Subtracks/subtracks Translate-URL: https://hosted.weblate.org/projects/subtracks/subtracks/fr/ * Translated using Weblate (French) Currently translated at 100.0% (66 of 66 strings) Translation: Subtracks/subtracks Translate-URL: https://hosted.weblate.org/projects/subtracks/subtracks/fr/ * Translated using Weblate (Japanese) (#98) Currently translated at 7.5% (5 of 66 strings) Translation: Subtracks/subtracks Translate-URL: https://hosted.weblate.org/projects/subtracks/subtracks/ja/ Co-authored-by: Austin Riedhammer <austinried@functionkey.xyz> * little note to remind me why that's there * update licenses Co-authored-by: Allan Nordhøy <epost@anotheragency.no> Co-authored-by: Hosted Weblate <hosted@weblate.org> Co-authored-by: Clyhtsuriva <aimeric@adjutor.xyz>
60 lines
1.9 KiB
TypeScript
60 lines
1.9 KiB
TypeScript
import { withSuspense } from '@app/components/withSuspense'
|
|
import AlbumsTab from '@app/screens/LibraryAlbums'
|
|
import ArtistsTab from '@app/screens/LibraryArtists'
|
|
import PlaylistsTab from '@app/screens/LibraryPlaylists'
|
|
import colors from '@app/styles/colors'
|
|
import dimensions from '@app/styles/dimensions'
|
|
import font from '@app/styles/font'
|
|
import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs'
|
|
import React from 'react'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { StyleSheet } from 'react-native'
|
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
|
|
const Tab = createMaterialTopTabNavigator()
|
|
|
|
const LibraryTopTabNavigator = withSuspense(() => {
|
|
const { t } = useTranslation('resources')
|
|
const marginTop = useSafeAreaInsets().top
|
|
|
|
return (
|
|
<Tab.Navigator
|
|
tabBarOptions={{
|
|
style: [styles.tabBar, { marginTop }],
|
|
labelStyle: styles.tablabelStyle,
|
|
indicatorStyle: styles.tabindicatorStyle,
|
|
}}
|
|
initialRouteName="albums">
|
|
<Tab.Screen name="albums" component={AlbumsTab} options={{ tabBarLabel: t('album.name', { count: 2 }) }} />
|
|
<Tab.Screen name="artists" component={ArtistsTab} options={{ tabBarLabel: t('artist.name', { count: 2 }) }} />
|
|
<Tab.Screen
|
|
name="playlists"
|
|
component={PlaylistsTab}
|
|
options={{ tabBarLabel: t('playlist.name', { count: 2 }) }}
|
|
/>
|
|
</Tab.Navigator>
|
|
)
|
|
})
|
|
|
|
const styles = StyleSheet.create({
|
|
tabBar: {
|
|
height: dimensions.header,
|
|
backgroundColor: colors.gradient.high,
|
|
elevation: 0,
|
|
justifyContent: 'center',
|
|
},
|
|
tablabelStyle: {
|
|
fontSize: 18,
|
|
fontFamily: font.semiBold,
|
|
color: colors.text.primary,
|
|
textTransform: null as any,
|
|
marginTop: 0,
|
|
marginHorizontal: 2,
|
|
},
|
|
tabindicatorStyle: {
|
|
backgroundColor: colors.text.primary,
|
|
},
|
|
})
|
|
|
|
export default LibraryTopTabNavigator
|