mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-25 20:06:33 +02:00
Use proper casing for i18n locales (#1998)
This commit is contained in:
@@ -22,20 +22,15 @@ export const AnalyticsSettings = memo(() => {
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
aria-label={t('setting.analyticsEnable', { postProcess: 'sentenceCase' })}
|
||||
aria-label={t('setting.analyticsEnable')}
|
||||
defaultChecked={localStorage.getItem('umami.disabled') !== '1'}
|
||||
onChange={(e) => handleSetSendAnalytics(e.currentTarget.checked)}
|
||||
/>
|
||||
),
|
||||
description: t('setting.analyticsEnable_description', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.analyticsEnable', { postProcess: 'sentenceCase' }),
|
||||
description: t('setting.analyticsEnable_description'),
|
||||
title: t('setting.analyticsEnable'),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<SettingsSection
|
||||
options={analyticsOptions}
|
||||
title={t('page.setting.analytics', { postProcess: 'sentenceCase' })}
|
||||
/>
|
||||
);
|
||||
return <SettingsSection options={analyticsOptions} title={t('page.setting.analytics')} />;
|
||||
});
|
||||
|
||||
@@ -31,9 +31,7 @@ export const ExportImportSettings = memo(() => {
|
||||
openModal({
|
||||
children: <ExportImportSettingsModal />,
|
||||
size: 'lg',
|
||||
title: t('setting.exportImportSettings_importModalTitle', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.exportImportSettings_importModalTitle'),
|
||||
});
|
||||
};
|
||||
|
||||
@@ -42,30 +40,17 @@ export const ExportImportSettings = memo(() => {
|
||||
control: (
|
||||
<>
|
||||
<Button onClick={onExportSettings} size="compact-sm">
|
||||
{t('setting.exportImportSettings_control_exportText', {
|
||||
postProcess: 'sentenceCase',
|
||||
})}
|
||||
{t('setting.exportImportSettings_control_exportText')}
|
||||
</Button>
|
||||
<Button onClick={openImportModal} size="compact-sm">
|
||||
{t('setting.exportImportSettings_control_importText', {
|
||||
postProcess: 'sentenceCase',
|
||||
})}
|
||||
{t('setting.exportImportSettings_control_importText')}
|
||||
</Button>
|
||||
</>
|
||||
),
|
||||
description: t('setting.exportImportSettings_control_description', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.exportImportSettings_control_title', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
description: t('setting.exportImportSettings_control_description'),
|
||||
title: t('setting.exportImportSettings_control_title'),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<SettingsSection
|
||||
options={options}
|
||||
title={t('page.setting.exportImport', { postProcess: 'sentenceCase' })}
|
||||
/>
|
||||
);
|
||||
return <SettingsSection options={options} title={t('page.setting.exportImport')} />;
|
||||
});
|
||||
|
||||
@@ -41,28 +41,24 @@ export const LoggerSettings = memo(() => {
|
||||
{
|
||||
label: t('setting.logLevel', {
|
||||
context: 'optionDebug',
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: 'debug',
|
||||
},
|
||||
{
|
||||
label: t('setting.logLevel', {
|
||||
context: 'optionInfo',
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: 'info',
|
||||
},
|
||||
{
|
||||
label: t('setting.logLevel', {
|
||||
context: 'optionWarn',
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: 'warn',
|
||||
},
|
||||
{
|
||||
label: t('setting.logLevel', {
|
||||
context: 'optionError',
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: 'error',
|
||||
},
|
||||
@@ -73,16 +69,10 @@ export const LoggerSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.logLevel', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.logLevel', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.logLevel'),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<SettingsSection
|
||||
options={loggerOptions}
|
||||
title={t('page.setting.logger', { postProcess: 'sentenceCase' })}
|
||||
/>
|
||||
);
|
||||
return <SettingsSection options={loggerOptions} title={t('page.setting.logger')} />;
|
||||
});
|
||||
|
||||
@@ -53,10 +53,9 @@ export const StylesSettings = memo(() => {
|
||||
}
|
||||
description={t('setting.customCssEnable', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
})}
|
||||
note={t('setting.customCssNotice', { postProcess: 'sentenceCase' })}
|
||||
title={t('setting.customCssEnable', { postProcess: 'sentenceCase' })}
|
||||
note={t('setting.customCssNotice')}
|
||||
title={t('setting.customCssEnable')}
|
||||
/>
|
||||
{enabled && (
|
||||
<>
|
||||
@@ -70,7 +69,7 @@ export const StylesSettings = memo(() => {
|
||||
// disabled={isSaveButtonDisabled}
|
||||
variant="filled"
|
||||
>
|
||||
{t('common.save', { postProcess: 'titleCase' })}
|
||||
{t('common.save')}
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
@@ -78,17 +77,14 @@ export const StylesSettings = memo(() => {
|
||||
size="compact-md"
|
||||
variant="filled"
|
||||
>
|
||||
{t(open ? 'common.close' : 'common.edit', {
|
||||
postProcess: 'titleCase',
|
||||
})}
|
||||
{t(open ? 'common.close' : 'common.edit', {})}
|
||||
</Button>
|
||||
</>
|
||||
}
|
||||
description={t('setting.customCss', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
})}
|
||||
title={t('setting.customCss', { postProcess: 'sentenceCase' })}
|
||||
title={t('setting.customCss')}
|
||||
/>
|
||||
{open && (
|
||||
<>
|
||||
@@ -100,7 +96,7 @@ export const StylesSettings = memo(() => {
|
||||
setCss(sanitizeCss(`<style>${e.currentTarget.value}`))
|
||||
}
|
||||
/>
|
||||
<Text>{t('common.preview', { postProcess: 'sentenceCase' })}: </Text>
|
||||
<Text>{t('common.preview')}: </Text>
|
||||
<Code block>{css}</Code>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -45,14 +45,12 @@ const HOME_FEATURE_STYLE_OPTIONS = [
|
||||
{
|
||||
label: t('setting.homeFeatureStyle', {
|
||||
context: 'optionSingle',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
value: HomeFeatureStyle.SINGLE,
|
||||
},
|
||||
{
|
||||
label: t('setting.homeFeatureStyle', {
|
||||
context: 'optionMultiple',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
value: HomeFeatureStyle.MULTIPLE,
|
||||
},
|
||||
@@ -62,14 +60,12 @@ const SIDE_QUEUE_OPTIONS = [
|
||||
{
|
||||
label: t('setting.sidePlayQueueStyle', {
|
||||
context: 'optionAttached',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
value: 'sideQueue',
|
||||
},
|
||||
{
|
||||
label: t('setting.sidePlayQueueStyle', {
|
||||
context: 'optionDetached',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
value: 'sideDrawerQueue',
|
||||
},
|
||||
@@ -79,14 +75,12 @@ const SIDE_QUEUE_LAYOUT_OPTIONS = [
|
||||
{
|
||||
label: t('setting.sidePlayQueueLayout', {
|
||||
context: 'optionHorizontal',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
value: 'horizontal',
|
||||
},
|
||||
{
|
||||
label: t('setting.sidePlayQueueLayout', {
|
||||
context: 'optionVertical',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
value: 'vertical',
|
||||
},
|
||||
@@ -96,7 +90,6 @@ const FONT_TYPES: Font[] = [
|
||||
{
|
||||
label: i18n.t('setting.fontType', {
|
||||
context: 'optionBuiltIn',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
value: FontType.BUILT_IN,
|
||||
},
|
||||
@@ -104,14 +97,14 @@ const FONT_TYPES: Font[] = [
|
||||
|
||||
if (window.queryLocalFonts) {
|
||||
FONT_TYPES.push({
|
||||
label: i18n.t('setting.fontType', { context: 'optionSystem', postProcess: 'sentenceCase' }),
|
||||
label: i18n.t('setting.fontType', { context: 'optionSystem' }),
|
||||
value: FontType.SYSTEM,
|
||||
});
|
||||
}
|
||||
|
||||
if (isElectron()) {
|
||||
FONT_TYPES.push({
|
||||
label: i18n.t('setting.fontType', { context: 'optionCustom', postProcess: 'sentenceCase' }),
|
||||
label: i18n.t('setting.fontType', { context: 'optionCustom' }),
|
||||
value: FontType.CUSTOM,
|
||||
});
|
||||
}
|
||||
@@ -173,9 +166,7 @@ export const ApplicationSettings = memo(() => {
|
||||
});
|
||||
|
||||
if (status.state === 'denied') {
|
||||
throw new Error(
|
||||
t('error.localFontAccessDenied', { postProcess: 'sentenceCase' }),
|
||||
);
|
||||
throw new Error(t('error.localFontAccessDenied'));
|
||||
}
|
||||
|
||||
const data = await window.queryLocalFonts();
|
||||
@@ -188,7 +179,7 @@ export const ApplicationSettings = memo(() => {
|
||||
} catch (error) {
|
||||
console.error('Failed to get local fonts', error);
|
||||
toast.error({
|
||||
message: t('error.systemFontError', { postProcess: 'sentenceCase' }),
|
||||
message: t('error.systemFontError'),
|
||||
});
|
||||
|
||||
setSettings({
|
||||
@@ -227,10 +218,9 @@ export const ApplicationSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.language', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.language', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.language'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -250,10 +240,9 @@ export const ApplicationSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.fontType', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: FONT_TYPES.length === 1,
|
||||
title: t('setting.fontType', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.fontType'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -272,9 +261,9 @@ export const ApplicationSettings = memo(() => {
|
||||
value={fontSettings.builtIn}
|
||||
/>
|
||||
),
|
||||
description: t('setting.font', { context: 'description', postProcess: 'sentenceCase' }),
|
||||
description: t('setting.font', { context: 'description' }),
|
||||
isHidden: localFonts && fontSettings.type !== FontType.BUILT_IN,
|
||||
title: t('setting.font', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.font'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -294,9 +283,9 @@ export const ApplicationSettings = memo(() => {
|
||||
w={300}
|
||||
/>
|
||||
),
|
||||
description: t('setting.font', { context: 'description', postProcess: 'sentenceCase' }),
|
||||
description: t('setting.font', { context: 'description' }),
|
||||
isHidden: !localFonts || fontSettings.type !== FontType.SYSTEM,
|
||||
title: t('setting.font', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.font'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -315,10 +304,9 @@ export const ApplicationSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.customFontPath', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: fontSettings.type !== FontType.CUSTOM,
|
||||
title: t('setting.customFontPath', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.customFontPath'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -343,12 +331,9 @@ export const ApplicationSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.zoom', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.zoom', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.zoom'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -367,15 +352,14 @@ export const ApplicationSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.savePlayQueue', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.savePlayQueue', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.savePlayQueue'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
aria-label={t('setting.homeFeature', { postProcess: 'sentenceCase' })}
|
||||
aria-label={t('setting.homeFeature')}
|
||||
defaultChecked={settings.homeFeature}
|
||||
onChange={(e) =>
|
||||
setSettings({
|
||||
@@ -389,15 +373,14 @@ export const ApplicationSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.homeFeature', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.homeFeature', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.homeFeature'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<SegmentedControl
|
||||
aria-label={t('setting.homeFeatureStyle', { postProcess: 'sentenceCase' })}
|
||||
aria-label={t('setting.homeFeatureStyle')}
|
||||
data={HOME_FEATURE_STYLE_OPTIONS}
|
||||
defaultValue={settings.homeFeatureStyle}
|
||||
onChange={(e) =>
|
||||
@@ -412,15 +395,14 @@ export const ApplicationSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.homeFeatureStyle', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.homeFeatureStyle', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.homeFeatureStyle'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
aria-label={t('setting.albumBackground', { postProcess: 'sentenceCase' })}
|
||||
aria-label={t('setting.albumBackground')}
|
||||
defaultChecked={settings.albumBackground}
|
||||
onChange={(e) =>
|
||||
setSettings({
|
||||
@@ -434,10 +416,9 @@ export const ApplicationSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.albumBackground', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.albumBackground', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.albumBackground'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -460,15 +441,14 @@ export const ApplicationSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.albumBackgroundBlur', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !settings.albumBackground,
|
||||
title: t('setting.albumBackgroundBlur', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.albumBackgroundBlur'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
aria-label={t('setting.artistBackground', { postProcess: 'sentenceCase' })}
|
||||
aria-label={t('setting.artistBackground')}
|
||||
defaultChecked={settings.artistBackground}
|
||||
onChange={(e) =>
|
||||
setSettings({
|
||||
@@ -482,10 +462,9 @@ export const ApplicationSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.artistBackground', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.artistBackground', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.artistBackground'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -508,10 +487,9 @@ export const ApplicationSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.artistBackgroundBlur', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !settings.artistBackground,
|
||||
title: t('setting.artistBackgroundBlur', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.artistBackgroundBlur'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -530,10 +508,9 @@ export const ApplicationSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.imageAspectRatio', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.imageAspectRatio', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.imageAspectRatio'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -552,15 +529,14 @@ export const ApplicationSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.sidePlayQueueStyle', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.sidePlayQueueStyle', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.sidePlayQueueStyle'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<SegmentedControl
|
||||
aria-label={t('setting.sidePlayQueueLayout', { postProcess: 'sentenceCase' })}
|
||||
aria-label={t('setting.sidePlayQueueLayout')}
|
||||
data={SIDE_QUEUE_LAYOUT_OPTIONS}
|
||||
defaultValue={settings.sideQueueLayout}
|
||||
onChange={(e) =>
|
||||
@@ -575,10 +551,9 @@ export const ApplicationSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.sidePlayQueueLayout', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: settings.sideQueueType !== 'sideQueue',
|
||||
title: t('setting.sidePlayQueueLayout', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.sidePlayQueueLayout'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -596,15 +571,14 @@ export const ApplicationSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.showRatings', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.showRatings', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.showRatings'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
aria-label={t('setting.blurExplicitImages', { postProcess: 'sentenceCase' })}
|
||||
aria-label={t('setting.blurExplicitImages')}
|
||||
defaultChecked={settings.blurExplicitImages}
|
||||
onChange={(e) =>
|
||||
setSettings({
|
||||
@@ -618,15 +592,14 @@ export const ApplicationSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.blurExplicitImages', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.blurExplicitImages', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.blurExplicitImages'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
aria-label={t('setting.enableGridMultiSelect', { postProcess: 'sentenceCase' })}
|
||||
aria-label={t('setting.enableGridMultiSelect')}
|
||||
defaultChecked={settings.enableGridMultiSelect}
|
||||
onChange={(e) =>
|
||||
setSettings({
|
||||
@@ -640,15 +613,14 @@ export const ApplicationSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.enableGridMultiSelect', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.enableGridMultiSelect', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.enableGridMultiSelect'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
aria-label={t('setting.playerbarOpenDrawer', { postProcess: 'sentenceCase' })}
|
||||
aria-label={t('setting.playerbarOpenDrawer')}
|
||||
defaultChecked={settings.playerbarOpenDrawer}
|
||||
onChange={(e) =>
|
||||
setSettings({
|
||||
@@ -662,15 +634,14 @@ export const ApplicationSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.playerbarOpenDrawer', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.playerbarOpenDrawer', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.playerbarOpenDrawer'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
aria-label={t('setting.autosave', { postProcess: 'sentenceCase' })}
|
||||
aria-label={t('setting.autosave')}
|
||||
defaultChecked={settings.autoSave.enabled}
|
||||
onChange={(e) => {
|
||||
setSettings({
|
||||
@@ -687,9 +658,8 @@ export const ApplicationSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.autosave', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.autosave', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.autosave'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -715,10 +685,9 @@ export const ApplicationSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.autosaveCount', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !settings.autoSave.enabled,
|
||||
title: t('setting.autosaveCount', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.autosaveCount'),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -735,7 +704,7 @@ export const ApplicationSettings = memo(() => {
|
||||
</>
|
||||
}
|
||||
options={options}
|
||||
title={t('page.setting.application', { postProcess: 'sentenceCase' })}
|
||||
title={t('page.setting.application')}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -11,25 +11,23 @@ import { Text } from '/@/shared/components/text/text';
|
||||
|
||||
const options = [
|
||||
{
|
||||
label: i18n.t('setting.imageResolution_optionTable', { postProcess: 'sentenceCase' }),
|
||||
label: i18n.t('setting.imageResolution_optionTable'),
|
||||
value: 'table',
|
||||
},
|
||||
{
|
||||
label: i18n.t('setting.imageResolution_optionItemCard', { postProcess: 'sentenceCase' }),
|
||||
label: i18n.t('setting.imageResolution_optionItemCard'),
|
||||
value: 'itemCard',
|
||||
},
|
||||
{
|
||||
label: i18n.t('setting.imageResolution_optionSidebar', { postProcess: 'sentenceCase' }),
|
||||
label: i18n.t('setting.imageResolution_optionSidebar'),
|
||||
value: 'sidebar',
|
||||
},
|
||||
{
|
||||
label: i18n.t('setting.imageResolution_optionHeader', { postProcess: 'sentenceCase' }),
|
||||
label: i18n.t('setting.imageResolution_optionHeader'),
|
||||
value: 'header',
|
||||
},
|
||||
{
|
||||
label: i18n.t('setting.imageResolution_optionFullScreenPlayer', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
label: i18n.t('setting.imageResolution_optionFullScreenPlayer'),
|
||||
value: 'fullScreenPlayer',
|
||||
},
|
||||
];
|
||||
@@ -43,10 +41,9 @@ export const ImageResolutionSettings = memo(() => {
|
||||
|
||||
const descriptionText = t('setting.imageResolution', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
});
|
||||
|
||||
const titleText = t('setting.imageResolution', { postProcess: 'sentenceCase' });
|
||||
const titleText = t('setting.imageResolution');
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -58,7 +55,7 @@ export const ImageResolutionSettings = memo(() => {
|
||||
size="compact-md"
|
||||
variant={open ? 'subtle' : 'filled'}
|
||||
>
|
||||
{t(open ? 'common.close' : 'common.edit', { postProcess: 'titleCase' })}
|
||||
{t(open ? 'common.close' : 'common.edit')}
|
||||
</Button>
|
||||
</>
|
||||
}
|
||||
|
||||
@@ -53,10 +53,9 @@ export const ControlSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.buttonSize', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.buttonSize', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.buttonSize'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -78,15 +77,14 @@ export const ControlSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.showSkipButtons', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.showSkipButtons', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.showSkipButtons'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Group>
|
||||
<Tooltip label={t('common.backward', { postProcess: 'titleCase' })}>
|
||||
<Tooltip label={t('common.backward')}>
|
||||
<NumberInput
|
||||
defaultValue={settings.skipButtons.skipBackwardSeconds}
|
||||
min={0}
|
||||
@@ -106,7 +104,7 @@ export const ControlSettings = memo(() => {
|
||||
width={75}
|
||||
/>
|
||||
</Tooltip>
|
||||
<Tooltip label={t('common.forward', { postProcess: 'titleCase' })}>
|
||||
<Tooltip label={t('common.forward')}>
|
||||
<NumberInput
|
||||
defaultValue={settings.skipButtons.skipForwardSeconds}
|
||||
min={0}
|
||||
@@ -130,10 +128,9 @@ export const ControlSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.skipDuration', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.skipDuration', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.skipDuration'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -142,28 +139,24 @@ export const ControlSettings = memo(() => {
|
||||
{
|
||||
label: t('setting.playButtonBehavior', {
|
||||
context: 'optionPlay',
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: Play.NOW,
|
||||
},
|
||||
{
|
||||
label: t('setting.playButtonBehavior', {
|
||||
context: 'optionAddNext',
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: Play.NEXT,
|
||||
},
|
||||
{
|
||||
label: t('setting.playButtonBehavior', {
|
||||
context: 'optionAddLast',
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: Play.LAST,
|
||||
},
|
||||
{
|
||||
label: t('setting.playButtonBehavior', {
|
||||
context: 'optionPlayShuffled',
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: Play.SHUFFLE,
|
||||
},
|
||||
@@ -181,10 +174,9 @@ export const ControlSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.playButtonBehavior', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.playButtonBehavior', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.playButtonBehavior'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -203,10 +195,9 @@ export const ControlSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.followCurrentSong', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.followCurrentSong', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.followCurrentSong'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -231,10 +222,9 @@ export const ControlSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.artistRadioCount', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.artistRadioCount', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.artistRadioCount'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -255,10 +245,9 @@ export const ControlSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.volumeWheelStep', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.volumeWheelStep', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.volumeWheelStep'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -278,10 +267,9 @@ export const ControlSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.volumeWidth', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.volumeWidth', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.volumeWidth'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -290,14 +278,12 @@ export const ControlSettings = memo(() => {
|
||||
{
|
||||
label: t('setting.playerbarSliderType', {
|
||||
context: 'optionSlider',
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: PlayerbarSliderType.SLIDER,
|
||||
},
|
||||
{
|
||||
label: t('setting.playerbarSliderType', {
|
||||
context: 'optionWaveform',
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: PlayerbarSliderType.WAVEFORM,
|
||||
},
|
||||
@@ -320,10 +306,9 @@ export const ControlSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.playerbarSlider', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.playerbarSlider', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.playerbarSlider'),
|
||||
},
|
||||
...(playerbarSlider?.type === PlayerbarSliderType.WAVEFORM
|
||||
? [
|
||||
@@ -334,21 +319,18 @@ export const ControlSettings = memo(() => {
|
||||
{
|
||||
label: t('setting.playerbarWaveformAlign', {
|
||||
context: 'optionTop',
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: BarAlign.TOP,
|
||||
},
|
||||
{
|
||||
label: t('setting.playerbarWaveformAlign', {
|
||||
context: 'optionCenter',
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: BarAlign.CENTER,
|
||||
},
|
||||
{
|
||||
label: t('setting.playerbarWaveformAlign', {
|
||||
context: 'optionBottom',
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: BarAlign.BOTTOM,
|
||||
},
|
||||
@@ -371,12 +353,9 @@ export const ControlSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.playerbarWaveformAlign', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.playerbarWaveformAlign', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.playerbarWaveformAlign'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -404,12 +383,9 @@ export const ControlSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.playerbarWaveformBarWidth', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.playerbarWaveformBarWidth', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.playerbarWaveformBarWidth'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -437,12 +413,9 @@ export const ControlSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.playerbarWaveformGap', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.playerbarWaveformGap', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.playerbarWaveformGap'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -470,12 +443,9 @@ export const ControlSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.playerbarWaveformRadius', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.playerbarWaveformRadius', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.playerbarWaveformRadius'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -496,12 +466,9 @@ export const ControlSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.playerbarWaveformStretch', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.playerbarWaveformStretch', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.playerbarWaveformStretch'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -528,19 +495,13 @@ export const ControlSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.waveformLoadingDelay', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.waveformLoadingDelay', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.waveformLoadingDelay'),
|
||||
},
|
||||
]
|
||||
: []),
|
||||
];
|
||||
|
||||
return (
|
||||
<SettingsSection
|
||||
options={controlOptions}
|
||||
title={t('page.setting.controls', { postProcess: 'sentenceCase' })}
|
||||
/>
|
||||
);
|
||||
return <SettingsSection options={controlOptions} title={t('page.setting.controls')} />;
|
||||
});
|
||||
|
||||
@@ -55,9 +55,10 @@ export const DraggableItems = <K extends string, T extends SortableItem<K>>({
|
||||
|
||||
const translatedItemMap = useMemo(
|
||||
() =>
|
||||
Object.fromEntries(
|
||||
itemLabels.map(([key, value]) => [key, t(value, { postProcess: 'sentenceCase' })]),
|
||||
) as Record<K, string>,
|
||||
Object.fromEntries(itemLabels.map(([key, value]) => [key, t(value)])) as Record<
|
||||
K,
|
||||
string
|
||||
>,
|
||||
[itemLabels, t],
|
||||
);
|
||||
|
||||
@@ -78,10 +79,9 @@ export const DraggableItems = <K extends string, T extends SortableItem<K>>({
|
||||
);
|
||||
}, []);
|
||||
|
||||
const titleText = t(title, { postProcess: 'sentenceCase' });
|
||||
const titleText = t(title);
|
||||
const descriptionText = t(description, {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
});
|
||||
|
||||
const shouldShow = useMemo(() => {
|
||||
@@ -114,7 +114,7 @@ export const DraggableItems = <K extends string, T extends SortableItem<K>>({
|
||||
size="compact-md"
|
||||
variant="filled"
|
||||
>
|
||||
{t('common.save', { postProcess: 'titleCase' })}
|
||||
{t('common.save')}
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
@@ -122,7 +122,7 @@ export const DraggableItems = <K extends string, T extends SortableItem<K>>({
|
||||
size="compact-md"
|
||||
variant={open ? 'subtle' : 'filled'}
|
||||
>
|
||||
{t(open ? 'common.close' : 'common.edit', { postProcess: 'titleCase' })}
|
||||
{t(open ? 'common.close' : 'common.edit')}
|
||||
</Button>
|
||||
</>
|
||||
}
|
||||
|
||||
@@ -30,9 +30,8 @@ export const ExternalLinksSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.externalLinks', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.externalLinks', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.externalLinks'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -50,10 +49,9 @@ export const ExternalLinksSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.lastfm', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !settings.externalLinks,
|
||||
title: t('setting.lastfm', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.lastfm'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -71,10 +69,9 @@ export const ExternalLinksSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.listenbrainz', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !settings.externalLinks,
|
||||
title: t('setting.listenbrainz', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.listenbrainz'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -92,10 +89,9 @@ export const ExternalLinksSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.musicbrainz', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !settings.externalLinks,
|
||||
title: t('setting.musicbrainz', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.musicbrainz'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -113,10 +109,9 @@ export const ExternalLinksSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.qobuz', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !settings.externalLinks,
|
||||
title: t('setting.qobuz', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.qobuz'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -134,10 +129,9 @@ export const ExternalLinksSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.spotify', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !settings.externalLinks,
|
||||
title: t('setting.spotify', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.spotify'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -155,17 +149,11 @@ export const ExternalLinksSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.nativeSpotify', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !settings.externalLinks || !settings.spotify,
|
||||
title: t('setting.nativeSpotify', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.nativeSpotify'),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<SettingsSection
|
||||
options={options}
|
||||
title={t('common.externalLinks', { postProcess: 'sentenceCase' })}
|
||||
/>
|
||||
);
|
||||
return <SettingsSection options={options} title={t('common.externalLinks')} />;
|
||||
});
|
||||
|
||||
@@ -42,9 +42,8 @@ export const LyricSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.followLyric', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.followLyric', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.followLyric'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -56,10 +55,9 @@ export const LyricSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.preferLocalLyrics', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.preferLocalLyrics', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.preferLocalLyrics'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -71,10 +69,9 @@ export const LyricSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.lyricFetch', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.lyricFetch', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.lyricFetch'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -92,10 +89,9 @@ export const LyricSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.lyricFetchProvider', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.lyricFetchProvider', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.lyricFetchProvider'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -111,10 +107,9 @@ export const LyricSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.neteaseTranslation', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.neteaseTranslation', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.neteaseTranslation'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -130,10 +125,9 @@ export const LyricSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.lyricOffset', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.lyricOffset', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.lyricOffset'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -147,10 +141,9 @@ export const LyricSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.translationTargetLanguage', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.translationTargetLanguage', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.translationTargetLanguage'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -165,10 +158,9 @@ export const LyricSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.translationApiProvider', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.translationApiProvider', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.translationApiProvider'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -181,10 +173,9 @@ export const LyricSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.translationApiKey', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.translationApiKey', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.translationApiKey'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -198,17 +189,11 @@ export const LyricSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.enableAutoTranslation', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.enableAutoTranslation', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.enableAutoTranslation'),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<SettingsSection
|
||||
options={lyricOptions}
|
||||
title={t('page.setting.lyrics', { postProcess: 'sentenceCase' })}
|
||||
/>
|
||||
);
|
||||
return <SettingsSection options={lyricOptions} title={t('page.setting.lyrics')} />;
|
||||
});
|
||||
|
||||
@@ -62,7 +62,7 @@ export const PathSettings = memo(() => {
|
||||
return (
|
||||
<Stack>
|
||||
<Group>
|
||||
<Text>{t('setting.pathReplace', { postProcess: 'sentenceCase' })}</Text>
|
||||
<Text>{t('setting.pathReplace')}</Text>
|
||||
<ActionIcon
|
||||
icon="refresh"
|
||||
loading={randomSong.isFetching}
|
||||
@@ -83,9 +83,7 @@ export const PathSettings = memo(() => {
|
||||
setLocalPathReplace(value);
|
||||
debouncedSetPathReplace(value);
|
||||
}}
|
||||
placeholder={t('setting.pathReplace_optionRemovePrefix', {
|
||||
postProcess: 'sentenceCase',
|
||||
})}
|
||||
placeholder={t('setting.pathReplace_optionRemovePrefix')}
|
||||
value={localPathReplace}
|
||||
/>
|
||||
<TextInput
|
||||
@@ -94,9 +92,7 @@ export const PathSettings = memo(() => {
|
||||
setLocalPathReplaceWith(value);
|
||||
debouncedSetPathReplaceWith(value);
|
||||
}}
|
||||
placeholder={t('setting.pathReplace_optionAddPrefix', {
|
||||
postProcess: 'sentenceCase',
|
||||
})}
|
||||
placeholder={t('setting.pathReplace_optionAddPrefix')}
|
||||
value={localPathReplaceWith}
|
||||
/>
|
||||
</Group>
|
||||
|
||||
@@ -82,9 +82,7 @@ export const QueryBuilderSettings = memo(() => {
|
||||
}
|
||||
placeholder={t(
|
||||
'setting.queryBuilderCustomFields_inputLabel',
|
||||
{
|
||||
postProcess: 'sentenceCase',
|
||||
},
|
||||
{},
|
||||
)}
|
||||
value={field.label}
|
||||
width="30%"
|
||||
@@ -107,9 +105,7 @@ export const QueryBuilderSettings = memo(() => {
|
||||
}
|
||||
placeholder={t(
|
||||
'setting.queryBuilderCustomFields_inputTag',
|
||||
{
|
||||
postProcess: 'sentenceCase',
|
||||
},
|
||||
{},
|
||||
)}
|
||||
value={field.value}
|
||||
width="30%"
|
||||
@@ -126,27 +122,17 @@ export const QueryBuilderSettings = memo(() => {
|
||||
)}
|
||||
<Group grow>
|
||||
<Button onClick={handleAddCustomField} variant="filled">
|
||||
{t('common.add', { postProcess: 'titleCase' })}
|
||||
{t('common.add')}
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
),
|
||||
description: t('setting.queryBuilderCustomFields', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.queryBuilderCustomFields', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.queryBuilderCustomFields'),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<SettingsSection
|
||||
options={customFieldsOptions}
|
||||
title={t('page.setting.queryBuilder', {
|
||||
postProcess: 'sentenceCase',
|
||||
})}
|
||||
/>
|
||||
);
|
||||
return <SettingsSection options={customFieldsOptions} title={t('page.setting.queryBuilder')} />;
|
||||
});
|
||||
|
||||
@@ -35,9 +35,8 @@ export const ScrobbleSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.scrobble', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.scrobble', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.scrobble'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -61,9 +60,8 @@ export const ScrobbleSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.minimumScrobblePercentage', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.minimumScrobblePercentage', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.minimumScrobblePercentage'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -87,9 +85,8 @@ export const ScrobbleSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.minimumScrobbleSeconds', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.minimumScrobbleSeconds', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.minimumScrobbleSeconds'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -99,9 +96,7 @@ export const ScrobbleSettings = memo(() => {
|
||||
onChange={async (e) => {
|
||||
if (Notification.permission === 'denied') {
|
||||
toast.error({
|
||||
message: t('error.notificationDenied', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
message: t('error.notificationDenied'),
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -110,9 +105,7 @@ export const ScrobbleSettings = memo(() => {
|
||||
const permissions = await Notification.requestPermission();
|
||||
if (permissions !== 'granted') {
|
||||
toast.error({
|
||||
message: t('error.notificationDenied', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
message: t('error.notificationDenied'),
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -130,17 +123,11 @@ export const ScrobbleSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.notify', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !('Notification' in window),
|
||||
title: t('setting.notify', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.notify'),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<SettingsSection
|
||||
options={scrobbleOptions}
|
||||
title={t('page.setting.scrobble', { postProcess: 'sentenceCase' })}
|
||||
/>
|
||||
);
|
||||
return <SettingsSection options={scrobbleOptions} title={t('page.setting.scrobble')} />;
|
||||
});
|
||||
|
||||
@@ -66,9 +66,8 @@ export const SidebarSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.sidebarPlaylistList', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.sidebarPlaylistList', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.sidebarPlaylistList'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -78,17 +77,14 @@ export const SidebarSettings = memo(() => {
|
||||
setLocalFilterRegex(value);
|
||||
debouncedSetFilterRegex(value);
|
||||
}}
|
||||
placeholder={t('setting.sidebarPlaylistListFilterRegex_placeholder', {
|
||||
postProcess: 'sentenceCase',
|
||||
})}
|
||||
placeholder={t('setting.sidebarPlaylistListFilterRegex_placeholder')}
|
||||
value={localFilterRegex}
|
||||
/>
|
||||
),
|
||||
description: t('setting.sidebarPlaylistListFilterRegex', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.sidebarPlaylistListFilterRegex', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.sidebarPlaylistListFilterRegex'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -99,9 +95,8 @@ export const SidebarSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.sidebarPlaylistSorting', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.sidebarPlaylistSorting', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.sidebarPlaylistSorting'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -112,9 +107,8 @@ export const SidebarSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.sidebarCollapsedNavigation', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.sidebarCollapsedNavigation', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.sidebarCollapsedNavigation'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -132,9 +126,8 @@ export const SidebarSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.showLyricsInSidebar', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.showLyricsInSidebar', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.showLyricsInSidebar'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -152,9 +145,8 @@ export const SidebarSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.showVisualizerInSidebar', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.showVisualizerInSidebar', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.showVisualizerInSidebar'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -172,9 +164,8 @@ export const SidebarSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.combinedLyricsAndVisualizer', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.combinedLyricsAndVisualizer', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.combinedLyricsAndVisualizer'),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -182,7 +173,7 @@ export const SidebarSettings = memo(() => {
|
||||
<SettingsSection
|
||||
extra={<SidebarReorder />}
|
||||
options={options}
|
||||
title={t('page.setting.sidebar', { postProcess: 'sentenceCase' })}
|
||||
title={t('page.setting.sidebar')}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -44,11 +44,11 @@ const getGroupedThemeData = () => {
|
||||
|
||||
return [
|
||||
{
|
||||
group: i18n.t('setting.themeDark', { postProcess: 'sentenceCase' }),
|
||||
group: i18n.t('setting.themeDark'),
|
||||
items: darkThemes,
|
||||
},
|
||||
{
|
||||
group: i18n.t('setting.themeLight', { postProcess: 'sentenceCase' }),
|
||||
group: i18n.t('setting.themeLight'),
|
||||
items: lightThemes,
|
||||
},
|
||||
];
|
||||
@@ -118,10 +118,9 @@ export const ThemeSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.useSystemTheme', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.useSystemTheme', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.useSystemTheme'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -152,10 +151,9 @@ export const ThemeSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.theme', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: settings.followSystemTheme,
|
||||
title: t('setting.theme', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.theme'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -175,10 +173,9 @@ export const ThemeSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.themeDark', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !settings.followSystemTheme,
|
||||
title: t('setting.themeDark', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.themeDark'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -198,10 +195,9 @@ export const ThemeSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.themeLight', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !settings.followSystemTheme,
|
||||
title: t('setting.themeLight', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.themeLight'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -218,10 +214,9 @@ export const ThemeSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.useThemeAccentColor', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.useThemeAccentColor', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.useThemeAccentColor'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -251,9 +246,8 @@ export const ThemeSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.accentColor', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.accentColor', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.accentColor'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -270,10 +264,9 @@ export const ThemeSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.useThemePrimaryShade', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: false,
|
||||
title: t('setting.useThemePrimaryShade', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.useThemePrimaryShade'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -295,10 +288,9 @@ export const ThemeSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.primaryShade', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: settings.useThemePrimaryShade,
|
||||
title: t('setting.primaryShade', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.primaryShade'),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -306,7 +298,7 @@ export const ThemeSettings = memo(() => {
|
||||
<SettingsSection
|
||||
extra={<StylesSettings />}
|
||||
options={themeOptions}
|
||||
title={t('page.setting.theme', { postProcess: 'sentenceCase' })}
|
||||
title={t('page.setting.theme')}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -22,102 +22,83 @@ import { TextInput } from '/@/shared/components/text-input/text-input';
|
||||
const ipc = isElectron() ? window.api.ipc : null;
|
||||
|
||||
const BINDINGS_MAP: Record<BindingActions, string> = {
|
||||
browserBack: i18n.t('setting.hotkey', { context: 'browserBack', postProcess: 'sentenceCase' }),
|
||||
browserBack: i18n.t('setting.hotkey', { context: 'browserBack' }),
|
||||
browserForward: i18n.t('setting.hotkey', {
|
||||
context: 'browserForward',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
favoriteCurrentAdd: i18n.t('setting.hotkey', {
|
||||
context: 'favoriteCurrentSong',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
favoriteCurrentRemove: i18n.t('setting.hotkey', {
|
||||
context: 'unfavoriteCurrentSong',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
favoriteCurrentToggle: i18n.t('setting.hotkey', {
|
||||
context: 'toggleCurrentSongFavorite',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
favoritePreviousAdd: i18n.t('setting.hotkey', {
|
||||
context: 'favoritePreviousSong',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
favoritePreviousRemove: i18n.t('setting.hotkey', {
|
||||
context: 'unfavoritePreviousSong',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
favoritePreviousToggle: i18n.t('setting.hotkey', {
|
||||
context: 'togglePreviousSongFavorite',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
globalSearch: i18n.t('setting.hotkey', {
|
||||
context: 'globalSearch',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
listNavigateToPage: i18n.t('setting.hotkey', {
|
||||
context: 'listNavigateToPage',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
listPlayDefault: i18n.t('setting.hotkey', {
|
||||
context: 'listPlayDefault',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
listPlayLast: i18n.t('setting.hotkey', {
|
||||
context: 'listPlayLast',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
listPlayNext: i18n.t('setting.hotkey', {
|
||||
context: 'listPlayNext',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
listPlayNow: i18n.t('setting.hotkey', { context: 'listPlayNow', postProcess: 'sentenceCase' }),
|
||||
localSearch: i18n.t('setting.hotkey', { context: 'localSearch', postProcess: 'sentenceCase' }),
|
||||
listPlayNow: i18n.t('setting.hotkey', { context: 'listPlayNow' }),
|
||||
localSearch: i18n.t('setting.hotkey', { context: 'localSearch' }),
|
||||
navigateHome: i18n.t('setting.hotkey', {
|
||||
context: 'navigateHome',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
next: i18n.t('setting.hotkey', { context: 'playbackNext', postProcess: 'sentenceCase' }),
|
||||
pause: i18n.t('setting.hotkey', { context: 'playbackPause', postProcess: 'sentenceCase' }),
|
||||
play: i18n.t('setting.hotkey', { context: 'playbackPlay', postProcess: 'sentenceCase' }),
|
||||
next: i18n.t('setting.hotkey', { context: 'playbackNext' }),
|
||||
pause: i18n.t('setting.hotkey', { context: 'playbackPause' }),
|
||||
play: i18n.t('setting.hotkey', { context: 'playbackPlay' }),
|
||||
playPause: i18n.t('setting.hotkey', {
|
||||
context: 'playbackPlayPause',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
previous: i18n.t('setting.hotkey', {
|
||||
context: 'playbackPrevious',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
rate0: i18n.t('setting.hotkey', { context: 'rate0', postProcess: 'sentenceCase' }),
|
||||
rate1: i18n.t('setting.hotkey', { context: 'rate1', postProcess: 'sentenceCase' }),
|
||||
rate2: i18n.t('setting.hotkey', { context: 'rate2', postProcess: 'sentenceCase' }),
|
||||
rate3: i18n.t('setting.hotkey', { context: 'rate3', postProcess: 'sentenceCase' }),
|
||||
rate4: i18n.t('setting.hotkey', { context: 'rate4', postProcess: 'sentenceCase' }),
|
||||
rate5: i18n.t('setting.hotkey', { context: 'rate5', postProcess: 'sentenceCase' }),
|
||||
rate0: i18n.t('setting.hotkey', { context: 'rate0' }),
|
||||
rate1: i18n.t('setting.hotkey', { context: 'rate1' }),
|
||||
rate2: i18n.t('setting.hotkey', { context: 'rate2' }),
|
||||
rate3: i18n.t('setting.hotkey', { context: 'rate3' }),
|
||||
rate4: i18n.t('setting.hotkey', { context: 'rate4' }),
|
||||
rate5: i18n.t('setting.hotkey', { context: 'rate5' }),
|
||||
skipBackward: i18n.t('setting.hotkey', {
|
||||
context: 'skipBackward',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
skipForward: i18n.t('setting.hotkey', { context: 'skipForward', postProcess: 'sentenceCase' }),
|
||||
stop: i18n.t('setting.hotkey', { context: 'playbackStop', postProcess: 'sentenceCase' }),
|
||||
skipForward: i18n.t('setting.hotkey', { context: 'skipForward' }),
|
||||
stop: i18n.t('setting.hotkey', { context: 'playbackStop' }),
|
||||
toggleFullscreenPlayer: i18n.t('setting.hotkey', {
|
||||
context: 'toggleFullScreenPlayer',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
toggleQueue: i18n.t('setting.hotkey', { context: 'toggleQueue', postProcess: 'sentenceCase' }),
|
||||
toggleQueue: i18n.t('setting.hotkey', { context: 'toggleQueue' }),
|
||||
toggleRepeat: i18n.t('setting.hotkey', {
|
||||
context: 'toggleRepeat',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
toggleShuffle: i18n.t('setting.hotkey', {
|
||||
context: 'toggleShuffle',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
volumeDown: i18n.t('setting.hotkey', { context: 'volumeDown', postProcess: 'sentenceCase' }),
|
||||
volumeMute: i18n.t('setting.hotkey', { context: 'volumeMute', postProcess: 'sentenceCase' }),
|
||||
volumeUp: i18n.t('setting.hotkey', { context: 'volumeUp', postProcess: 'sentenceCase' }),
|
||||
zoomIn: i18n.t('setting.hotkey', { context: 'zoomIn', postProcess: 'sentenceCase' }),
|
||||
zoomOut: i18n.t('setting.hotkey', { context: 'zoomOut', postProcess: 'sentenceCase' }),
|
||||
volumeDown: i18n.t('setting.hotkey', { context: 'volumeDown' }),
|
||||
volumeMute: i18n.t('setting.hotkey', { context: 'volumeMute' }),
|
||||
volumeUp: i18n.t('setting.hotkey', { context: 'volumeUp' }),
|
||||
zoomIn: i18n.t('setting.hotkey', { context: 'zoomIn' }),
|
||||
zoomOut: i18n.t('setting.hotkey', { context: 'zoomOut' }),
|
||||
};
|
||||
|
||||
export const HotkeyManagerSettings = memo(() => {
|
||||
@@ -260,9 +241,8 @@ export const HotkeyManagerSettings = memo(() => {
|
||||
control={<></>}
|
||||
description={t('setting.applicationHotkeys', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
})}
|
||||
title={t('setting.applicationHotkeys', { postProcess: 'sentenceCase' })}
|
||||
title={t('setting.applicationHotkeys')}
|
||||
/>
|
||||
<div className={styles.container}>
|
||||
<Table withColumnBorders withRowBorders>
|
||||
|
||||
@@ -54,11 +54,10 @@ export const MediaSessionSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.mediaSession', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: isLinux || !isDesktop,
|
||||
note: t('common.restartRequired', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.mediaSession', { postProcess: 'sentenceCase' }),
|
||||
note: t('common.restartRequired'),
|
||||
title: t('setting.mediaSession'),
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -54,10 +54,9 @@ export const WindowHotkeySettings = memo(() => {
|
||||
),
|
||||
description: t('setting.globalMediaHotkeys', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.globalMediaHotkeys', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.globalMediaHotkeys'),
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -60,9 +60,7 @@ export const useAudioDevices = (playbackType: PlayerType) => {
|
||||
})
|
||||
.catch(() =>
|
||||
toast.error({
|
||||
message: t('error.audioDeviceFetchError', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
message: t('error.audioDeviceFetchError'),
|
||||
}),
|
||||
);
|
||||
} else if (playbackType === PlayerType.LOCAL && mpvPlayer) {
|
||||
@@ -74,9 +72,7 @@ export const useAudioDevices = (playbackType: PlayerType) => {
|
||||
setAudioDevices(uniqueDevices);
|
||||
} catch {
|
||||
toast.error({
|
||||
message: t('error.audioDeviceFetchError', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
message: t('error.audioDeviceFetchError'),
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -121,14 +117,10 @@ export const AudioSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.audioPlayer', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
note:
|
||||
status === PlayerStatus.PLAYING
|
||||
? t('common.playerMustBePaused', { postProcess: 'sentenceCase' })
|
||||
: undefined,
|
||||
title: t('setting.audioPlayer', { postProcess: 'sentenceCase' }),
|
||||
note: status === PlayerStatus.PLAYING ? t('common.playerMustBePaused') : undefined,
|
||||
title: t('setting.audioPlayer'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -149,10 +141,9 @@ export const AudioSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.audioDevice', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.audioDevice', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.audioDevice'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -167,13 +158,10 @@ export const AudioSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.webAudio', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: settings.type !== PlayerType.WEB,
|
||||
note: t('common.restartRequired', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.webAudio', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
note: t('common.restartRequired'),
|
||||
title: t('setting.webAudio'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -188,12 +176,9 @@ export const AudioSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.preservePitch', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: settings.type !== PlayerType.WEB,
|
||||
title: t('setting.preservePitch', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.preservePitch'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -210,18 +195,10 @@ export const AudioSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.audioFadeOnStatusChange', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.audioFadeOnStatusChange', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.audioFadeOnStatusChange'),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<SettingsSection
|
||||
options={audioOptions}
|
||||
title={t('page.setting.audio', { postProcess: 'sentenceCase' })}
|
||||
/>
|
||||
);
|
||||
return <SettingsSection options={audioOptions} title={t('page.setting.audio')} />;
|
||||
});
|
||||
|
||||
@@ -33,9 +33,8 @@ export const AutoDJSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.autoDJ_itemCount', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.autoDJ_itemCount', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.autoDJ_itemCount'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -56,16 +55,10 @@ export const AutoDJSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.autoDJ_timing', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.autoDJ_timing', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.autoDJ_timing'),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<SettingsSection
|
||||
options={autoDJOptions}
|
||||
title={t('setting.autoDJ', { postProcess: 'titleCase' })}
|
||||
/>
|
||||
);
|
||||
return <SettingsSection options={autoDJOptions} title={t('setting.autoDJ')} />;
|
||||
});
|
||||
|
||||
@@ -107,7 +107,7 @@ export const MpvSettings = memo(() => {
|
||||
icon="refresh"
|
||||
onClick={handleReloadMpv}
|
||||
tooltip={{
|
||||
label: t('common.reload', { postProcess: 'titleCase' }),
|
||||
label: t('common.reload'),
|
||||
openDelay: 0,
|
||||
}}
|
||||
variant="subtle"
|
||||
@@ -137,11 +137,10 @@ export const MpvSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.mpvExecutablePath', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: settings.type !== PlayerType.LOCAL,
|
||||
note: 'Restart required',
|
||||
title: t('setting.mpvExecutablePath', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.mpvExecutablePath'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -155,7 +154,6 @@ export const MpvSettings = memo(() => {
|
||||
}}
|
||||
placeholder={`(${t('setting.mpvExtraParameters', {
|
||||
context: 'help',
|
||||
postProcess: 'sentenceCase',
|
||||
})}):\n--gapless-audio=weak\n--prefetch-playlist=yes`}
|
||||
width={225}
|
||||
/>
|
||||
@@ -166,7 +164,6 @@ export const MpvSettings = memo(() => {
|
||||
<Text isMuted isNoSelect size="sm">
|
||||
{t('setting.mpvExtraParameters', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
})}
|
||||
</Text>
|
||||
<Text size="sm">
|
||||
@@ -181,12 +178,8 @@ export const MpvSettings = memo(() => {
|
||||
</Stack>
|
||||
),
|
||||
isHidden: settings.type !== PlayerType.LOCAL,
|
||||
note: t('common.restartRequired', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.mpvExtraParameters', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
note: t('common.restartRequired'),
|
||||
title: t('setting.mpvExtraParameters'),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -195,12 +188,11 @@ export const MpvSettings = memo(() => {
|
||||
control: (
|
||||
<Select
|
||||
data={[
|
||||
{ label: t('common.no', { postProcess: 'titleCase' }), value: 'no' },
|
||||
{ label: t('common.yes', { postProcess: 'titleCase' }), value: 'yes' },
|
||||
{ label: t('common.no'), value: 'no' },
|
||||
{ label: t('common.yes'), value: 'yes' },
|
||||
{
|
||||
label: t('setting.gaplessAudio', {
|
||||
context: 'optionWeak',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
value: 'weak',
|
||||
},
|
||||
@@ -211,10 +203,9 @@ export const MpvSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.gaplessAudio', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: settings.type !== PlayerType.LOCAL,
|
||||
title: t('setting.gaplessAudio', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.gaplessAudio'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -234,10 +225,9 @@ export const MpvSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.sampleRate', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
note: 'Page refresh required for web player',
|
||||
title: t('setting.sampleRate', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.sampleRate'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -254,10 +244,9 @@ export const MpvSettings = memo(() => {
|
||||
|
||||
description: t('setting.audioExclusiveMode', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: settings.type !== PlayerType.LOCAL,
|
||||
title: t('setting.audioExclusiveMode', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.audioExclusiveMode'),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -269,21 +258,18 @@ export const MpvSettings = memo(() => {
|
||||
{
|
||||
label: t('setting.replayGainMode', {
|
||||
context: 'optionNone',
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: 'no',
|
||||
},
|
||||
{
|
||||
label: t('setting.replayGainMode', {
|
||||
context: 'optionTrack',
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: 'track',
|
||||
},
|
||||
{
|
||||
label: t('setting.replayGainMode', {
|
||||
context: 'optionAlbum',
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: 'album',
|
||||
},
|
||||
@@ -294,14 +280,11 @@ export const MpvSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.replayGainMode', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
ReplayGain: 'ReplayGain',
|
||||
}),
|
||||
note: t('common.restartRequired', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.replayGainMode', {
|
||||
postProcess: 'sentenceCase',
|
||||
|
||||
ReplayGain: 'ReplayGain',
|
||||
}),
|
||||
note: t('common.restartRequired'),
|
||||
title: t('setting.replayGainMode', { ReplayGain: 'ReplayGain' }),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -313,13 +296,10 @@ export const MpvSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.replayGainMode', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
ReplayGain: 'ReplayGain',
|
||||
}),
|
||||
title: t('setting.replayGainPreamp', {
|
||||
postProcess: 'sentenceCase',
|
||||
|
||||
ReplayGain: 'ReplayGain',
|
||||
}),
|
||||
title: t('setting.replayGainPreamp', { ReplayGain: 'ReplayGain' }),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -332,13 +312,10 @@ export const MpvSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.replayGainClipping', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
ReplayGain: 'ReplayGain',
|
||||
}),
|
||||
title: t('setting.replayGainClipping', {
|
||||
postProcess: 'sentenceCase',
|
||||
|
||||
ReplayGain: 'ReplayGain',
|
||||
}),
|
||||
title: t('setting.replayGainClipping', { ReplayGain: 'ReplayGain' }),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -350,14 +327,8 @@ export const MpvSettings = memo(() => {
|
||||
width={75}
|
||||
/>
|
||||
),
|
||||
description: t('setting.replayGainFallback', {
|
||||
postProcess: 'sentenceCase',
|
||||
ReplayGain: 'ReplayGain',
|
||||
}),
|
||||
title: t('setting.replayGainFallback', {
|
||||
postProcess: 'sentenceCase',
|
||||
ReplayGain: 'ReplayGain',
|
||||
}),
|
||||
description: t('setting.replayGainFallback', { ReplayGain: 'ReplayGain' }),
|
||||
title: t('setting.replayGainFallback', { ReplayGain: 'ReplayGain' }),
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -37,57 +37,57 @@ type FilterFieldConfig = {
|
||||
|
||||
const getFilterFields = (t: (key: string, options?: any) => string): FilterFieldConfig[] => [
|
||||
{
|
||||
label: t('table.config.label.title', { postProcess: 'titleCase' }),
|
||||
label: t('table.config.label.title'),
|
||||
type: 'string',
|
||||
value: 'name',
|
||||
},
|
||||
{
|
||||
label: t('table.config.label.albumArtist', { postProcess: 'titleCase' }),
|
||||
label: t('table.config.label.albumArtist'),
|
||||
type: 'string',
|
||||
value: 'albumArtist',
|
||||
},
|
||||
{
|
||||
label: t('table.config.label.artist', { postProcess: 'titleCase' }),
|
||||
label: t('table.config.label.artist'),
|
||||
type: 'string',
|
||||
value: 'artist',
|
||||
},
|
||||
{
|
||||
label: t('table.config.label.duration', { postProcess: 'titleCase' }),
|
||||
label: t('table.config.label.duration'),
|
||||
type: 'number',
|
||||
value: 'duration',
|
||||
},
|
||||
{
|
||||
label: t('table.config.label.genre', { postProcess: 'titleCase' }),
|
||||
label: t('table.config.label.genre'),
|
||||
type: 'string',
|
||||
value: 'genre',
|
||||
},
|
||||
{
|
||||
label: t('table.config.label.year', { postProcess: 'titleCase' }),
|
||||
label: t('table.config.label.year'),
|
||||
type: 'number',
|
||||
value: 'year',
|
||||
},
|
||||
{
|
||||
label: t('table.config.label.note', { postProcess: 'titleCase' }),
|
||||
label: t('table.config.label.note'),
|
||||
type: 'string',
|
||||
value: 'note',
|
||||
},
|
||||
{
|
||||
label: t('table.config.label.path', { postProcess: 'titleCase' }),
|
||||
label: t('table.config.label.path'),
|
||||
type: 'string',
|
||||
value: 'path',
|
||||
},
|
||||
{
|
||||
label: t('table.config.label.playCount', { postProcess: 'titleCase' }),
|
||||
label: t('table.config.label.playCount'),
|
||||
type: 'number',
|
||||
value: 'playCount',
|
||||
},
|
||||
{
|
||||
label: t('table.config.label.favorite', { postProcess: 'titleCase' }),
|
||||
label: t('table.config.label.favorite'),
|
||||
type: 'boolean',
|
||||
value: 'favorite',
|
||||
},
|
||||
{
|
||||
label: t('table.config.label.rating', { postProcess: 'titleCase' }),
|
||||
label: t('table.config.label.rating'),
|
||||
type: 'number',
|
||||
value: 'rating',
|
||||
},
|
||||
@@ -118,7 +118,7 @@ const getOperatorsForFieldType = (
|
||||
startsWith: 'filterOperator.startsWith',
|
||||
};
|
||||
|
||||
return t(operatorKeyMap[operator] || operator, { postProcess: 'titleCase' });
|
||||
return t(operatorKeyMap[operator] || operator);
|
||||
};
|
||||
|
||||
switch (type) {
|
||||
@@ -413,23 +413,17 @@ export const PlayerFilterSettings = memo(() => {
|
||||
)}
|
||||
<Group grow>
|
||||
<Button onClick={handleAddFilter} variant="filled">
|
||||
{t('common.add', { postProcess: 'titleCase' })}
|
||||
{t('common.add')}
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
),
|
||||
description: t('setting.playerFilters', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.playerFilters', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.playerFilters'),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<SettingsSection
|
||||
options={filterOptions}
|
||||
title={t('page.setting.playerFilters', { postProcess: 'sentenceCase' })}
|
||||
/>
|
||||
);
|
||||
return <SettingsSection options={filterOptions} title={t('page.setting.playerFilters')} />;
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@ export const TranscodeSettings = memo(() => {
|
||||
const { t } = useTranslation();
|
||||
const { transcode } = usePlaybackSettings();
|
||||
const { setTranscodingConfig } = useSettingsStoreActions();
|
||||
const note = t('setting.transcodeNote', { postProcess: 'sentenceCase' });
|
||||
const note = t('setting.transcodeNote');
|
||||
|
||||
const transcodeOptions: SettingOption[] = [
|
||||
{
|
||||
@@ -32,10 +32,9 @@ export const TranscodeSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.transcode', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
note,
|
||||
title: t('setting.transcode', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.transcode'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -56,11 +55,10 @@ export const TranscodeSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.transcodeBitrate', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !transcode.enabled,
|
||||
note,
|
||||
title: t('setting.transcodeBitrate', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.transcodeBitrate'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -79,18 +77,12 @@ export const TranscodeSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.transcodeFormat', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !transcode.enabled,
|
||||
note,
|
||||
title: t('setting.transcodeFormat', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.transcodeFormat'),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<SettingsSection
|
||||
options={transcodeOptions}
|
||||
title={t('page.setting.transcoding', { postProcess: 'sentenceCase' })}
|
||||
/>
|
||||
);
|
||||
return <SettingsSection options={transcodeOptions} title={t('page.setting.transcoding')} />;
|
||||
});
|
||||
|
||||
@@ -53,23 +53,13 @@ export const SettingsContent = () => {
|
||||
variant="default"
|
||||
>
|
||||
<Tabs.List>
|
||||
<Tabs.Tab value="general">
|
||||
{t('page.setting.generalTab', { postProcess: 'sentenceCase' })}
|
||||
</Tabs.Tab>
|
||||
<Tabs.Tab value="playback">
|
||||
{t('page.setting.playbackTab', { postProcess: 'sentenceCase' })}
|
||||
</Tabs.Tab>
|
||||
<Tabs.Tab value="hotkeys">
|
||||
{t('page.setting.hotkeysTab', { postProcess: 'sentenceCase' })}
|
||||
</Tabs.Tab>
|
||||
<Tabs.Tab value="general">{t('page.setting.generalTab')}</Tabs.Tab>
|
||||
<Tabs.Tab value="playback">{t('page.setting.playbackTab')}</Tabs.Tab>
|
||||
<Tabs.Tab value="hotkeys">{t('page.setting.hotkeysTab')}</Tabs.Tab>
|
||||
{isElectron() && (
|
||||
<Tabs.Tab value="window">
|
||||
{t('page.setting.windowTab', { postProcess: 'sentenceCase' })}
|
||||
</Tabs.Tab>
|
||||
<Tabs.Tab value="window">{t('page.setting.windowTab')}</Tabs.Tab>
|
||||
)}
|
||||
<Tabs.Tab value="advanced">
|
||||
{t('page.setting.advanced', { postProcess: 'sentenceCase' })}
|
||||
</Tabs.Tab>
|
||||
<Tabs.Tab value="advanced">{t('page.setting.advanced')}</Tabs.Tab>
|
||||
</Tabs.List>
|
||||
<Tabs.Panel value="general">
|
||||
<Suspense fallback={<Spinner container />}>
|
||||
|
||||
@@ -30,10 +30,10 @@ export const SettingsHeader = ({ setSearch }: SettingsHeaderProps) => {
|
||||
openModal({
|
||||
children: (
|
||||
<ConfirmModal onConfirm={handleResetToDefault}>
|
||||
<Text>{t('common.areYouSure', { postProcess: 'sentenceCase' })}</Text>
|
||||
<Text>{t('common.areYouSure')}</Text>
|
||||
</ConfirmModal>
|
||||
),
|
||||
title: t('common.resetToDefault', { postProcess: 'sentenceCase' }),
|
||||
title: t('common.resetToDefault'),
|
||||
});
|
||||
};
|
||||
|
||||
@@ -44,7 +44,7 @@ export const SettingsHeader = ({ setSearch }: SettingsHeaderProps) => {
|
||||
<Group wrap="nowrap">
|
||||
<Icon icon="settings" size="5xl" />
|
||||
<LibraryHeaderBar.Title>
|
||||
{t('common.setting', { count: 2, postProcess: 'titleCase' })}
|
||||
{t('common.setting', { count: 2 })}
|
||||
</LibraryHeaderBar.Title>
|
||||
</Group>
|
||||
<Group>
|
||||
@@ -53,7 +53,7 @@ export const SettingsHeader = ({ setSearch }: SettingsHeaderProps) => {
|
||||
onChange={(event) => setSearch(event.target.value.toLocaleLowerCase())}
|
||||
/>
|
||||
<Button onClick={openResetConfirmModal} variant="default">
|
||||
{t('common.resetToDefault', { postProcess: 'sentenceCase' })}
|
||||
{t('common.resetToDefault')}
|
||||
</Button>
|
||||
</Group>
|
||||
</Flex>
|
||||
|
||||
@@ -31,7 +31,7 @@ export const CacheSettings = memo(() => {
|
||||
}
|
||||
|
||||
toast.success({
|
||||
message: t('setting.clearCacheSuccess', { postProcess: 'sentenceCase' }),
|
||||
message: t('setting.clearCacheSuccess'),
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
@@ -49,10 +49,10 @@ export const CacheSettings = memo(() => {
|
||||
openModal({
|
||||
children: (
|
||||
<ConfirmModal onConfirm={() => clearCache(full)}>
|
||||
{t(`common.areYouSure`, { postProcess: 'sentenceCase' })}
|
||||
{t(`common.areYouSure`)}
|
||||
</ConfirmModal>
|
||||
),
|
||||
title: t(`setting.${key}`, { postProcess: 'sentenceCase' }),
|
||||
title: t(`setting.${key}`),
|
||||
});
|
||||
};
|
||||
|
||||
@@ -65,14 +65,13 @@ export const CacheSettings = memo(() => {
|
||||
size="compact-md"
|
||||
variant="filled"
|
||||
>
|
||||
{t('common.clear', { postProcess: 'sentenceCase' })}
|
||||
{t('common.clear')}
|
||||
</Button>
|
||||
),
|
||||
description: t('setting.clearQueryCache', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.clearQueryCache', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.clearQueryCache'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -82,15 +81,14 @@ export const CacheSettings = memo(() => {
|
||||
size="compact-md"
|
||||
variant="filled"
|
||||
>
|
||||
{t('common.clear', { postProcess: 'sentenceCase' })}
|
||||
{t('common.clear')}
|
||||
</Button>
|
||||
),
|
||||
description: t('setting.clearCache', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !browser,
|
||||
title: t('setting.clearCache', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.clearCache'),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -102,15 +100,10 @@ export const CacheSettings = memo(() => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<SettingsSection
|
||||
options={options}
|
||||
title={t('page.setting.cache', { postProcess: 'sentenceCase' })}
|
||||
/>
|
||||
<SettingsSection options={options} title={t('page.setting.cache')} />
|
||||
{isElectron() && (
|
||||
<Button onClick={handleOpenApplicationDirectory} variant="default">
|
||||
{t('action.openApplicationDirectory', {
|
||||
postProcess: 'sentenceCase',
|
||||
})}
|
||||
{t('action.openApplicationDirectory')}
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -43,12 +43,10 @@ export const DiscordSettings = memo(() => {
|
||||
icon: 'icon',
|
||||
paused: 'paused',
|
||||
playing: 'playing',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.discordRichPresence', {
|
||||
discord: 'Discord',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
},
|
||||
{
|
||||
@@ -68,12 +66,10 @@ export const DiscordSettings = memo(() => {
|
||||
context: 'description',
|
||||
defaultId: '1165957668758900787',
|
||||
discord: 'Discord',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.discordApplicationId', {
|
||||
discord: 'Discord',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
},
|
||||
{
|
||||
@@ -91,12 +87,9 @@ export const DiscordSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.discordPausedStatus', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.discordPausedStatus', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.discordPausedStatus'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -113,12 +106,9 @@ export const DiscordSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.discordStateIcon', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.discordStateIcon', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.discordStateIcon'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -135,12 +125,9 @@ export const DiscordSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.discordListening', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.discordListening', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.discordListening'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -152,14 +139,12 @@ export const DiscordSettings = memo(() => {
|
||||
{
|
||||
label: t('setting.discordDisplayType', {
|
||||
context: 'songname',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
value: DiscordDisplayType.SONG_NAME,
|
||||
},
|
||||
{
|
||||
label: t('setting.discordDisplayType_artistname', {
|
||||
context: 'artistname',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
value: DiscordDisplayType.ARTIST_NAME,
|
||||
},
|
||||
@@ -177,13 +162,11 @@ export const DiscordSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.discordDisplayType', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.discordDisplayType', {
|
||||
discord: 'Discord',
|
||||
musicbrainz: 'musicbrainz',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
},
|
||||
{
|
||||
@@ -193,9 +176,7 @@ export const DiscordSettings = memo(() => {
|
||||
clearable={false}
|
||||
data={[
|
||||
{
|
||||
label: t('setting.discordLinkType_none', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
label: t('setting.discordLinkType_none'),
|
||||
value: DiscordLinkType.NONE,
|
||||
},
|
||||
{ label: 'last.fm', value: DiscordLinkType.LAST_FM },
|
||||
@@ -224,12 +205,10 @@ export const DiscordSettings = memo(() => {
|
||||
discord: 'Discord',
|
||||
lastfm: 'last.fm',
|
||||
musicbrainz: 'musicbrainz',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.discordLinkType', {
|
||||
discord: 'Discord',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
},
|
||||
{
|
||||
@@ -249,12 +228,10 @@ export const DiscordSettings = memo(() => {
|
||||
context: 'description',
|
||||
|
||||
discord: 'Discord',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.discordServeImage', {
|
||||
discord: 'Discord',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
},
|
||||
{
|
||||
@@ -273,20 +250,13 @@ export const DiscordSettings = memo(() => {
|
||||
description: t('setting.lastfmApiKey', {
|
||||
context: 'description',
|
||||
lastfm: 'Last.fm',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.lastfmApiKey', {
|
||||
lastfm: 'Last.fm',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<SettingsSection
|
||||
options={discordOptions}
|
||||
title={t('page.setting.discord', { postProcess: 'sentenceCase' })}
|
||||
/>
|
||||
);
|
||||
return <SettingsSection options={discordOptions} title={t('page.setting.discord')} />;
|
||||
});
|
||||
|
||||
@@ -46,10 +46,9 @@ export const PasswordSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.passwordStore', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.passwordStore', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.passwordStore'),
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -32,9 +32,7 @@ export const RemoteSettings = memo(() => {
|
||||
} else {
|
||||
toast.error({
|
||||
message: errorMsg,
|
||||
title: enabled
|
||||
? t('error.remoteEnableError', { postProcess: 'sentenceCase' })
|
||||
: t('error.remoteDisableError', { postProcess: 'sentenceCase' }),
|
||||
title: enabled ? t('error.remoteEnableError') : t('error.remoteDisableError'),
|
||||
});
|
||||
}
|
||||
}, 50);
|
||||
@@ -48,12 +46,12 @@ export const RemoteSettings = memo(() => {
|
||||
},
|
||||
});
|
||||
toast.warn({
|
||||
message: t('error.remotePortWarning', { postProcess: 'sentenceCase' }),
|
||||
message: t('error.remotePortWarning'),
|
||||
});
|
||||
} else {
|
||||
toast.error({
|
||||
message: errorMsg,
|
||||
title: t('error.remotePortError', { postProcess: 'sentenceCase' }),
|
||||
title: t('error.remotePortError'),
|
||||
});
|
||||
}
|
||||
}, 100);
|
||||
@@ -75,7 +73,6 @@ export const RemoteSettings = memo(() => {
|
||||
<Text isMuted isNoSelect size="sm">
|
||||
{t('setting.enableRemote', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
})}{' '}
|
||||
<a href={url} rel="noreferrer noopener" target="_blank">
|
||||
{url}
|
||||
@@ -83,7 +80,7 @@ export const RemoteSettings = memo(() => {
|
||||
</Text>
|
||||
),
|
||||
isHidden,
|
||||
title: t('setting.enableRemote', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.enableRemote'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -99,10 +96,9 @@ export const RemoteSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.remotePort', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden,
|
||||
title: t('setting.remotePort', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.remotePort'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -122,10 +118,9 @@ export const RemoteSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.remoteUsername', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden,
|
||||
title: t('setting.remoteUsername', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.remoteUsername'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -145,17 +140,11 @@ export const RemoteSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.remotePassword', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden,
|
||||
title: t('setting.remotePassword', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.remotePassword'),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<SettingsSection
|
||||
options={controlOptions}
|
||||
title={t('page.setting.remote', { postProcess: 'sentenceCase' })}
|
||||
/>
|
||||
);
|
||||
return <SettingsSection options={controlOptions} title={t('page.setting.remote')} />;
|
||||
});
|
||||
|
||||
@@ -30,21 +30,18 @@ export const UpdateSettings = memo(() => {
|
||||
{
|
||||
label: t('setting.releaseChannel', {
|
||||
context: 'optionLatest',
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: 'latest',
|
||||
},
|
||||
{
|
||||
label: t('setting.releaseChannel', {
|
||||
context: 'optionBeta',
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: 'beta',
|
||||
},
|
||||
{
|
||||
label: t('setting.releaseChannel', {
|
||||
context: 'optionAlpha',
|
||||
postProcess: 'titleCase',
|
||||
}),
|
||||
value: 'alpha',
|
||||
},
|
||||
@@ -63,15 +60,14 @@ export const UpdateSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.releaseChannel', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: disableAutoUpdates(),
|
||||
title: t('setting.releaseChannel', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.releaseChannel'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
aria-label={t('setting.automaticUpdates', { postProcess: 'sentenceCase' })}
|
||||
aria-label={t('setting.automaticUpdates')}
|
||||
defaultChecked={!settings.disableAutoUpdate}
|
||||
disabled={disableAutoUpdates()}
|
||||
onChange={(e) => {
|
||||
@@ -88,17 +84,11 @@ export const UpdateSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.automaticUpdates', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: disableAutoUpdates(),
|
||||
title: t('setting.automaticUpdates', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.automaticUpdates'),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<SettingsSection
|
||||
options={updateOptions}
|
||||
title={t('page.setting.updates', { postProcess: 'sentenceCase' })}
|
||||
/>
|
||||
);
|
||||
return <SettingsSection options={updateOptions} title={t('page.setting.updates')} />;
|
||||
});
|
||||
|
||||
@@ -60,10 +60,9 @@ export const WindowSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.windowBarStyle', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.windowBarStyle', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.windowBarStyle'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -99,13 +98,10 @@ export const WindowSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.trayEnabled', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
note: t('common.restartRequired', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
title: t('setting.trayEnabled', { postProcess: 'sentenceCase' }),
|
||||
note: t('common.restartRequired'),
|
||||
title: t('setting.trayEnabled'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -126,10 +122,9 @@ export const WindowSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.minimizeToTray', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron() || !settings.tray,
|
||||
title: t('setting.minimizeToTray', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.minimizeToTray'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -150,10 +145,9 @@ export const WindowSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.exitToTray', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron() || !settings.tray,
|
||||
title: t('setting.exitToTray', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.exitToTray'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -174,10 +168,9 @@ export const WindowSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.startMinimized', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron() || !settings.tray,
|
||||
title: t('setting.startMinimized', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.startMinimized'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -201,10 +194,9 @@ export const WindowSettings = memo(() => {
|
||||
),
|
||||
description: t('setting.preventSleepOnPlayback', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.preventSleepOnPlayback', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.preventSleepOnPlayback'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -235,10 +227,5 @@ export const WindowSettings = memo(() => {
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<SettingsSection
|
||||
options={windowOptions}
|
||||
title={t('page.setting.application', { postProcess: 'sentenceCase' })}
|
||||
/>
|
||||
);
|
||||
return <SettingsSection options={windowOptions} title={t('page.setting.application')} />;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user