Switch tracking key to accountStorage

549fae4015c049f2d194daa7176f5df1b67422ea

Wolfsblvt <wolfsblvt@gmail.com>

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