MCPcopy
hub / github.com/iChochy/NCE / toggleTranslationMode

Method toggleTranslationMode

js/ReadingSystem.js:806–813  ·  view source on GitHub ↗

* 切换翻译显示模式

()

Source from the content-addressed store, hash-verified

804 * 切换翻译显示模式
805 */
806 toggleTranslationMode() {
807 const currentIndex = this.config.TRANSLATION_MODES.indexOf(this.state.translationMode);
808 const nextIndex =
809 currentIndex === -1 ? 0 : (currentIndex + 1) % this.config.TRANSLATION_MODES.length;
810 this.state.translationMode = this.config.TRANSLATION_MODES[nextIndex];
811 setStorage(this.config.STORAGE_KEYS.TRANSLATION_MODE, this.state.translationMode);
812 this.updateTranslationToggle();
813 }
814
815 /**
816 * 加载翻译显示偏好

Callers 1

bindTranslationToggleMethod · 0.95

Calls 2

setStorageFunction · 0.90

Tested by

no test coverage detected