You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .changeset/five-chairs-poke.md
+22-1Lines changed: 22 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,4 +2,25 @@
2
2
"@clack/prompts": minor
3
3
---
4
4
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
0 commit comments