Skip to content

Commit 602b99d

Browse files
committed
translate cli messages
1 parent 300a6d5 commit 602b99d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

system/CLI/SignalTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ protected function isPcntlAvailable(): bool
6868
} else {
6969
self::$isPcntlAvailable = extension_loaded('pcntl');
7070
if (! self::$isPcntlAvailable) {
71-
CLI::write('PCNTL extension not available. Signal handling disabled.', 'yellow');
71+
CLI::write(lang('CLI.signals.noPcntlExtension'), 'yellow');
7272
}
7373
}
7474
}
@@ -103,7 +103,7 @@ protected function registerSignals(
103103
}
104104

105105
if (! $this->isPosixAvailable() && (in_array(SIGTSTP, $signals, true) || in_array(SIGCONT, $signals, true))) {
106-
CLI::write('SIGTSTP/SIGCONT handling requires POSIX extension. These signals will be removed from registration.', 'yellow');
106+
CLI::write(lang('CLI.signals.noPosixExtension'), 'yellow');
107107
$signals = array_diff($signals, [SIGTSTP, SIGCONT]);
108108

109109
// Remove from method map as well
@@ -124,7 +124,7 @@ protected function registerSignals(
124124
$this->registeredSignals[] = $signal;
125125
} else {
126126
$signal = $this->getSignalName($signal);
127-
CLI::write("Failed to register handler for signal: {$signal}", 'red');
127+
CLI::write(lang('CLI.signals.failedSignal', [$signal]), 'red');
128128
}
129129
}
130130
}

system/Language/en/CLI.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,9 @@
5252
'helpUsage' => 'Usage:',
5353
'invalidColor' => 'Invalid "{0}" color: "{1}".',
5454
'namespaceNotDefined' => 'Namespace "{0}" is not defined.',
55+
'signals' => [
56+
'noPcntlExtension' => 'PCNTL extension not available. Signal handling disabled.',
57+
'noPosixExtension' => 'SIGTSTP/SIGCONT handling requires POSIX extension. These signals will be removed from registration.',
58+
'failedSignal' => 'Failed to register handler for signal: "{0}"',
59+
],
5560
];

0 commit comments

Comments
 (0)