8000 PhpExtractor translations always extracts with "messages" domain · Issue #20135 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

PhpExtractor translations always extracts with "messages" domain #20135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
muxahuk opened this issue Oct 3, 2016 · 1 comment
Closed

PhpExtractor translations always extracts with "messages" domain #20135

muxahuk opened this issue Oct 3, 2016 · 1 comment

Comments

@muxahuk
Copy link
muxahuk commented Oct 3, 2016

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!

@xabbuh
Copy link
Member
xabbuh commented Jan 20, 2017

see #21359 for a fix

fabpot added a commit that referenced this issue Feb 3, 2017
…php templates (robinlehrmann)

This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] fixed custom domain for translations in php templates

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20135
| License       | MIT
| Doc PR        |

Commits
-------

78c0ec5 [FrameworkBundle] fixed custom domain for translations in php templates
@fabpot fabpot closed this as completed Feb 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
0