Changeset View
Changeset View
Standalone View
Standalone View
src/config/source/ArcanistConfigurationSource.php
Show All 16 Lines | abstract class ArcanistConfigurationSource | ||||
public function isStringSource() { | public function isStringSource() { | ||||
return false; | return false; | ||||
} | } | ||||
public function isWritableConfigurationSource() { | public function isWritableConfigurationSource() { | ||||
return false; | return false; | ||||
} | } | ||||
public function didReadUnknownOption($key) { | public function didReadUnknownOption(ArcanistRuntime $runtime, $key) { | ||||
// TOOLSETS: Standardize this kind of messaging? On ArcanistRuntime? | $runtime->getLogEngine()->writeWarning( | ||||
pht('UNKNOWN CONFIGURATION'), | |||||
amckinley: Any chance of moving this `pht()` call into the `LogEngine`? Or is it important that `pht()`… | |||||
Done Inline ActionsYeah, pht(...) needs to be right at the source of the string. The string extractor (which generates a list of strings which need translation, for translators) works by looking for pht(<some string>) in the source code using static analysis. We could theoretically make writeWarning(...) extract strings like pht(), but I think we're better off avoiding that in cases where the argument isn't super compelling. Some of the workflows I'm touching right now are very user-facing, I think we won't have quite as much logging happening in the real workflows (diff, branch, etc) although the next diff I'm working on now (shell-complete) is now like 95% user interaction. epriestley: Yeah, `pht(...)` needs to be right at the source of the string. The string extractor (which… | |||||
fprintf( | |||||
STDERR, | |||||
tsprintf( | |||||
"<bg:yellow>** %s **</bg> %s\n", | |||||
pht('WARNING'), | |||||
pht( | pht( | ||||
'Ignoring unrecognized configuration option ("%s") from source: %s.', | 'Ignoring unrecognized configuration option ("%s") from source: %s.', | ||||
$key, | $key, | ||||
$this->getSourceDisplayName()))); | $this->getSourceDisplayName())); | ||||
} | } | ||||
} | } | ||||
No newline at end of file | No newline at end of file |
Any chance of moving this pht() call into the LogEngine? Or is it important that pht() invocations happen near a string's definition to help with translations? (I haven't looked under the hood at pht at all).