Revert "Switch tracking key to accountStorage"

This reverts commit 549fae4015c049f2d194daa7176f5df1b67422ea.
This commit is contained in:
Cohee 2025-02-27 23:22:08 +02:00
parent 549fae4015
commit a8f05c92ae

View File

@ -1,6 +1,5 @@
import { registerDebugFunction } from './power-user.js';
import { updateSecretDisplay } from './secrets.js';
import { accountStorage } from './util/AccountStorage.js';
const storageKey = 'language';
const overrideLanguage = localStorage.getItem(storageKey);
@ -292,7 +291,7 @@ export async function initLocales() {
attributeFilter: ['data-i18n'],
});
if (accountStorage.getItem('trackDynamicTranslate') === 'true' && isSupportedNonEnglish()) {
if (localStorage.getItem('trackDynamicTranslate') === 'true' && isSupportedNonEnglish()) {
trackMissingDynamicTranslate = new Set();
}
@ -305,8 +304,8 @@ export async function initLocales() {
'This includes things translated via the t`...` function and translate(). It will only track strings translated <b>after</b> this is toggled on, '
+ 'and when they actually pop up, so refreshing the page and opening popups, etc, is needed. Will only track if the current locale is not English.',
() => {
const isTracking = accountStorage.getItem('trackDynamicTranslate') !== 'true';
accountStorage.setItem('trackDynamicTranslate', isTracking ? 'true' : 'false');
const isTracking = localStorage.getItem('trackDynamicTranslate') !== 'true';
localStorage.setItem('trackDynamicTranslate', isTracking ? 'true' : 'false');
if (isTracking && isSupportedNonEnglish()) {
trackMissingDynamicTranslate = new Set();
toastr.success('Dynamic translation tracking enabled.');