mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-23 07:27:13 +01:00
Fixes #13824: Support extracting concatenated strings in yii message
This commit is contained in:
committed by
Alexander Makarov
parent
0973117de2
commit
cfaec11da5
@@ -458,6 +458,26 @@ abstract class BaseMessageControllerTest extends TestCase
|
||||
$this->language = $firstLanguage;
|
||||
$this->assertArrayHasKey($mainMessage, $messages, "\"$mainMessage\" for language \"$secondLanguage\" is missing in translation file. Command output:\n\n" . $out);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreateTranslation
|
||||
*
|
||||
* @see https://github.com/yiisoft/yii2/issues/13824
|
||||
*/
|
||||
public function testCreateTranslationFromConcatenatedString()
|
||||
{
|
||||
$category = 'test.category1';
|
||||
$mainMessage = 'main message second message third message';
|
||||
$sourceFileContent = "Yii::t('{$category}', 'main message' . \" second message\".' third message');";
|
||||
$this->createSourceFile($sourceFileContent);
|
||||
|
||||
$this->saveConfigFile($this->getConfig());
|
||||
$out = $this->runMessageControllerAction('extract', [$this->configFileName]);
|
||||
|
||||
$messages = $this->loadMessages($category);
|
||||
$this->assertArrayHasKey($mainMessage, $messages,
|
||||
"\"$mainMessage\" is missing in translation file. Command output:\n\n" . $out);
|
||||
}
|
||||
}
|
||||
|
||||
class MessageControllerMock extends MessageController
|
||||
|
||||
Reference in New Issue
Block a user