mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-17 06:00:20 +02:00
convert EN localization to use proper casing, remove postprocessing from renderer
This commit is contained in:
@@ -221,7 +221,7 @@ export const AddToPlaylistContextModal = ({
|
||||
} catch (error: any) {
|
||||
toast.error({
|
||||
message: `[${playlist}] ${error?.message}`,
|
||||
title: t('error.genericError', { postProcess: 'sentenceCase' }),
|
||||
title: t('error.genericError'),
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -273,7 +273,7 @@ export const AddToPlaylistContextModal = ({
|
||||
(playlist) => playlist.value === playlistId,
|
||||
)?.label
|
||||
}] ${err.message}`,
|
||||
title: t('error.genericError', { postProcess: 'sentenceCase' }),
|
||||
title: t('error.genericError'),
|
||||
});
|
||||
},
|
||||
},
|
||||
@@ -292,15 +292,14 @@ export const AddToPlaylistContextModal = ({
|
||||
message: t('form.addToPlaylist.success', {
|
||||
message: addMessage,
|
||||
numOfPlaylists: playlistIds.length,
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
});
|
||||
closeModal(id);
|
||||
} catch (error: any) {
|
||||
setIsLoading(false);
|
||||
toast.error({
|
||||
message: error?.message || t('error.genericError', { postProcess: 'sentenceCase' }),
|
||||
title: t('error.genericError', { postProcess: 'sentenceCase' }),
|
||||
message: error?.message || t('error.genericError'),
|
||||
title: t('error.genericError'),
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -422,9 +421,7 @@ export const AddToPlaylistContextModal = ({
|
||||
<TextInput
|
||||
data-autofocus
|
||||
onChange={(e) => setSearch(e.target.value)}
|
||||
placeholder={t('form.addToPlaylist.searchOrCreate', {
|
||||
postProcess: 'sentenceCase',
|
||||
})}
|
||||
placeholder={t('form.addToPlaylist.searchOrCreate')}
|
||||
value={search}
|
||||
/>
|
||||
<ScrollArea style={{ maxHeight: '18rem' }}>
|
||||
@@ -482,7 +479,6 @@ export const AddToPlaylistContextModal = ({
|
||||
>
|
||||
{t('form.addToPlaylist.create', {
|
||||
playlist: search,
|
||||
postProcess: 'sentenceCase',
|
||||
})}
|
||||
</Button>
|
||||
)}
|
||||
@@ -512,7 +508,6 @@ export const AddToPlaylistContextModal = ({
|
||||
<Switch
|
||||
label={t('form.addToPlaylist.input', {
|
||||
context: 'skipDuplicates',
|
||||
postProcess: 'titleCase',
|
||||
})}
|
||||
{...form.getInputProps('skipDuplicates', { type: 'checkbox' })}
|
||||
/>
|
||||
@@ -523,7 +518,7 @@ export const AddToPlaylistContextModal = ({
|
||||
uppercase
|
||||
variant="subtle"
|
||||
>
|
||||
{t('common.cancel', { postProcess: 'titleCase' })}
|
||||
{t('common.cancel')}
|
||||
</ModalButton>
|
||||
<ModalButton
|
||||
disabled={
|
||||
@@ -537,7 +532,7 @@ export const AddToPlaylistContextModal = ({
|
||||
uppercase
|
||||
variant="filled"
|
||||
>
|
||||
{t('common.add', { postProcess: 'titleCase' })}
|
||||
{t('common.add')}
|
||||
</ModalButton>
|
||||
</Group>
|
||||
</Stack>
|
||||
@@ -587,13 +582,7 @@ const PlaylistTableItem = memo(
|
||||
</Group>
|
||||
|
||||
<Text className={styles.statusText} isMuted size="sm">
|
||||
{item.public
|
||||
? t('common.public', {
|
||||
postProcess: 'titleCase',
|
||||
})
|
||||
: t('common.private', {
|
||||
postProcess: 'titleCase',
|
||||
})}
|
||||
{item.public ? t('common.public') : t('common.private')}
|
||||
</Text>
|
||||
</Group>
|
||||
</Stack>
|
||||
|
||||
@@ -399,9 +399,9 @@ export const ClientSideSongFilters = () => {
|
||||
|
||||
const segmentedControlData = useMemo(
|
||||
() => [
|
||||
{ label: t('common.none', { postProcess: 'titleCase' }), value: 'none' },
|
||||
{ label: t('common.yes', { postProcess: 'titleCase' }), value: 'true' },
|
||||
{ label: t('common.no', { postProcess: 'titleCase' }), value: 'false' },
|
||||
{ label: t('common.none'), value: 'none' },
|
||||
{ label: t('common.yes'), value: 'true' },
|
||||
{ label: t('common.no'), value: 'false' },
|
||||
],
|
||||
[t],
|
||||
);
|
||||
@@ -528,22 +528,22 @@ export const ClientSideSongFilters = () => {
|
||||
const queryMinYear = query[FILTER_KEYS.SONG.MIN_YEAR] as number | undefined;
|
||||
const queryMaxYear = query[FILTER_KEYS.SONG.MAX_YEAR] as number | undefined;
|
||||
|
||||
const matchAndLabel = t('filter.matchAnd', { postProcess: 'titleCase' });
|
||||
const matchOrLabel = t('filter.matchOr', { postProcess: 'titleCase' });
|
||||
const filterSingleLabel = t('common.filter_single', { postProcess: 'titleCase' });
|
||||
const filterMultipleLabel = t('common.filter_multiple', { postProcess: 'titleCase' });
|
||||
const matchAndLabel = t('filter.matchAnd');
|
||||
const matchOrLabel = t('filter.matchOr');
|
||||
const filterSingleLabel = t('common.filter_single');
|
||||
const filterMultipleLabel = t('common.filter_multiple');
|
||||
|
||||
return (
|
||||
<Stack px="md" py="md">
|
||||
<BooleanSegmentFilter
|
||||
label={t('filter.isFavorited', { postProcess: 'sentenceCase' })}
|
||||
label={t('filter.isFavorited')}
|
||||
onChange={setFavorite}
|
||||
segmentData={segmentedControlData}
|
||||
value={queryFavorite}
|
||||
/>
|
||||
<Stack gap="xs" mt="md">
|
||||
<BooleanSegmentFilter
|
||||
label={t('filter.isRated', { postProcess: 'sentenceCase' })}
|
||||
label={t('filter.isRated')}
|
||||
onChange={setHasRating}
|
||||
segmentData={segmentedControlData}
|
||||
value={queryHasRating}
|
||||
@@ -555,7 +555,7 @@ export const ClientSideSongFilters = () => {
|
||||
label={
|
||||
<MultiSelectFilterLabel
|
||||
andOrValue={artistIdsMode}
|
||||
entityLabel={t('entity.artist', { count: 2, postProcess: 'sentenceCase' })}
|
||||
entityLabel={t('entity.artist', { count: 2 })}
|
||||
filterMultipleLabel={filterMultipleLabel}
|
||||
filterSingleLabel={filterSingleLabel}
|
||||
matchAndLabel={matchAndLabel}
|
||||
@@ -580,7 +580,6 @@ export const ClientSideSongFilters = () => {
|
||||
andOrValue={albumArtistIdsMode}
|
||||
entityLabel={t('entity.albumArtist', {
|
||||
count: 2,
|
||||
postProcess: 'sentenceCase',
|
||||
})}
|
||||
filterMultipleLabel={filterMultipleLabel}
|
||||
filterSingleLabel={filterSingleLabel}
|
||||
@@ -604,7 +603,7 @@ export const ClientSideSongFilters = () => {
|
||||
label={
|
||||
<MultiSelectFilterLabel
|
||||
andOrValue={genreIdsMode}
|
||||
entityLabel={t('entity.genre', { count: 2, postProcess: 'sentenceCase' })}
|
||||
entityLabel={t('entity.genre', { count: 2 })}
|
||||
filterMultipleLabel={filterMultipleLabel}
|
||||
filterSingleLabel={filterSingleLabel}
|
||||
matchAndLabel={matchAndLabel}
|
||||
@@ -623,12 +622,12 @@ export const ClientSideSongFilters = () => {
|
||||
/>
|
||||
<Divider my="md" />
|
||||
<YearRangeFilter
|
||||
fromYearLabel={t('filter.fromYear', { postProcess: 'titleCase' })}
|
||||
fromYearLabel={t('filter.fromYear')}
|
||||
maxYear={queryMaxYear}
|
||||
minYear={queryMinYear}
|
||||
onMaxYear={debouncedHandleMaxYear}
|
||||
onMinYear={debouncedHandleMinYear}
|
||||
toYearLabel={t('filter.toYear', { postProcess: 'titleCase' })}
|
||||
toYearLabel={t('filter.toYear')}
|
||||
/>
|
||||
</Stack>
|
||||
);
|
||||
|
||||
@@ -90,12 +90,12 @@ export const CreatePlaylistForm = ({ onCancel }: CreatePlaylistFormProps) => {
|
||||
onError: (err) => {
|
||||
toast.error({
|
||||
message: err.message,
|
||||
title: t('error.genericError', { postProcess: 'sentenceCase' }),
|
||||
title: t('error.genericError'),
|
||||
});
|
||||
},
|
||||
onSuccess: () => {
|
||||
toast.success({
|
||||
message: t('form.createPlaylist.success', { postProcess: 'sentenceCase' }),
|
||||
message: t('form.createPlaylist.success'),
|
||||
});
|
||||
onCancel();
|
||||
},
|
||||
@@ -115,7 +115,6 @@ export const CreatePlaylistForm = ({ onCancel }: CreatePlaylistFormProps) => {
|
||||
data-autofocus
|
||||
label={t('form.createPlaylist.input', {
|
||||
context: 'name',
|
||||
postProcess: 'titleCase',
|
||||
})}
|
||||
required
|
||||
{...form.getInputProps('name')}
|
||||
@@ -125,7 +124,6 @@ export const CreatePlaylistForm = ({ onCancel }: CreatePlaylistFormProps) => {
|
||||
autosize
|
||||
label={t('form.createPlaylist.input', {
|
||||
context: 'description',
|
||||
postProcess: 'titleCase',
|
||||
})}
|
||||
minRows={5}
|
||||
{...form.getInputProps('comment')}
|
||||
@@ -136,7 +134,6 @@ export const CreatePlaylistForm = ({ onCancel }: CreatePlaylistFormProps) => {
|
||||
<Switch
|
||||
label={t('form.createPlaylist.input', {
|
||||
context: 'public',
|
||||
postProcess: 'titleCase',
|
||||
})}
|
||||
{...form.getInputProps('public', {
|
||||
type: 'checkbox',
|
||||
@@ -189,9 +186,7 @@ export const CreatePlaylistForm = ({ onCancel }: CreatePlaylistFormProps) => {
|
||||
type="submit"
|
||||
variant="filled"
|
||||
>
|
||||
{isSmartPlaylist && step === 1
|
||||
? t('common.confirm', { postProcess: 'sentenceCase' })
|
||||
: t('common.create')}
|
||||
{isSmartPlaylist && step === 1 ? t('common.confirm') : t('common.create')}
|
||||
</ModalButton>
|
||||
</Group>
|
||||
</Stack>
|
||||
@@ -208,6 +203,6 @@ export const openCreatePlaylistModal = (
|
||||
openModal({
|
||||
children: <CreatePlaylistForm onCancel={() => closeAllModals()} />,
|
||||
size: server?.type === ServerType?.NAVIDROME ? 'xl' : 'sm',
|
||||
title: t('form.createPlaylist.title', { postProcess: 'titleCase' }),
|
||||
title: t('form.createPlaylist.title'),
|
||||
});
|
||||
};
|
||||
|
||||
+8
-14
@@ -100,10 +100,10 @@ const PlaylistSongListFiltersModal = () => {
|
||||
variant="subtle"
|
||||
/>
|
||||
)}
|
||||
{t('common.filters', { postProcess: 'sentenceCase' })}
|
||||
{t('common.filters')}
|
||||
</Group>
|
||||
<Button onClick={clear} size="compact-sm" variant="subtle">
|
||||
{t('common.reset', { postProcess: 'sentenceCase' })}
|
||||
{t('common.reset')}
|
||||
</Button>
|
||||
</Group>
|
||||
}
|
||||
@@ -145,8 +145,8 @@ export const PlaylistDetailSongListHeaderFilters = ({
|
||||
: ItemListKey.PLAYLIST_SONG);
|
||||
const isAlbumMode = listKey === ItemListKey.PLAYLIST_ALBUM;
|
||||
const toggleChoice = isAlbumMode
|
||||
? t('entity.album', { count: 2, postProcess: 'titleCase' })
|
||||
: t('entity.track', { count: 2, postProcess: 'titleCase' });
|
||||
? t('entity.album', { count: 2 })
|
||||
: t('entity.track', { count: 2 });
|
||||
|
||||
const handleToggleDisplayMode = useCallback(() => {
|
||||
setPlaylistBehavior(
|
||||
@@ -209,16 +209,10 @@ export const PlaylistDetailSongListHeaderFilters = ({
|
||||
uppercase
|
||||
variant={mode === 'edit' ? 'state-error' : 'subtle'}
|
||||
>
|
||||
{mode === 'edit'
|
||||
? t('common.cancel', { postProcess: 'titleCase' })
|
||||
: t('common.edit', { postProcess: 'titleCase' })}
|
||||
{mode === 'edit' ? t('common.cancel') : t('common.edit')}
|
||||
</Button>
|
||||
)}
|
||||
<Tooltip
|
||||
label={t(`common.${collapsed ? 'expand' : 'collapse'}`, {
|
||||
postProcess: 'titleCase',
|
||||
})}
|
||||
>
|
||||
<Tooltip label={t(`common.${collapsed ? 'expand' : 'collapse'}`, {})}>
|
||||
<ActionIcon
|
||||
icon={collapsed ? 'arrowDownS' : 'arrowUpS'}
|
||||
iconProps={{ size: 'xl' }}
|
||||
@@ -260,7 +254,7 @@ export const openSaveAndReplaceModal = (
|
||||
innerProps: { onSuccess, playlistId, songIds },
|
||||
modal: 'saveAndReplace',
|
||||
size: 'sm',
|
||||
title: i18n.t('common.saveAndReplace', { postProcess: 'titleCase' }) as string,
|
||||
title: i18n.t('common.saveAndReplace') as string,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -290,7 +284,7 @@ const SaveAndReplaceButton = ({ mode, songIds }: { mode?: 'edit' | 'view'; songI
|
||||
size="sm"
|
||||
variant="subtle"
|
||||
>
|
||||
{t('common.saveAndReplace', { postProcess: 'titleCase' })}
|
||||
{t('common.saveAndReplace')}
|
||||
</Button>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -42,7 +42,7 @@ export const PlaylistListHeaderFilters = () => {
|
||||
</Group>
|
||||
<Group gap="sm" wrap="nowrap">
|
||||
<Button onClick={handleCreatePlaylistModal} variant="subtle">
|
||||
{t('action.createPlaylist', { postProcess: 'sentenceCase' })}
|
||||
{t('action.createPlaylist')}
|
||||
</Button>
|
||||
<ListDisplayTypeToggleButton listKey={ItemListKey.PLAYLIST} />
|
||||
<ListConfigMenu
|
||||
|
||||
@@ -19,7 +19,7 @@ interface PlaylistListHeaderProps {
|
||||
export const PlaylistListHeader = ({ title }: PlaylistListHeaderProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const pageTitle = title || t('page.playlistList.title', { postProcess: 'titleCase' });
|
||||
const pageTitle = title || t('page.playlistList.title');
|
||||
|
||||
return (
|
||||
<Stack gap={0}>
|
||||
|
||||
@@ -452,9 +452,7 @@ export const PlaylistQueryBuilder = forwardRef(
|
||||
// Custom Fields group
|
||||
if (customFields.length > 0) {
|
||||
groups.push({
|
||||
group: t('queryBuilder.customTags', {
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
group: t('queryBuilder.customTags'),
|
||||
items: customFields,
|
||||
});
|
||||
}
|
||||
@@ -462,9 +460,7 @@ export const PlaylistQueryBuilder = forwardRef(
|
||||
// Standard Fields group
|
||||
if (NDSongQueryFields.length > 0) {
|
||||
groups.push({
|
||||
group: t('queryBuilder.standardTags', {
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
group: t('queryBuilder.standardTags'),
|
||||
items: NDSongQueryFields,
|
||||
});
|
||||
}
|
||||
@@ -484,7 +480,7 @@ export const PlaylistQueryBuilder = forwardRef(
|
||||
const sortOptions = useMemo(
|
||||
() => [
|
||||
{
|
||||
label: t('filter.random', { postProcess: 'titleCase' }),
|
||||
label: t('filter.random'),
|
||||
type: 'string',
|
||||
value: 'random',
|
||||
},
|
||||
@@ -497,11 +493,11 @@ export const PlaylistQueryBuilder = forwardRef(
|
||||
const orderSelectData = useMemo(
|
||||
() => [
|
||||
{
|
||||
label: t('common.ascending', { postProcess: 'sentenceCase' }),
|
||||
label: t('common.ascending'),
|
||||
value: 'asc',
|
||||
},
|
||||
{
|
||||
label: t('common.descending', { postProcess: 'sentenceCase' }),
|
||||
label: t('common.descending'),
|
||||
value: 'desc',
|
||||
},
|
||||
],
|
||||
@@ -574,11 +570,7 @@ export const PlaylistQueryBuilder = forwardRef(
|
||||
<Group align="flex-end" gap="sm" key={index} wrap="nowrap">
|
||||
<Select
|
||||
data={sortOptions}
|
||||
label={
|
||||
index === 0
|
||||
? t('common.sort', { postProcess: 'titleCase' })
|
||||
: ''
|
||||
}
|
||||
label={index === 0 ? t('common.sort') : ''}
|
||||
onChange={(value) =>
|
||||
handleSortFieldChange(index, value || '')
|
||||
}
|
||||
@@ -588,13 +580,7 @@ export const PlaylistQueryBuilder = forwardRef(
|
||||
/>
|
||||
<Select
|
||||
data={orderSelectData}
|
||||
label={
|
||||
index === 0
|
||||
? t('common.sortOrder', {
|
||||
postProcess: 'titleCase',
|
||||
})
|
||||
: ''
|
||||
}
|
||||
label={index === 0 ? t('common.sortOrder') : ''}
|
||||
onChange={(value) =>
|
||||
handleSortOrderChange(
|
||||
index,
|
||||
@@ -625,7 +611,7 @@ export const PlaylistQueryBuilder = forwardRef(
|
||||
<NumberInput
|
||||
label={
|
||||
<Group align="center" gap="xs" wrap="nowrap">
|
||||
{t('common.limit', { postProcess: 'titleCase' })}
|
||||
{t('common.limit')}
|
||||
<SegmentedControl
|
||||
data={[
|
||||
{ label: '#', value: 'limit' },
|
||||
|
||||
@@ -141,7 +141,7 @@ export const PlaylistQueryEditor = ({
|
||||
const payload = getFiltersForSave();
|
||||
if (!payload) {
|
||||
if (editorMode === 'json') {
|
||||
toast.error({ message: t('error.invalidJson', { postProcess: 'sentenceCase' }) });
|
||||
toast.error({ message: t('error.invalidJson') });
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -156,7 +156,7 @@ export const PlaylistQueryEditor = ({
|
||||
openModal({
|
||||
children: <JsonPreview value={previewValue} />,
|
||||
size: 'xl',
|
||||
title: t('common.preview', { postProcess: 'titleCase' }),
|
||||
title: t('common.preview'),
|
||||
});
|
||||
}, [editorMode, getFiltersForSave, t]);
|
||||
|
||||
@@ -165,7 +165,7 @@ export const PlaylistQueryEditor = ({
|
||||
const payload = getFiltersForSave();
|
||||
if (!payload) {
|
||||
if (editorMode === 'json') {
|
||||
toast.error({ message: t('error.invalidJson', { postProcess: 'sentenceCase' }) });
|
||||
toast.error({ message: t('error.invalidJson') });
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -177,10 +177,10 @@ export const PlaylistQueryEditor = ({
|
||||
closeAllModals();
|
||||
}}
|
||||
>
|
||||
<Text>{t('common.areYouSure', { postProcess: 'sentenceCase' })}</Text>
|
||||
<Text>{t('common.areYouSure')}</Text>
|
||||
</ConfirmModal>
|
||||
),
|
||||
title: t('common.saveAndReplace', { postProcess: 'titleCase' }),
|
||||
title: t('common.saveAndReplace'),
|
||||
});
|
||||
}, [editorMode, getFiltersForSave, handleSave, isQueryBuilderExpanded, t]);
|
||||
|
||||
@@ -285,9 +285,7 @@ export const PlaylistQueryEditor = ({
|
||||
});
|
||||
} catch {
|
||||
toast.error({
|
||||
message: t('error.invalidJson', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
message: t('error.invalidJson'),
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -326,9 +324,7 @@ export const PlaylistQueryEditor = ({
|
||||
size="sm"
|
||||
variant="subtle"
|
||||
>
|
||||
{t('form.queryEditor.title', {
|
||||
postProcess: 'titleCase',
|
||||
})}
|
||||
{t('form.queryEditor.title')}
|
||||
</Button>
|
||||
{isQueryBuilderExpanded && (
|
||||
<SegmentedControl
|
||||
@@ -358,7 +354,7 @@ export const PlaylistQueryEditor = ({
|
||||
</Group>
|
||||
<Group gap="xs">
|
||||
<Button onClick={openPreviewModal} size="sm" variant="subtle">
|
||||
{t('common.preview', { postProcess: 'titleCase' })}
|
||||
{t('common.preview')}
|
||||
</Button>
|
||||
<Button
|
||||
disabled={!isQueryBuilderExpanded}
|
||||
@@ -371,16 +367,14 @@ export const PlaylistQueryEditor = ({
|
||||
handleSaveAs(payload.filter, payload.extraFilters);
|
||||
} else if (editorMode === 'json') {
|
||||
toast.error({
|
||||
message: t('error.invalidJson', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
message: t('error.invalidJson'),
|
||||
});
|
||||
}
|
||||
}}
|
||||
size="sm"
|
||||
variant="subtle"
|
||||
>
|
||||
{t('common.saveAs', { postProcess: 'titleCase' })}
|
||||
{t('common.saveAs')}
|
||||
</Button>
|
||||
<Button
|
||||
disabled={!isQueryBuilderExpanded}
|
||||
@@ -389,9 +383,7 @@ export const PlaylistQueryEditor = ({
|
||||
size="sm"
|
||||
variant="subtle"
|
||||
>
|
||||
{t('common.saveAndReplace', {
|
||||
postProcess: 'titleCase',
|
||||
})}
|
||||
{t('common.saveAndReplace')}
|
||||
</Button>
|
||||
</Group>
|
||||
</Group>
|
||||
|
||||
@@ -36,18 +36,14 @@ export const SaveAndReplaceContextModal = ({
|
||||
console.error(err);
|
||||
toast.error({
|
||||
message: err.message,
|
||||
title: t('error.genericError', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('error.genericError'),
|
||||
});
|
||||
},
|
||||
onSuccess: () => {
|
||||
onSuccess();
|
||||
closeAllModals();
|
||||
toast.success({
|
||||
message: t('form.editPlaylist.success', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
message: t('form.editPlaylist.success'),
|
||||
});
|
||||
},
|
||||
},
|
||||
@@ -56,7 +52,7 @@ export const SaveAndReplaceContextModal = ({
|
||||
|
||||
return (
|
||||
<ConfirmModal loading={updatePlaylistMutation.isPending} onConfirm={handleConfirm}>
|
||||
<Text>{t('common.areYouSure', { postProcess: 'sentenceCase' })}</Text>
|
||||
<Text>{t('common.areYouSure')}</Text>
|
||||
</ConfirmModal>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -50,12 +50,12 @@ export const SaveAsPlaylistForm = ({
|
||||
onError: (err) => {
|
||||
toast.error({
|
||||
message: err.message,
|
||||
title: t('error.genericError', { postProcess: 'sentenceCase' }),
|
||||
title: t('error.genericError'),
|
||||
});
|
||||
},
|
||||
onSuccess: (data) => {
|
||||
toast.success({
|
||||
message: t('form.createPlaylist.success', { postProcess: 'sentenceCase' }),
|
||||
message: t('form.createPlaylist.success'),
|
||||
});
|
||||
onSuccess(data);
|
||||
onCancel();
|
||||
@@ -74,7 +74,6 @@ export const SaveAsPlaylistForm = ({
|
||||
data-autofocus
|
||||
label={t('form.createPlaylist.input', {
|
||||
context: 'name',
|
||||
postProcess: 'titleCase',
|
||||
})}
|
||||
required
|
||||
{...form.getInputProps('name')}
|
||||
@@ -83,7 +82,6 @@ export const SaveAsPlaylistForm = ({
|
||||
<TextInput
|
||||
label={t('form.createPlaylist.input', {
|
||||
context: 'description',
|
||||
postProcess: 'titleCase',
|
||||
})}
|
||||
{...form.getInputProps('comment')}
|
||||
/>
|
||||
@@ -92,7 +90,6 @@ export const SaveAsPlaylistForm = ({
|
||||
<Switch
|
||||
label={t('form.createPlaylist.input', {
|
||||
context: 'public',
|
||||
postProcess: 'titleCase',
|
||||
})}
|
||||
{...form.getInputProps('public', { type: 'checkbox' })}
|
||||
/>
|
||||
|
||||
@@ -108,13 +108,13 @@ export const UpdatePlaylistContextModal = ({
|
||||
}
|
||||
|
||||
toast.success({
|
||||
message: t('form.editPlaylist.success', { postProcess: 'sentenceCase' }),
|
||||
message: t('form.editPlaylist.success'),
|
||||
});
|
||||
closeModal(id);
|
||||
} catch (err: any) {
|
||||
toast.error({
|
||||
message: err?.message,
|
||||
title: t('error.genericError', { postProcess: 'sentenceCase' }),
|
||||
title: t('error.genericError'),
|
||||
});
|
||||
} finally {
|
||||
setIsSaving(false);
|
||||
@@ -134,7 +134,6 @@ export const UpdatePlaylistContextModal = ({
|
||||
key="name"
|
||||
label={t('form.createPlaylist.input', {
|
||||
context: 'name',
|
||||
postProcess: 'titleCase',
|
||||
})}
|
||||
required
|
||||
{...form.getInputProps('name')}
|
||||
@@ -148,7 +147,6 @@ export const UpdatePlaylistContextModal = ({
|
||||
key="comment"
|
||||
label={t('form.createPlaylist.input', {
|
||||
context: 'description',
|
||||
postProcess: 'titleCase',
|
||||
})}
|
||||
minRows={5}
|
||||
{...form.getInputProps('comment')}
|
||||
@@ -163,11 +161,7 @@ export const UpdatePlaylistContextModal = ({
|
||||
if (isPublicDisplayed) {
|
||||
if (server?.type === ServerType.JELLYFIN) {
|
||||
fieldNodes.push(
|
||||
<div key="jellyfin-public-note">
|
||||
{t('form.editPlaylist.publicJellyfinNote', {
|
||||
postProcess: 'sentenceCase',
|
||||
})}
|
||||
</div>,
|
||||
<div key="jellyfin-public-note">{t('form.editPlaylist.publicJellyfinNote')}</div>,
|
||||
);
|
||||
}
|
||||
fieldNodes.push(
|
||||
@@ -175,7 +169,6 @@ export const UpdatePlaylistContextModal = ({
|
||||
key="public"
|
||||
label={t('form.createPlaylist.input', {
|
||||
context: 'public',
|
||||
postProcess: 'titleCase',
|
||||
})}
|
||||
{...form.getInputProps('public', { type: 'checkbox' })}
|
||||
/>,
|
||||
@@ -377,7 +370,6 @@ const OwnerSelect = ({ form }: { form: ReturnType<typeof useForm<UpdatePlaylistB
|
||||
{...form.getInputProps('ownerId')}
|
||||
label={t('form.createPlaylist.input', {
|
||||
context: 'owner',
|
||||
postProcess: 'titleCase',
|
||||
})}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -32,6 +32,6 @@ export const openUpdatePlaylistModal = async (args: { playlist: Playlist }) => {
|
||||
},
|
||||
modal: 'updatePlaylist',
|
||||
size: hasImageUpload ? 'lg' : 'md',
|
||||
title: i18n.t('form.editPlaylist.title', { postProcess: 'titleCase' }) as string,
|
||||
title: i18n.t('form.editPlaylist.title') as string,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -46,11 +46,11 @@ const PlaylistSongListFiltersSidebar = () => {
|
||||
<Stack h="100%" style={{ minHeight: 0 }}>
|
||||
<Group justify="space-between" pb={0} pl="md" pr="md" pt="md">
|
||||
<Text fw={500} size="xl">
|
||||
{t('common.filters', { postProcess: 'sentenceCase' })}
|
||||
{t('common.filters')}
|
||||
</Text>
|
||||
<Group gap="xs">
|
||||
<Button onClick={clear} size="compact-sm" variant="subtle">
|
||||
{t('common.reset', { postProcess: 'sentenceCase' })}
|
||||
{t('common.reset')}
|
||||
</Button>
|
||||
{setIsSidebarOpen && (
|
||||
<ActionIcon
|
||||
@@ -170,7 +170,7 @@ const PlaylistDetailSongListRoute = () => {
|
||||
serverId={detailQuery?.data?._serverId || ''}
|
||||
/>
|
||||
),
|
||||
title: t('common.saveAs', { postProcess: 'sentenceCase' }),
|
||||
title: t('common.saveAs'),
|
||||
});
|
||||
};
|
||||
|
||||
@@ -189,9 +189,7 @@ const PlaylistDetailSongListRoute = () => {
|
||||
onError: (err) => {
|
||||
toast.error({
|
||||
message: err.message,
|
||||
title: t('error.genericError', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('error.genericError'),
|
||||
});
|
||||
},
|
||||
onSuccess: () => {
|
||||
@@ -205,7 +203,7 @@ const PlaylistDetailSongListRoute = () => {
|
||||
<Text>Are you sure you want to delete this playlist?</Text>
|
||||
</ConfirmModal>
|
||||
),
|
||||
title: t('form.deletePlaylist.title', { postProcess: 'sentenceCase' }),
|
||||
title: t('form.deletePlaylist.title'),
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user