Commit 8e2eaad
committed
bug #48833 [Translation] Handle the translation of empty strings (javiereguiluz)
This PR was squashed before being merged into the 5.4 branch.
Discussion
----------
[Translation] Handle the translation of empty strings
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
In some apps, you might use an expression as the value of some `TranslatableMessage` object. The result of this expression can result in using an empty string as the value of the that object:
```php
new TranslatableMessage($someCondition ? $someObject->someMethod() : '')
```
The issue is that Symfony will report that empty string in the list of "missing translations" (like in the first row of this image):

I think this is a bug and an empty string should just be output "as is" without reporting it as missing.
What do you think? Is this truly a bug? Would it be a new feature for 6.3? The current behavior is correct and we should close without merging? Thanks.
Commits
-------
f19557953a [Translation] Handle the translation of empty stringsFile tree
2 files changed
+5
-0
lines changed- Extension
- Tests/Extension
2 files changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| |||
0 commit comments