-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #38424 [Translation] Rename Translatable class to Translatabl…
…eMessage (natewiebe13) This PR was submitted for the master branch but it was merged into the 5.x branch instead. Discussion ---------- [Translation] Rename Translatable class to TranslatableMessage | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #38342 | License | MIT | Doc PR | TBD This PR is in anticipation of #38342 passing. We'll need to also update the docs and the blog post here: https://symfony.com/blog/new-in-symfony-5-2-translatable-objects One extra note not discussed in the issue thread is the increase in the class name length shouldn't really be a problem as `t()` is likely to be used more often. Commits ------- 0d4e25f Rename Translatable class to TranslatableMessage
- Loading branch information
Showing
9 changed files
with
56 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 16 additions & 16 deletions
32
src/Symfony/Component/Translation/Tests/fixtures/extractor/translatable-fqn.html.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
This template is used for translation message extraction tests | ||
<?php new \Symfony\Component\Translation\Translatable('translatable-fqn single-quoted key'); ?> | ||
<?php new \Symfony\Component\Translation\Translatable('translatable-fqn double-quoted key'); ?> | ||
<?php new \Symfony\Component\Translation\Translatable(<<<EOF | ||
<?php new \Symfony\Component\Translation\TranslatableMessage('translatable-fqn single-quoted key'); ?> | ||
<?php new \Symfony\Component\Translation\TranslatableMessage('translatable-fqn double-quoted key'); ?> | ||
<?php new \Symfony\Component\Translation\TranslatableMessage(<<<EOF | ||
translatable-fqn heredoc key | ||
EOF | ||
); ?> | ||
<?php new \Symfony\Component\Translation\Translatable(<<<'EOF' | ||
<?php new \Symfony\Component\Translation\TranslatableMessage(<<<'EOF' | ||
translatable-fqn nowdoc key | ||
EOF | ||
); ?> | ||
<?php new \Symfony\Component\Translation\Translatable( | ||
<?php new \Symfony\Component\Translation\TranslatableMessage( | ||
"translatable-fqn double-quoted key with whitespace and escaped \$\n\" sequences" | ||
); ?> | ||
<?php new \Symfony\Component\Translation\Translatable( | ||
<?php new \Symfony\Component\Translation\TranslatableMessage( | ||
'translatable-fqn single-quoted key with whitespace and nonescaped \$\n\' sequences' | ||
); ?> | ||
<?php new \Symfony\Component\Translation\Translatable(<<<EOF | ||
<?php new \Symfony\Component\Translation\TranslatableMessage(<<<EOF | ||
translatable-fqn heredoc key with whitespace and escaped \$\n sequences | ||
EOF | ||
); ?> | ||
<?php new \Symfony\Component\Translation\Translatable(<<<'EOF' | ||
<?php new \Symfony\Component\Translation\TranslatableMessage(<<<'EOF' | ||
translatable-fqn nowdoc key with whitespace and nonescaped \$\n sequences | ||
EOF | ||
); ?> | ||
|
||
<?php new \Symfony\Component\Translation\Translatable('translatable-fqn single-quoted key with "quote mark at the end"'); ?> | ||
<?php new \Symfony\Component\Translation\TranslatableMessage('translatable-fqn single-quoted key with "quote mark at the end"'); ?> | ||
|
||
<?php new \Symfony\Component\Translation\Translatable('translatable-fqn concatenated'.' message'.<<<EOF | ||
<?php new \Symfony\Component\Translation\TranslatableMessage('translatable-fqn concatenated'.' message'.<<<EOF | ||
with heredoc | ||
EOF | ||
.<<<'EOF' | ||
and nowdoc | ||
EOF | ||
); ?> | ||
|
||
<?php new \Symfony\Component\Translation\Translatable('translatable-fqn other-domain-test-no-params-short-array', [], 'not_messages'); ?> | ||
<?php new \Symfony\Component\Translation\TranslatableMessage('translatable-fqn other-domain-test-no-params-short-array', [], 'not_messages'); ?> | ||
|
||
<?php new \Symfony\Component\Translation\Translatable('translatable-fqn other-domain-test-no-params-long-array', [], 'not_messages'); ?> | ||
<?php new \Symfony\Component\Translation\TranslatableMessage('translatable-fqn other-domain-test-no-params-long-array', [], 'not_messages'); ?> | ||
|
||
<?php new \Symfony\Component\Translation\Translatable('translatable-fqn other-domain-test-params-short-array', ['foo' => 'bar'], 'not_messages'); ?> | ||
<?php new \Symfony\Component\Translation\TranslatableMessage('translatable-fqn other-domain-test-params-short-array', ['foo' => 'bar'], 'not_messages'); ?> | ||
|
||
<?php new \Symfony\Component\Translation\Translatable('translatable-fqn other-domain-test-params-long-array', ['foo' => 'bar'], 'not_messages'); ?> | ||
<?php new \Symfony\Component\Translation\TranslatableMessage('translatable-fqn other-domain-test-params-long-array', ['foo' => 'bar'], 'not_messages'); ?> | ||
|
||
<?php new \Symfony\Component\Translation\Translatable('translatable-fqn typecast', ['a' => (int) '123'], 'not_messages'); ?> | ||
<?php new \Symfony\Component\Translation\TranslatableMessage('translatable-fqn typecast', ['a' => (int) '123'], 'not_messages'); ?> | ||
|
||
<?php new \Symfony\Component\Translation\Translatable('translatable-fqn default domain', [], null); ?> | ||
<?php new \Symfony\Component\Translation\TranslatableMessage('translatable-fqn default domain', [], null); ?> |
32 changes: 16 additions & 16 deletions
32
src/Symfony/Component/Translation/Tests/fixtures/extractor/translatable.html.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
This template is used for translation message extraction tests | ||
<?php new Translatable('translatable single-quoted key'); ?> | ||
<?php new Translatable('translatable double-quoted key'); ?> | ||
<?php new Translatable(<<<EOF | ||
<?php new TranslatableMessage('translatable single-quoted key'); ?> | ||
<?php new TranslatableMessage('translatable double-quoted key'); ?> | ||
<?php new TranslatableMessage(<<<EOF | ||
translatable heredoc key | ||
EOF | ||
); ?> | ||
<?php new Translatable(<<<'EOF' | ||
<?php new TranslatableMessage(<<<'EOF' | ||
translatable nowdoc key | ||
EOF | ||
); ?> | ||
<?php new Translatable( | ||
<?php new TranslatableMessage( | ||
"translatable double-quoted key with whitespace and escaped \$\n\" sequences" | ||
); ?> | ||
<?php new Translatable( | ||
<?php new TranslatableMessage( | ||
'translatable single-quoted key with whitespace and nonescaped \$\n\' sequences' | ||
); ?> | ||
<?php new Translatable(<<<EOF | ||
<?php new TranslatableMessage(<<<EOF | ||
translatable heredoc key with whitespace and escaped \$\n sequences | ||
EOF | ||
); ?> | ||
<?php new Translatable(<<<'EOF' | ||
<?php new TranslatableMessage(<<<'EOF' | ||
translatable nowdoc key with whitespace and nonescaped \$\n sequences | ||
EOF | ||
); ?> | ||
|
||
<?php new Translatable('translatable single-quoted key with "quote mark at the end"'); ?> | ||
<?php new TranslatableMessage('translatable single-quoted key with "quote mark at the end"'); ?> | ||
|
||
<?php new Translatable('translatable concatenated'.' message'.<<<EOF | ||
<?php new TranslatableMessage('translatable concatenated'.' message'.<<<EOF | ||
with heredoc | ||
EOF | ||
.<<<'EOF' | ||
and nowdoc | ||
EOF | ||
); ?> | ||
|
||
<?php new Translatable('translatable other-domain-test-no-params-short-array', [], 'not_messages'); ?> | ||
<?php new TranslatableMessage('translatable other-domain-test-no-params-short-array', [], 'not_messages'); ?> | ||
|
||
<?php new Translatable('translatable other-domain-test-no-params-long-array', [], 'not_messages'); ?> | ||
<?php new TranslatableMessage('translatable other-domain-test-no-params-long-array', [], 'not_messages'); ?> | ||
|
||
<?php new Translatable('translatable other-domain-test-params-short-array', ['foo' => 'bar'], 'not_messages'); ?> | ||
<?php new TranslatableMessage('translatable other-domain-test-params-short-array', ['foo' => 'bar'], 'not_messages'); ?> | ||
|
||
<?php new Translatable('translatable other-domain-test-params-long-array', ['foo' => 'bar'], 'not_messages'); ?> | ||
<?php new TranslatableMessage('translatable other-domain-test-params-long-array', ['foo' => 'bar'], 'not_messages'); ?> | ||
|
||
<?php new Translatable('translatable typecast', ['a' => (int) '123'], 'not_messages'); ?> | ||
<?php new TranslatableMessage('translatable typecast', ['a' => (int) '123'], 'not_messages'); ?> | ||
|
||
<?php new Translatable('translatable default domain', [], null); ?> | ||
<?php new TranslatableMessage('translatable default domain', [], null); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters