mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-06 20:10:12 +02:00
adjust wording and toggles for analytics/updates (#1654)
This commit is contained in:
@@ -713,6 +713,8 @@
|
||||
"albumBackgroundBlur": "album background image blur size",
|
||||
"analyticsDisable": "Opt-out of usage based analytics",
|
||||
"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": "application hotkeys",
|
||||
"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",
|
||||
"customFontPath_description": "sets the path to the custom font to use for the application",
|
||||
"customFontPath": "custom font path",
|
||||
"disableAutomaticUpdates": "disable automatic updates",
|
||||
"automaticUpdates": "Automatic updates",
|
||||
"automaticUpdates_description": "Check for and install updates automatically",
|
||||
"releaseChannel_optionAlpha": "alpha (nightly)",
|
||||
"releaseChannel_optionBeta": "beta",
|
||||
"releaseChannel_optionLatest": "latest",
|
||||
|
||||
@@ -10,11 +10,11 @@ import { Switch } from '/@/shared/components/switch/switch';
|
||||
export const AnalyticsSettings = memo(() => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const handleToggleAnalytics = (disable: boolean) => {
|
||||
if (disable) {
|
||||
localStorage.setItem('umami.disabled', '1');
|
||||
} else {
|
||||
const handleSetSendAnalytics = (send: boolean) => {
|
||||
if (send) {
|
||||
localStorage.removeItem('umami.disabled');
|
||||
} else {
|
||||
localStorage.setItem('umami.disabled', '1');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -22,12 +22,13 @@ export const AnalyticsSettings = memo(() => {
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
defaultChecked={localStorage.getItem('umami.disabled') === '1'}
|
||||
onChange={(e) => handleToggleAnalytics(e.currentTarget.checked)}
|
||||
aria-label={t('setting.analyticsEnable', { postProcess: 'sentenceCase' })}
|
||||
defaultChecked={localStorage.getItem('umami.disabled') !== '1'}
|
||||
onChange={(e) => handleSetSendAnalytics(e.currentTarget.checked)}
|
||||
/>
|
||||
),
|
||||
description: t('setting.analyticsDisable_description', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.analyticsDisable', { postProcess: 'sentenceCase' }),
|
||||
description: t('setting.analyticsEnable_description', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.analyticsEnable', { postProcess: 'sentenceCase' }),
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -71,26 +71,27 @@ export const UpdateSettings = memo(() => {
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
aria-label="Disable automatic updates"
|
||||
defaultChecked={settings.disableAutoUpdate}
|
||||
aria-label={t('setting.automaticUpdates', { postProcess: 'sentenceCase' })}
|
||||
defaultChecked={!settings.disableAutoUpdate}
|
||||
disabled={disableAutoUpdates()}
|
||||
onChange={(e) => {
|
||||
if (!e) return;
|
||||
localSettings?.set('disable_auto_updates', e.currentTarget.checked);
|
||||
const enabled = e.currentTarget.checked;
|
||||
localSettings?.set('disable_auto_updates', !enabled);
|
||||
setSettings({
|
||||
window: {
|
||||
disableAutoUpdate: e.currentTarget.checked,
|
||||
disableAutoUpdate: !enabled,
|
||||
},
|
||||
});
|
||||
}}
|
||||
/>
|
||||
),
|
||||
description: t('setting.disableAutomaticUpdates', {
|
||||
description: t('setting.automaticUpdates', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: disableAutoUpdates(),
|
||||
title: t('setting.disableAutomaticUpdates', { postProcess: 'sentenceCase' }),
|
||||
title: t('setting.automaticUpdates', { postProcess: 'sentenceCase' }),
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user