Remove product literal strings in "pht()", part 6
[phabricator.git] / src / applications / settings / setting / PhabricatorEditorSetting.php
blob1262a17e4d7b88ff5aff9f5c4d3d92ad29458390
1 <?php
3 final class PhabricatorEditorSetting
4 extends PhabricatorStringSetting {
6 const SETTINGKEY = 'editor';
8 public function getSettingName() {
9 return pht('Editor Link');
12 public function getSettingPanelKey() {
13 return PhabricatorExternalEditorSettingsPanel::PANELKEY;
16 protected function getSettingOrder() {
17 return 300;
20 protected function getControlInstructions() {
21 return pht(
22 "Many text editors can be configured as URI handlers for special ".
23 "protocols like `editor://`. If you have installed and configured ".
24 "such an editor, Phabricator can generate links that you can click ".
25 "to open files locally.".
26 "\n\n".
27 "Provide a URI pattern for building external editor URIs in your ".
28 "environment. For example, if you use TextMate on macOS, the pattern ".
29 "for your machine may look something like this:".
30 "\n\n".
31 "```name=\"Example: TextMate on macOS\"\n".
32 "%s\n".
33 "```\n".
34 "\n\n".
35 "For complete instructions on editor configuration, ".
36 "see **[[ %s | %s ]]**.".
37 "\n\n".
38 "See the tables below for a list of supported variables and protocols.",
39 'txmt://open/?url=file:///Users/alincoln/editor_links/%n/%f&line=%l',
40 PhabricatorEnv::getDoclink('User Guide: Configuring an External Editor'),
41 pht('User Guide: Configuring an External Editor'));
44 public function validateTransactionValue($value) {
45 if (!phutil_nonempty_string($value)) {
46 return;
49 id(new PhabricatorEditorURIEngine())
50 ->setPattern($value)
51 ->validatePattern();