* 切换翻译显示模式
()
| 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 | * 加载翻译显示偏好 |
no test coverage detected