Skip to content

Commit 893f34f

Browse files
committed
update: changeset's description
1 parent 659a09f commit 893f34f

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

.changeset/five-chairs-poke.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,25 @@
22
"@clack/prompts": minor
33
---
44

5-
Add support for customizable spinner cancel and error messages. Users can now customize these messages either per spinner instance or globally via the new `updatePromptsSettings` function to support multilingual CLIs.
5+
Add support for customizable spinner cancel and error messages. Users can now customize these messages either per spinner instance or globally via the `updateSettings` function to support multilingual CLIs.
6+
7+
```ts
8+
// Per-instance customization
9+
const spinner = prompts.spinner({
10+
cancelMessage: 'Operación cancelada', // "Operation cancelled" in Spanish
11+
errorMessage: 'Se produjo un error' // "An error occurred" in Spanish
12+
});
13+
14+
// Global customization via settings
15+
prompts.updateSettings({
16+
messages: {
17+
cancel: 'Operación cancelada', // "Operation cancelled" in Spanish
18+
error: 'Se produjo un error' // "An error occurred" in Spanish
19+
}
20+
});
21+
22+
// Direct options take priority over global settings
23+
const spinner = prompts.spinner({
24+
cancelMessage: 'Cancelled', // This will be used instead of the global setting
25+
});
26+
```

0 commit comments

Comments
 (0)