mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-04-18 12:47:27 +02:00
Switch tracking key to accountStorage
This commit is contained in:
parent
f11a834895
commit
549fae4015
@ -1,5 +1,6 @@
|
|||||||
import { registerDebugFunction } from './power-user.js';
|
import { registerDebugFunction } from './power-user.js';
|
||||||
import { updateSecretDisplay } from './secrets.js';
|
import { updateSecretDisplay } from './secrets.js';
|
||||||
|
import { accountStorage } from './util/AccountStorage.js';
|
||||||
|
|
||||||
const storageKey = 'language';
|
const storageKey = 'language';
|
||||||
const overrideLanguage = localStorage.getItem(storageKey);
|
const overrideLanguage = localStorage.getItem(storageKey);
|
||||||
@ -291,7 +292,7 @@ export async function initLocales() {
|
|||||||
attributeFilter: ['data-i18n'],
|
attributeFilter: ['data-i18n'],
|
||||||
});
|
});
|
||||||
|
|
||||||
if (localStorage.getItem('trackDynamicTranslate') === 'true' && isSupportedNonEnglish()) {
|
if (accountStorage.getItem('trackDynamicTranslate') === 'true' && isSupportedNonEnglish()) {
|
||||||
trackMissingDynamicTranslate = new Set();
|
trackMissingDynamicTranslate = new Set();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,8 +305,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, '
|
'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.',
|
+ '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 = localStorage.getItem('trackDynamicTranslate') !== 'true';
|
const isTracking = accountStorage.getItem('trackDynamicTranslate') !== 'true';
|
||||||
localStorage.setItem('trackDynamicTranslate', isTracking ? 'true' : 'false');
|
accountStorage.setItem('trackDynamicTranslate', isTracking ? 'true' : 'false');
|
||||||
if (isTracking && isSupportedNonEnglish()) {
|
if (isTracking && isSupportedNonEnglish()) {
|
||||||
trackMissingDynamicTranslate = new Set();
|
trackMissingDynamicTranslate = new Set();
|
||||||
toastr.success('Dynamic translation tracking enabled.');
|
toastr.success('Dynamic translation tracking enabled.');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user