From 13596cd10fbe8bc98956ce4cb47c15a0936cbc78 Mon Sep 17 00:00:00 2001 From: Aviv Eyal Date: Thu, 16 Feb 2017 11:08:45 +0000 Subject: [PATCH] Add back pht()s and tsprintf()s to arg set-config Summary: See D17357 Test Plan: invoke and still see output in English? Reviewers: #blessed_reviewers, joshuaspence, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D17362 --- src/workflow/ArcanistSetConfigWorkflow.php | 31 +++++++++++++--------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/workflow/ArcanistSetConfigWorkflow.php b/src/workflow/ArcanistSetConfigWorkflow.php index 7bad38c1..75b4334f 100644 --- a/src/workflow/ArcanistSetConfigWorkflow.php +++ b/src/workflow/ArcanistSetConfigWorkflow.php @@ -72,11 +72,14 @@ EOTEXT $console = PhutilConsole::getConsole(); if (!$settings->getHelp($key)) { - $warn = pht( - 'The configuration key \'%s\' is not recognized by arc. It may '. - 'be misspelled or out of date.', - $key); - $console->writeErr("**%s:** %s\n", pht('Warning'), $warn); + $warning = tsprintf( + "**%s:** %s\n", + pht('Warning'), + pht( + 'The configuration key "%s" is not recognized by arc. It may '. + 'be misspelled or out of date.', + $key)); + $console->writeErr('%s', $warning); } $old = null; @@ -95,17 +98,18 @@ EOTEXT $old = $settings->formatConfigValueForDisplay($key, $old); if ($old === null) { - $console->writeOut( - "Deleted key '%s' from %s config.\n", + $message = pht( + 'Deleted key "%s" from %s config.', $key, $which); } else { - $console->writeOut( - "Deleted key '%s' from %s config (was %s).\n", + $message = pht( + 'Deleted key "%s" from %s config (was %s).', $key, $which, $old); } + $console->writeOut('%s', tsprintf("%s\n", $message)); } else { $val = $settings->willWriteValue($key, $val); @@ -120,19 +124,20 @@ EOTEXT $old = $settings->formatConfigValueForDisplay($key, $old); if ($old === null) { - $console->writeOut( - "Set key '%s' = %s in %s config.\n", + $message = pht( + 'Set key "%s" = %s in %s config.', $key, $val, $which); } else { - $console->writeOut( - "Set key '%s' = %s in %s config (was %s).\n", + $message = pht( + 'Set key "%s" = %s in %s config (was %s).', $key, $val, $which, $old); } + $console->writeOut('%s', tsprintf("%s\n", $message)); } return 0;