@@ -89,7 +89,7 @@ protected function runCommand(): void
8989 $ this ->isComplete = false ;
9090
9191 try {
92- // erzwinge Web-Runtime (nicht CLI) im Web-Kontext
92+ // Force web runtime (not CLI) in web context
9393 app ()->instance (PromptRuntime::class, new WebPromptRuntime );
9494 WebCommandRunner::ensurePublishableResourcesRegistered ();
9595
@@ -98,7 +98,7 @@ protected function runCommand(): void
9898
9999 $ state = $ this ->flowId ? $ stateStore ->get ($ this ->flowId ) : null ;
100100 if (! $ state ) {
101- // frischer Flow: ResponseStore und lokale States leeren
101+ // Fresh flow: clear ResponseStore and local states
102102 $ this ->responseStore ->clear ();
103103 $ this ->responseStore ->resetCounter ();
104104 $ this ->answers = [];
@@ -112,7 +112,7 @@ protected function runCommand(): void
112112 $ this ->flowId = $ state ->flowId ;
113113 }
114114
115- // Antworten in den ResponseStore spiegeln (ohne den Zähler zu manipulieren )
115+ // Mirror answers into ResponseStore (without manipulating the counter )
116116 foreach ($ this ->answers as $ promptId => $ answer ) {
117117 $ this ->responseStore ->set ($ promptId , $ answer );
118118 }
@@ -135,7 +135,7 @@ protected function runCommand(): void
135135
136136 if (! empty ($ result ['failed ' ])) {
137137 $ this ->currentStepOutput = $ this ->output ;
138- $ this ->error = $ result ['error ' ] ?? ' Unbekannter Fehler ' ;
138+ $ this ->error = $ result ['error ' ] ?? __ ( ' moox-prompts::prompts.ui.unknown_error ' ) ;
139139 $ this ->currentPrompt = null ;
140140
141141 return ;
@@ -186,7 +186,7 @@ protected function prefillPromptForm(array $prompt): void
186186 $ params = $ prompt ['params ' ] ?? [];
187187 $ p = PromptParamsHelper::extract ($ method , $ params );
188188
189- // Wenn bereits eine Antwort vorhanden ist, diese verwenden
189+ // If an answer already exists, use it
190190 if (isset ($ this ->answers [$ promptId ])) {
191191 $ value = $ this ->answers [$ promptId ];
192192 if ($ method === 'multiselect ' ) {
@@ -204,18 +204,18 @@ protected function prefillPromptForm(array $prompt): void
204204 return ;
205205 }
206206
207- // Ansonsten Default-Wert aus den Prompt-Params verwenden
207+ // Otherwise use default value from prompt params
208208 if ($ method === 'confirm ' ) {
209- $ default = $ p ['default ' ] ?? false ; // default Parameter (bool)
209+ $ default = $ p ['default ' ] ?? false ; // default parameter (bool)
210210 $ value = $ default ? 'yes ' : 'no ' ;
211211 $ this ->form ->fill ([$ promptId => $ value ]);
212212
213213 return ;
214214 }
215215
216216 if ($ method === 'multiselect ' ) {
217- $ defaultValue = $ p ['default ' ] ?? []; // default Parameter (array)
218- // Für multiselect müssen wir die einzelnen Checkboxen füllen
217+ $ defaultValue = $ p ['default ' ] ?? []; // default parameter (array)
218+ // For multiselect we need to fill the individual checkboxes
219219 $ options = $ p ['options ' ] ?? [];
220220 $ fillData = [];
221221 foreach (array_keys ($ options ) as $ key ) {
@@ -231,9 +231,9 @@ protected function prefillPromptForm(array $prompt): void
231231
232232 $ defaultValue = null ;
233233 if ($ method === 'select ' ) {
234- $ defaultValue = $ p ['default ' ] ?? null ; // default Parameter
234+ $ defaultValue = $ p ['default ' ] ?? null ; // default parameter
235235 } elseif (in_array ($ method , ['text ' , 'textarea ' , 'password ' ])) {
236- $ defaultValue = $ p ['default ' ] ?? '' ; // default Parameter
236+ $ defaultValue = $ p ['default ' ] ?? '' ; // default parameter
237237 }
238238
239239 if ($ defaultValue !== null ) {
@@ -577,7 +577,7 @@ protected function createMultiselectFields(string $promptId, array $params): arr
577577
578578 $ label = $ p ['label ' ] ?? '' ;
579579 $ required = ($ p ['required ' ] ?? false ) !== false ;
580- // Default-Wert: erst aus answers, dann aus default-Parameter
580+ // Default value: first from answers, then from default parameter
581581 $ defaultValue = $ this ->answers [$ promptId ] ?? ($ p ['default ' ] ?? []);
582582 $ options = $ p ['options ' ] ?? [];
583583
@@ -616,7 +616,7 @@ protected function createFieldFromPrompt(string $promptId, string $method, array
616616 $ options = $ p ['options ' ] ?? [];
617617 $ defaultSelect = $ defaultValue ?? ($ p ['default ' ] ?? null );
618618
619- // Für confirm: Default aus params[1] (default Parameter ), falls noch keine Antwort vorhanden
619+ // For confirm: default from params[1] (default parameter ), if no answer exists yet
620620 $ confirmDefault = null ;
621621 if ($ method === 'confirm ' ) {
622622 $ confirmDefault = $ defaultValue !== null ? $ defaultValue : ($ p ['default ' ] ?? false );
@@ -693,8 +693,8 @@ protected function createFieldFromPrompt(string $promptId, string $method, array
693693 'confirm ' => Radio::make ($ promptId )
694694 ->label ($ label )
695695 ->options ([
696- 'yes ' => ' Ja ' ,
697- 'no ' => ' Nein ' ,
696+ 'yes ' => __ ( ' moox-prompts::prompts.ui.confirm_yes ' ) ,
697+ 'no ' => __ ( ' moox-prompts::prompts.ui.confirm_no ' ) ,
698698 ])
699699 ->default ($ confirmDefault !== null ? ($ confirmDefault ? 'yes ' : 'no ' ) : null )
700700 ->rules ($ rules )
0 commit comments