feat: initial support for i18n
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import React from 'react'
|
||||
import { Button, useDataProvider, useUnselectAll } from 'react-admin'
|
||||
import {
|
||||
Button,
|
||||
useDataProvider,
|
||||
useUnselectAll,
|
||||
useTranslate
|
||||
} from 'react-admin'
|
||||
import { useDispatch } from 'react-redux'
|
||||
import { addTrack } from '../player'
|
||||
import AddToQueueIcon from '@material-ui/icons/AddToQueue'
|
||||
@@ -8,6 +13,7 @@ import Tooltip from '@material-ui/core/Tooltip'
|
||||
|
||||
const AddToQueueButton = ({ selectedIds }) => {
|
||||
const dispatch = useDispatch()
|
||||
const translate = useTranslate()
|
||||
const dataProvider = useDataProvider()
|
||||
const unselectAll = useUnselectAll()
|
||||
const addToQueue = () => {
|
||||
@@ -23,7 +29,10 @@ const AddToQueueButton = ({ selectedIds }) => {
|
||||
<Button
|
||||
color="secondary"
|
||||
label={
|
||||
<Tooltip title={'Play Later'} placement="right">
|
||||
<Tooltip
|
||||
title={translate('resources.song.bulk.addToQueue')}
|
||||
placement="right"
|
||||
>
|
||||
<AddToQueueIcon />
|
||||
</Tooltip>
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ const SongDetails = (props) => {
|
||||
<Show {...props} title=" ">
|
||||
<SimpleShowLayout>
|
||||
<TextField source="path" />
|
||||
<TextField label="Album Artist" source="albumArtist" />
|
||||
<TextField source="albumArtist" />
|
||||
<TextField source="genre" />
|
||||
<BooleanField source="compilation" />
|
||||
<BitrateField source="bitRate" />
|
||||
@@ -80,9 +80,7 @@ const SongList = (props) => {
|
||||
)}
|
||||
secondaryText={(record) => record.artist}
|
||||
tertiaryText={(record) => (
|
||||
<>
|
||||
<DurationField record={record} source={'duration'} />
|
||||
</>
|
||||
<DurationField record={record} source={'duration'} />
|
||||
)}
|
||||
linkType={false}
|
||||
/>
|
||||
@@ -94,9 +92,9 @@ const SongList = (props) => {
|
||||
<TextField source="title" />
|
||||
{isDesktop && <TextField source="album" />}
|
||||
<TextField source="artist" />
|
||||
{isDesktop && <NumberField label="Track #" source="trackNumber" />}
|
||||
{isDesktop && <NumberField source="trackNumber" />}
|
||||
{isDesktop && <TextField source="year" />}
|
||||
<DurationField label="Time" source="duration" />
|
||||
<DurationField source="duration" />
|
||||
</Datagrid>
|
||||
)}
|
||||
</List>
|
||||
|
||||
Reference in New Issue
Block a user