Revert "Switch tracking key to accountStorage" This reverts commit 549fae4015c049f2d194daa7176f5df1b67422ea.

a8f05c92aef64247b874440b10478805710b53ae

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +3 -4Ignore whitespace
public/scripts/i18n.js+3 -4
@@ -1,6 +1,5 @@
1import { registerDebugFunction } from './power-user.js';1import { registerDebugFunction } from './power-user.js';
2import { updateSecretDisplay } from './secrets.js';2import { updateSecretDisplay } from './secrets.js';
3import { accountStorage } from './util/AccountStorage.js';
43
5const storageKey = 'language';4const storageKey = 'language';
6const overrideLanguage = localStorage.getItem(storageKey);5const overrideLanguage = localStorage.getItem(storageKey);
@@ -292,7 +291,7 @@ export async function initLocales() {
292 attributeFilter: ['data-i18n'],291 attributeFilter: ['data-i18n'],
293 });292 });
294293
295 if (accountStorage.getItem('trackDynamicTranslate') === 'true' && isSupportedNonEnglish()) {294 if (localStorage.getItem('trackDynamicTranslate') === 'true' && isSupportedNonEnglish()) {
296 trackMissingDynamicTranslate = new Set();295 trackMissingDynamicTranslate = new Set();
297 }296 }
298297
@@ -305,8 +304,8 @@ export async function initLocales() {
305 'This includes things translated via the t`...` function and translate(). It will only track strings translated <b>after</b> this is toggled on, '304 'This includes things translated via the t`...` function and translate(). It will only track strings translated <b>after</b> this is toggled on, '
306 + '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.',305 + '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.',
307 () => {306 () => {
308 const isTracking = accountStorage.getItem('trackDynamicTranslate') !== 'true';307 const isTracking = localStorage.getItem('trackDynamicTranslate') !== 'true';
309 accountStorage.setItem('trackDynamicTranslate', isTracking ? 'true' : 'false');308 localStorage.setItem('trackDynamicTranslate', isTracking ? 'true' : 'false');
310 if (isTracking && isSupportedNonEnglish()) {309 if (isTracking && isSupportedNonEnglish()) {
311 trackMissingDynamicTranslate = new Set();310 trackMissingDynamicTranslate = new Set();
312 toastr.success('Dynamic translation tracking enabled.');311 toastr.success('Dynamic translation tracking enabled.');