mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-29 18:22:41 +01:00
Make some strings in ArcanistPhutilXHPASTLinter
translatable
Summary: `pht`ize some string in `ArcanistPhutilXHPASTLinter` so that they are translatable. Test Plan: Not 100% sure that I am doing it right... Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D10431
This commit is contained in:
parent
ec35375e96
commit
ce58b92dff
1 changed files with 28 additions and 10 deletions
|
@ -38,10 +38,17 @@ final class ArcanistPhutilXHPASTLinter extends ArcanistBaseXHPASTLinter {
|
||||||
|
|
||||||
public function getLintNameMap() {
|
public function getLintNameMap() {
|
||||||
return array(
|
return array(
|
||||||
self::LINT_ARRAY_COMBINE => 'array_combine() Unreliable',
|
self::LINT_ARRAY_COMBINE => pht(
|
||||||
self::LINT_DEPRECATED_FUNCTION => 'Use of Deprecated Function',
|
'%s Unreliable',
|
||||||
self::LINT_UNSAFE_DYNAMIC_STRING => 'Unsafe Usage of Dynamic String',
|
'array_combine()'),
|
||||||
self::LINT_RAGGED_CLASSTREE_EDGE => 'Class Not abstract Or final',
|
self::LINT_DEPRECATED_FUNCTION => pht(
|
||||||
|
'Use of Deprecated Function'),
|
||||||
|
self::LINT_UNSAFE_DYNAMIC_STRING => pht(
|
||||||
|
'Unsafe Usage of Dynamic String'),
|
||||||
|
self::LINT_RAGGED_CLASSTREE_EDGE => pht(
|
||||||
|
'Class Not %s Or %s',
|
||||||
|
'abstract',
|
||||||
|
'final'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,8 +201,11 @@ final class ArcanistPhutilXHPASTLinter extends ArcanistBaseXHPASTLinter {
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$call,
|
$call,
|
||||||
self::LINT_UNSAFE_DYNAMIC_STRING,
|
self::LINT_UNSAFE_DYNAMIC_STRING,
|
||||||
"Parameter ".($param + 1)." of {$name}() should be a scalar string, ".
|
pht(
|
||||||
"otherwise it's not safe.");
|
"Parameter %d of %s should be a scalar string, ".
|
||||||
|
"otherwise it's not safe.",
|
||||||
|
$param + 1,
|
||||||
|
$name.'()'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -218,8 +228,12 @@ final class ArcanistPhutilXHPASTLinter extends ArcanistBaseXHPASTLinter {
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$call,
|
$call,
|
||||||
self::LINT_ARRAY_COMBINE,
|
self::LINT_ARRAY_COMBINE,
|
||||||
'Prior to PHP 5.4, array_combine() fails when given empty '.
|
pht(
|
||||||
'arrays. Prefer to write array_combine(x, x) as array_fuse(x).');
|
'Prior to PHP 5.4, `%s` fails when given empty arrays. '.
|
||||||
|
'Prefer to write `%s` as `%s`.',
|
||||||
|
'array_combine()',
|
||||||
|
'array_combine(x, x)',
|
||||||
|
'array_fuse(x)'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -273,8 +287,12 @@ final class ArcanistPhutilXHPASTLinter extends ArcanistBaseXHPASTLinter {
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$class->getChildOfType(1, 'n_CLASS_NAME'),
|
$class->getChildOfType(1, 'n_CLASS_NAME'),
|
||||||
self::LINT_RAGGED_CLASSTREE_EDGE,
|
self::LINT_RAGGED_CLASSTREE_EDGE,
|
||||||
"This class is neither 'final' nor 'abstract', and does not have ".
|
pht(
|
||||||
"a docblock marking it '@concrete-extensible'.");
|
"This class is neither '%s' nor '%s', and does not have ".
|
||||||
|
"a docblock marking it '%s'.",
|
||||||
|
'final',
|
||||||
|
'abstract',
|
||||||
|
'@concrete-extensible'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue