adjust wording and toggles for analytics/updates (#1654)

This commit is contained in:
jeffvli
2026-02-09 22:19:49 -08:00
parent 2927fa5ff7
commit a28c403093
3 changed files with 20 additions and 15 deletions
+4 -1
View File
@@ -713,6 +713,8 @@
"albumBackgroundBlur": "album background image blur size", "albumBackgroundBlur": "album background image blur size",
"analyticsDisable": "Opt-out of usage based analytics", "analyticsDisable": "Opt-out of usage based analytics",
"analyticsDisable_description": "Anonymized usage data is sent to the developer to help improve the application", "analyticsDisable_description": "Anonymized usage data is sent to the developer to help improve the application",
"analyticsEnable": "Send usage-based analytics",
"analyticsEnable_description": "Anonymized usage data is sent to the developer to help improve the application",
"applicationHotkeys_description": "configure application hotkeys. toggle the checkbox to set as a global hotkey (desktop only)", "applicationHotkeys_description": "configure application hotkeys. toggle the checkbox to set as a global hotkey (desktop only)",
"applicationHotkeys": "application hotkeys", "applicationHotkeys": "application hotkeys",
"artistBackground": "artist background image", "artistBackground": "artist background image",
@@ -749,7 +751,8 @@
"customCssNotice": "Warning: while there is some sanitization (disallowing url() and content:), using custom css can still pose risks by changing the interface", "customCssNotice": "Warning: while there is some sanitization (disallowing url() and content:), using custom css can still pose risks by changing the interface",
"customFontPath_description": "sets the path to the custom font to use for the application", "customFontPath_description": "sets the path to the custom font to use for the application",
"customFontPath": "custom font path", "customFontPath": "custom font path",
"disableAutomaticUpdates": "disable automatic updates", "automaticUpdates": "Automatic updates",
"automaticUpdates_description": "Check for and install updates automatically",
"releaseChannel_optionAlpha": "alpha (nightly)", "releaseChannel_optionAlpha": "alpha (nightly)",
"releaseChannel_optionBeta": "beta", "releaseChannel_optionBeta": "beta",
"releaseChannel_optionLatest": "latest", "releaseChannel_optionLatest": "latest",
@@ -10,11 +10,11 @@ import { Switch } from '/@/shared/components/switch/switch';
export const AnalyticsSettings = memo(() => { export const AnalyticsSettings = memo(() => {
const { t } = useTranslation(); const { t } = useTranslation();
const handleToggleAnalytics = (disable: boolean) => { const handleSetSendAnalytics = (send: boolean) => {
if (disable) { if (send) {
localStorage.setItem('umami.disabled', '1');
} else {
localStorage.removeItem('umami.disabled'); localStorage.removeItem('umami.disabled');
} else {
localStorage.setItem('umami.disabled', '1');
} }
}; };
@@ -22,12 +22,13 @@ export const AnalyticsSettings = memo(() => {
{ {
control: ( control: (
<Switch <Switch
defaultChecked={localStorage.getItem('umami.disabled') === '1'} aria-label={t('setting.analyticsEnable', { postProcess: 'sentenceCase' })}
onChange={(e) => handleToggleAnalytics(e.currentTarget.checked)} defaultChecked={localStorage.getItem('umami.disabled') !== '1'}
onChange={(e) => handleSetSendAnalytics(e.currentTarget.checked)}
/> />
), ),
description: t('setting.analyticsDisable_description', { postProcess: 'sentenceCase' }), description: t('setting.analyticsEnable_description', { postProcess: 'sentenceCase' }),
title: t('setting.analyticsDisable', { postProcess: 'sentenceCase' }), title: t('setting.analyticsEnable', { postProcess: 'sentenceCase' }),
}, },
]; ];
@@ -71,26 +71,27 @@ export const UpdateSettings = memo(() => {
{ {
control: ( control: (
<Switch <Switch
aria-label="Disable automatic updates" aria-label={t('setting.automaticUpdates', { postProcess: 'sentenceCase' })}
defaultChecked={settings.disableAutoUpdate} defaultChecked={!settings.disableAutoUpdate}
disabled={disableAutoUpdates()} disabled={disableAutoUpdates()}
onChange={(e) => { onChange={(e) => {
if (!e) return; if (!e) return;
localSettings?.set('disable_auto_updates', e.currentTarget.checked); const enabled = e.currentTarget.checked;
localSettings?.set('disable_auto_updates', !enabled);
setSettings({ setSettings({
window: { window: {
disableAutoUpdate: e.currentTarget.checked, disableAutoUpdate: !enabled,
}, },
}); });
}} }}
/> />
), ),
description: t('setting.disableAutomaticUpdates', { description: t('setting.automaticUpdates', {
context: 'description', context: 'description',
postProcess: 'sentenceCase', postProcess: 'sentenceCase',
}), }),
isHidden: disableAutoUpdates(), isHidden: disableAutoUpdates(),
title: t('setting.disableAutomaticUpdates', { postProcess: 'sentenceCase' }), title: t('setting.automaticUpdates', { postProcess: 'sentenceCase' }),
}, },
]; ];