mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-12 07:12:58 +02:00
Use proper casing for i18n locales (#1998)
This commit is contained in:
@@ -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')}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user