fix(i18n): use translated label for OK button in promptForBatchFolder

Adds okLabel parameter with 'OK' fallback; caller in main.ts passes
plugin.t('editCardSave') so button text respects UI language.

https://claude.ai/code/session_012cK5rUGQvqkuxUZ59x7dLn
This commit is contained in:
Claude 2026-04-29 08:14:56 +00:00
parent 69f255b656
commit d81039611a
No known key found for this signature in database
2 changed files with 13 additions and 3 deletions

View file

@ -537,7 +537,12 @@ class ParallelReaderPlugin extends Plugin {
new Notice(this.t('batchAlreadyRunning'));
return;
}
const folderPath = await promptForBatchFolder(this.app, this.t('batchSelectFolder'), this.t('batchFolderPrompt'));
const folderPath = await promptForBatchFolder(
this.app,
this.t('batchSelectFolder'),
this.t('batchFolderPrompt'),
this.t('editCardSave'),
);
if (folderPath === null) return;
const validation = validateBatchFolderInput(folderPath, (path) => {
const target = this.app.vault.getAbstractFileByPath(path);

View file

@ -104,7 +104,12 @@ export function requestBatchCancel(state: BatchRunState | null): boolean {
return true;
}
export function promptForBatchFolder(app: App, selectText: string, promptText: string): Promise<string | null> {
export function promptForBatchFolder(
app: App,
selectText: string,
promptText: string,
okLabel = 'OK',
): Promise<string | null> {
return new Promise<string | null>((resolve) => {
const modal = new Modal(app);
modal.onOpen = () => {
@ -118,7 +123,7 @@ export function promptForBatchFolder(app: App, selectText: string, promptText: s
modal.close();
}
});
modal.contentEl.createEl('button', { text: 'OK' }).addEventListener('click', () => {
modal.contentEl.createEl('button', { text: okLabel }).addEventListener('click', () => {
resolve(input.value.trim());
modal.close();
});