Internationalize console halt script

This file previously had to have a space after "Do you want to proceed [y|n]?" to make the prompt for user input nice. That made it one of the few exceptions to the code style guide, where lines are not supposed to have blank space at the end.
Might as well have 1 less exception to the rule by internationalizing it, which removes the literal "EOD" echo output stuff.
This commit is contained in:
Phil Davis 2015-12-10 13:32:02 +05:45
parent c0499d4861
commit cfd8da201f

View File

@ -37,21 +37,11 @@
$fp = fopen('php://stdin', 'r');
echo <<<EOD
{$g['product_name']} will shutdown and halt system. This may take a few minutes, depending on your hardware.
Do you want to proceed [y|n]?
EOD;
echo "\n" . sprintf(gettext("%s will shutdown and halt system. This may take a few minutes, depending on your hardware."), $g['product_name']) . "\n";
echo gettext("Do you want to proceed [y|n]?") . " ";
if (strcasecmp(chop(fgets($fp)), "y") == 0) {
echo <<<EOD
{$g['product_name']} will shutdown and halt system now.
EOD;
echo "\n" . sprintf(gettext("%s will shutdown and halt system now."), $g['product_name']) . "\n";
system_halt();
}