[ticket/14628] Supports translatable error messages in the CLI installer

PHPBB3-14628
This commit is contained in:
Tristan Darricau 2016-05-05 17:05:17 +02:00
parent ef226138c8
commit 1629e6aaf3
No known key found for this signature in database
GPG key ID: 817043C2E29DB881

View file

@ -124,13 +124,14 @@ class cli_iohandler extends iohandler_base
public function add_error_message($error_title, $error_description = false) public function add_error_message($error_title, $error_description = false)
{ {
$this->io->newLine(); $this->io->newLine();
if (strpos($error_title, '<br />') !== false)
{
$error_title = strip_tags(str_replace('<br />', "\n", $error_title));
}
$message = $this->translate_message($error_title, $error_description); $message = $this->translate_message($error_title, $error_description);
$message_string = $message['title'] . (!empty($message['description']) ? "\n" . $message['description'] : ''); $message_string = $message['title'] . (!empty($message['description']) ? "\n" . $message['description'] : '');
if (strpos($message_string, '<br />') !== false)
{
$message_string = strip_tags(str_replace('<br />', "\n", $message_string));
}
$this->io->error($message_string); $this->io->error($message_string);
if ($this->progress_bar !== null) if ($this->progress_bar !== null)