Skip to content

Commit 6770a7a

Browse files
Merge branch '3.1'
* 3.1: [travis/appveyor] Wire simple-phpunit [Console] fixed PHP7 Errors are now handled and converted to Exceptions Fix #19721 Fix translation:update command count bumped Symfony version to 2.8.12 updated VERSION for 2.8.11 updated CHANGELOG for 2.8.11 bumped Symfony version to 2.7.19 updated VERSION for 2.7.18 update CONTRIBUTORS for 2.7.18 updated CHANGELOG for 2.7.18 [Security] Optimize RoleHierarchy's buildRoleMap method [FrameworkBundle] Fix Incorrect line break in exception message (500 debug page) [Security] Added note inside phpdoc. Minor cleanups and improvements [form] lazy trans `post_max_size_message`. [DI] Fix setting synthetic services on ContainerBuilder [ClassLoader] Fix ClassCollectionLoader inlining with declare(strict_types=1)
2 parents 53cee6e + d7a9bb9 commit 6770a7a

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

Command/TranslationUpdateCommand.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,19 +166,21 @@ protected function execute(InputInterface $input, OutputInterface $output)
166166
foreach ($operation->getDomains() as $domain) {
167167
$newKeys = array_keys($operation->getNewMessages($domain));
168168
$allKeys = array_keys($operation->getMessages($domain));
169-
$domainMessagesCount = count($newKeys) + count($allKeys);
170169

171-
$io->section(sprintf('Messages extracted for domain "<info>%s</info>" (%d messages)', $domain, $domainMessagesCount));
172-
173-
$io->listing(array_merge(
170+
$list = array_merge(
174171
array_diff($allKeys, $newKeys),
175172
array_map(function ($id) {
176173
return sprintf('<fg=green>%s</>', $id);
177174
}, $newKeys),
178175
array_map(function ($id) {
179176
return sprintf('<fg=red>%s</>', $id);
180177
}, array_keys($operation->getObsoleteMessages($domain)))
181-
));
178+
);
179+
180+
$domainMessagesCount = count($list);
181+
182+
$io->section(sprintf('Messages extracted for domain "<info>%s</info>" (%d message%s)', $domain, $domainMessagesCount, $domainMessagesCount > 1 ? 's' : ''));
183+
$io->listing($list);
182184

183185
$extractedMessagesCount += $domainMessagesCount;
184186
}
@@ -187,7 +189,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
187189
$io->comment('Xliff output version is <info>1.2</info>');
188190
}
189191

190-
$resultMessage = sprintf('%d messages were successfully extracted', $extractedMessagesCount);
192+
$resultMessage = sprintf('%d message%s successfully extracted', $extractedMessagesCount, $extractedMessagesCount > 1 ? 's were' : ' was');
191193
}
192194

193195
if ($input->getOption('no-backup') === true) {

Resources/public/css/body.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ build: 56
3939
font-family: Georgia, "Times New Roman", Times, serif;
4040
font-size: 20px;
4141
color: #313131;
42-
word-break: break-all;
42+
word-wrap: break-word;
4343
}
4444
.sf-reset li {
4545
padding-bottom: 10px;

Tests/Command/TranslationUpdateCommandTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ public function testDumpMessagesAndClean()
2828
$tester = $this->createCommandTester($this->getContainer(array('messages' => array('foo' => 'foo'))));
2929
$tester->execute(array('command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true));
3030
$this->assertRegExp('/foo/', $tester->getDisplay());
31+
$this->assertRegExp('/1 message was successfully extracted/', $tester->getDisplay());
32+
}
33+
34+
public function testDumpTwoMessagesAndClean()
35+
{
36+
$tester = $this->createCommandTester($this->getContainer(array('foo' => 'foo', 'bar' => 'bar')));
37+
$tester->execute(array('command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true));
38+
$this->assertRegExp('/foo/', $tester->getDisplay());
39+
$this->assertRegExp('/bar/', $tester->getDisplay());
3140
$this->assertRegExp('/2 messages were successfully extracted/', $tester->getDisplay());
3241
}
3342

0 commit comments

Comments
 (0)