Skip to content

Commit 704bdfd

Browse files
committed
Merge branch '2.3'
* 2.3: Clear lazy loading initializer after the service is successfully initialized [FrameworkBundle] added support for double-quoted strings in the extractor (closes #8797) [SecurityBundle] Move format-dependent tests from SecurityExtensionTest bumped Symfony version to 2.3.5-DEV updated VERSION for 2.3.4 updated CHANGELOG for 2.3.4 bumped Symfony version to 2.2.7 updated VERSION for 2.2.6 update CONTRIBUTORS for 2.2.6 updated CHANGELOG for 2.2.6 clearToken exception is thrown at wrong place. fix typo in test skipped message [Form] Fixed Form::all() signature for PHP 5.3.3 [Form] Fixed Form::all() signature for PHP 5.3.3 [Locale] Fixed: Locale::setDefault() throws no exception when "en" is passed [Locale] Fixed: StubLocale::setDefault() throws no exception when "en" is passed [Translation] Grammar fix [Yaml] fixed embedded folded string parsing [Validator] fixed Boolean handling in XML constraint mappings (closes #5603) [Translation] Fixed regression: When only one rule is passed to transChoice(), this rule should be used Conflicts: src/Symfony/Component/HttpKernel/Kernel.php
2 parents 27c8176 + 0422d05 commit 704bdfd

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
This template is used for translation message extraction tests
2-
<?php echo $view['translator']->trans('new key') ?>
2+
<?php echo $view['translator']->trans('single-quoted key') ?>
3+
<?php echo $view['translator']->trans("double-quoted key") ?>

Tests/Translation/PhpExtractorTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ public function testExtraction()
2828
$extractor->extract(__DIR__.'/../Fixtures/Resources/views/', $catalogue);
2929

3030
// Assert
31-
$this->assertCount(1, $catalogue->all('messages'), '->extract() should find 1 translation');
32-
$this->assertTrue($catalogue->has('new key'), '->extract() should find at leat "new key" message');
33-
$this->assertEquals('prefixnew key', $catalogue->get('new key'), '->extract() should apply "prefix" as prefix');
31+
$this->assertCount(2, $catalogue->all('messages'), '->extract() should find 1 translation');
32+
$this->assertTrue($catalogue->has('single-quoted key'), '->extract() should find the "single-quoted key" message');
33+
$this->assertTrue($catalogue->has('double-quoted key'), '->extract() should find the "double-quoted key" message');
34+
$this->assertEquals('prefixsingle-quoted key', $catalogue->get('single-quoted key'), '->extract() should apply "prefix" as prefix');
3435
}
3536
}

Translation/PhpExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ protected function parseTokens($tokens, MessageCatalogue $catalog)
111111
}
112112
}
113113

114-
$message = trim($message, '\'');
114+
$message = trim($message, '\'"');
115115

116116
if ($message) {
117117
$catalog->set($message, $this->prefix.$message);

0 commit comments

Comments
 (0)