Page MenuHomePhabricator

D13199.diff
No OneTemporary

D13199.diff

diff --git a/scripts/test/prompt.php b/scripts/test/prompt.php
--- a/scripts/test/prompt.php
+++ b/scripts/test/prompt.php
@@ -22,7 +22,7 @@
array(
'name' => 'prompt',
'param' => 'text',
- 'default' => 'Enter some text:',
+ 'default' => pht('Enter some text:'),
'help' => pht('Change the prompt text to __text__.'),
),
));
diff --git a/src/auth/PhutilPersonaAuthAdapter.php b/src/auth/PhutilPersonaAuthAdapter.php
--- a/src/auth/PhutilPersonaAuthAdapter.php
+++ b/src/auth/PhutilPersonaAuthAdapter.php
@@ -59,7 +59,7 @@
}
if (idx($response, 'status') !== 'okay') {
- $reason = idx($response, 'reason', 'Unknown');
+ $reason = idx($response, 'reason', pht('Unknown'));
throw new Exception(pht('Persona login failed: %s', $reason));
}
diff --git a/src/console/__tests__/PhutilConsoleWrapTestCase.php b/src/console/__tests__/PhutilConsoleWrapTestCase.php
--- a/src/console/__tests__/PhutilConsoleWrapTestCase.php
+++ b/src/console/__tests__/PhutilConsoleWrapTestCase.php
@@ -18,15 +18,17 @@
public function testConsoleWrap() {
$this->assertEqual(
phutil_console_format(
- "<bg:red>** ERROR **</bg> abc abc abc abc abc abc abc abc abc abc ".
+ "<bg:red>** %s **</bg> abc abc abc abc abc abc abc abc abc abc ".
"abc abc abc abc abc abc abc\nabc abc abc abc abc abc abc abc abc ".
- "abc abc!"),
+ "abc abc!",
+ pht('ERROR')),
phutil_console_wrap(
phutil_console_format(
- '<bg:red>** ERROR **</bg> abc abc abc abc abc abc abc abc abc abc '.
+ '<bg:red>** %s **</bg> abc abc abc abc abc abc abc abc abc abc '.
'abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc '.
- 'abc abc!')),
- 'ANSI escape sequences should not contribute toward wrap width.');
+ 'abc abc!',
+ pht('ERROR'))),
+ pht('ANSI escape sequences should not contribute toward wrap width.'));
}
public function testWrapIndent() {
diff --git a/src/filesystem/linesofalarge/__tests__/LinesOfALargeExecFutureTestCase.php b/src/filesystem/linesofalarge/__tests__/LinesOfALargeExecFutureTestCase.php
--- a/src/filesystem/linesofalarge/__tests__/LinesOfALargeExecFutureTestCase.php
+++ b/src/filesystem/linesofalarge/__tests__/LinesOfALargeExecFutureTestCase.php
@@ -16,7 +16,7 @@
}
public function testExecLargeFile() {
- $line = 'The quick brown fox jumps over the lazy dog.';
+ $line = pht('The quick brown fox jumps over the lazy dog.');
$n = 100;
$this->writeAndRead(
diff --git a/src/filesystem/linesofalarge/__tests__/LinesOfALargeFileTestCase.php b/src/filesystem/linesofalarge/__tests__/LinesOfALargeFileTestCase.php
--- a/src/filesystem/linesofalarge/__tests__/LinesOfALargeFileTestCase.php
+++ b/src/filesystem/linesofalarge/__tests__/LinesOfALargeFileTestCase.php
@@ -52,7 +52,7 @@
}
public function testLargeFile() {
- $line = 'The quick brown fox jumps over the lazy dog.';
+ $line = pht('The quick brown fox jumps over the lazy dog.');
$n = 100;
$this->writeAndRead(
diff --git a/src/lexer/PhutilShellLexer.php b/src/lexer/PhutilShellLexer.php
--- a/src/lexer/PhutilShellLexer.php
+++ b/src/lexer/PhutilShellLexer.php
@@ -28,7 +28,7 @@
$tokens = $this->getTokens($string);
if (count($this->getLexerState()) > 1) {
throw new UnexpectedValueException(
- 'Unterminated string in argument list!');
+ pht('Unterminated string in argument list!'));
}
foreach ($tokens as $key => $token) {
diff --git a/src/parser/__tests__/PhutilURITestCase.php b/src/parser/__tests__/PhutilURITestCase.php
--- a/src/parser/__tests__/PhutilURITestCase.php
+++ b/src/parser/__tests__/PhutilURITestCase.php
@@ -7,20 +7,20 @@
public function testURIParsing() {
$uri = new PhutilURI('http://user:pass@host:99/path/?query=value#fragment');
- $this->assertEqual('http', $uri->getProtocol(), 'protocol');
- $this->assertEqual('user', $uri->getUser(), 'user');
- $this->assertEqual('pass', $uri->getPass(), 'pass');
- $this->assertEqual('host', $uri->getDomain(), 'domain');
- $this->assertEqual('99', $uri->getPort(), 'port');
+ $this->assertEqual('http', $uri->getProtocol(), pht('protocol'));
+ $this->assertEqual('user', $uri->getUser(), pht('user'));
+ $this->assertEqual('pass', $uri->getPass(), pht('password'));
+ $this->assertEqual('host', $uri->getDomain(), pht('domain'));
+ $this->assertEqual('99', $uri->getPort(), pht('port'));
- $this->assertEqual('/path/', $uri->getPath(), 'path');
+ $this->assertEqual('/path/', $uri->getPath(), pht('path'));
$this->assertEqual(
array(
'query' => 'value',
),
$uri->getQueryParams(),
'query params');
- $this->assertEqual('fragment', $uri->getFragment(), 'fragment');
+ $this->assertEqual('fragment', $uri->getFragment(), pht('fragment'));
$this->assertEqual(
'http://user:pass@host:99/path/?query=value#fragment',
(string)$uri,
@@ -28,15 +28,18 @@
$uri = new PhutilURI('ssh://git@example.com/example/example.git');
- $this->assertEqual('ssh', $uri->getProtocol(), 'protocol');
- $this->assertEqual('git', $uri->getUser(), 'user');
- $this->assertEqual('', $uri->getPass(), 'pass');
- $this->assertEqual('example.com', $uri->getDomain(), 'domain');
+ $this->assertEqual('ssh', $uri->getProtocol(), pht('protocol'));
+ $this->assertEqual('git', $uri->getUser(), pht('user'));
+ $this->assertEqual('', $uri->getPass(), pht('password'));
+ $this->assertEqual('example.com', $uri->getDomain(), pht('domain'));
$this->assertEqual('', $uri->getPort(), 'port');
- $this->assertEqual('/example/example.git', $uri->getPath(), 'path');
- $this->assertEqual(array(), $uri->getQueryParams(), 'query params');
- $this->assertEqual('', $uri->getFragment(), 'fragment');
+ $this->assertEqual('/example/example.git', $uri->getPath(), pht('path'));
+ $this->assertEqual(
+ array(),
+ $uri->getQueryParams(),
+ pht('query parameters'));
+ $this->assertEqual('', $uri->getFragment(), pht('fragment'));
$this->assertEqual(
'ssh://git@example.com/example/example.git',
(string)$uri,
@@ -127,14 +130,14 @@
public function testUnusualURIs() {
$uri = new PhutilURI('file:///path/to/file');
- $this->assertEqual('file', $uri->getProtocol(), 'protocol');
- $this->assertEqual('', $uri->getDomain(), 'domain');
- $this->assertEqual('/path/to/file', $uri->getPath(), 'path');
+ $this->assertEqual('file', $uri->getProtocol(), pht('protocol'));
+ $this->assertEqual('', $uri->getDomain(), pht('domain'));
+ $this->assertEqual('/path/to/file', $uri->getPath(), pht('path'));
$uri = new PhutilURI('idea://open?x=/');
- $this->assertEqual('idea', $uri->getProtocol(), 'protocol');
- $this->assertEqual('open', $uri->getDomain(), 'domain');
- $this->assertEqual('', $uri->getPath(), 'path');
+ $this->assertEqual('idea', $uri->getProtocol(), pht('protocol'));
+ $this->assertEqual('open', $uri->getDomain(), pht('domain'));
+ $this->assertEqual('', $uri->getPath(), pht('path'));
$this->assertEqual(
array(
'x' => '/',
diff --git a/src/parser/argument/__tests__/PhutilArgumentSpecificationTestCase.php b/src/parser/argument/__tests__/PhutilArgumentSpecificationTestCase.php
--- a/src/parser/argument/__tests__/PhutilArgumentSpecificationTestCase.php
+++ b/src/parser/argument/__tests__/PhutilArgumentSpecificationTestCase.php
@@ -28,7 +28,7 @@
$this->assertEqual(
!$valid,
$caught instanceof Exception,
- "Arg name '{$name}'.");
+ pht("Argument name '%s'.", $name));
}
}

File Metadata

Mime Type
text/plain
Expires
Sun, Oct 20, 11:39 AM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6716970
Default Alt Text
D13199.diff (7 KB)

Event Timeline