mirror of
https://github.com/mssoftjp/obsidian-voice-input.git
synced 2026-07-22 06:44:48 +00:00
fix(settings): sync transcription language when linking
This commit is contained in:
parent
67f53156c3
commit
df9cccb8f7
1 changed files with 15 additions and 0 deletions
|
|
@ -56,7 +56,22 @@ export class VoiceInputSettingTab extends PluginSettingTab {
|
|||
))
|
||||
.setValue(this.plugin.settings.pluginLanguage)
|
||||
.onChange(async (value: Locale) => {
|
||||
const transcriptionLocale = value as 'ja' | 'en' | 'zh' | 'ko';
|
||||
this.plugin.settings.pluginLanguage = value;
|
||||
|
||||
// Keep transcription language synchronized while linking remains enabled
|
||||
if (this.plugin.settings.advanced?.languageLinkingEnabled !== false) {
|
||||
this.plugin.settings.transcriptionLanguage = transcriptionLocale;
|
||||
if (!this.plugin.settings.advanced) {
|
||||
this.plugin.settings.advanced = {
|
||||
languageLinkingEnabled: true,
|
||||
transcriptionLanguage: transcriptionLocale
|
||||
};
|
||||
} else {
|
||||
this.plugin.settings.advanced.transcriptionLanguage = transcriptionLocale;
|
||||
}
|
||||
}
|
||||
|
||||
await this.plugin.saveSettings();
|
||||
this.i18n.setLocale(value);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue