Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

PhpExtractor translations always extracts with "messages" domain #20135

Copy link
Copy link
Closed
@muxahuk

Description

@muxahuk
Issue body actions

Hey.
I'v been making some translations gui bundle and found a bug in PhpExtractor:
Every message that found by PhpExtractor is with "messages" domain.

So, for unit tests i did:

added line to FrameworkBundle/Tests/Fixtures/Views/translation.html.php

<?php echo $view['translator']->trans( 'other-domain-test', [], 'not_messages' ); ?>

and modified tests file ( FrameworkBundle/Tests/Translation/PhpExtractorTest.php )

// Assert
        $expectedCatalogue = array('messages' => array(
            'single-quoted key' => 'prefixsingle-quoted key',
            'double-quoted key' => 'prefixdouble-quoted key',
            'heredoc key' => 'prefixheredoc key',
            'nowdoc key' => 'prefixnowdoc key',
            "double-quoted key with whitespace and escaped \$\n\" sequences" => "prefixdouble-quoted key with whitespace and escaped \$\n\" sequences",
            'single-quoted key with whitespace and nonescaped \$\n\' sequences' => 'prefixsingle-quoted key with whitespace and nonescaped \$\n\' sequences',
            'single-quoted key with "quote mark at the end"' => 'prefixsingle-quoted key with "quote mark at the end"',
            $expectedHeredoc => 'prefix'.$expectedHeredoc,
            $expectedNowdoc => 'prefix'.$expectedNowdoc,
            '{0} There is no apples|{1} There is one apple|]1,Inf[ There are %count% apples' => 'prefix{0} There is no apples|{1} There is one apple|]1,Inf[ There are %count% apples',
        ), 'not_messages' => array(
            'other-domain-test' => 'prefixother-domain-test'
        ) );

added 'not_messages' key and values array

And it fails!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.