-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Translation] %parameters% are not replaced when file is first dumped as +intl-icu
and then read
#35328
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
Comments
+intl-icu
and then read+intl-icu
and then read
Hi @ruudk, I'll check your reproducer at some point this week. Thank you for opening this issue. |
@yceruto I came here through #35264 because we are experiencing a similar issue. I wonder if this issue is really a bug though. The ICU message format is a different format than Symfony's one. Where Symfony's format uses percentage signs for placeholders ( Having said that, I do believe that #34797 that was released with Symfony 4.4.2 and 5.0.2 is a breaking change for use cases where translation files are created that don't exist yet. In our situation, we use https://github.com/php-translation/symfony-bundle to download translations from Loco and dump them to (gitignored) XLIFF files during our build process. Using symfony/translation v4.4.1, the files dumped are So the assumption in #34797 is that the translation files already exist and the decision between intl-icu or the "old" format is based entirely on the existance of those files. Whenever that is not the case (for example when using https://github.com/php-translation/symfony-bundle to download translations from an external source, adding a new language, etc.), this breaks with the previous behaviour in v4.4.1. I'm not sure if this issue is the right place for what I just wrote, let me know if I should move it to #35264 or should create a new issue. |
@nicwortel I can confirm what you said. Let's revert #34797 in the meantime. see #35351 |
Let's close because we can do nothing here. Thank you @ruudk and @nicwortel. |
I'm having exactly the same issue as @nicwortel |
…fix #34713 (yceruto) This PR was squashed before being merged into the 4.4 branch. Discussion ---------- Revert #34797 "Fixed translations file dumper behavior" and fix #34713 | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #35264 | License | MIT | Doc PR | - Revert #34797 See also #35328 It's very likely that the new way will be completely different from this one that is being reverted. That's why I'm reverting rather than fixing it. Commits ------- 9ca8720 Fixed #34713 Move new messages to intl domain when possible 56e79fe Revert "Fixed translations file dumper behavior"
…d fix #34713 (yceruto) This PR was squashed before being merged into the 4.4 branch. Discussion ---------- Revert #34797 "Fixed translations file dumper behavior" and fix #34713 | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #35264 | License | MIT | Doc PR | - Revert symfony/symfony#34797 See also symfony/symfony#35328 It's very likely that the new way will be completely different from this one that is being reverted. That's why I'm reverting rather than fixing it. Commits ------- 9ca872054b Fixed #34713 Move new messages to intl domain when possible 56e79fefa1 Revert "Fixed translations file dumper behavior"
I tried and searched for more than 1.5 hours to find this.. It was really a pain not knowing why it did not work. At least an error would be cool. @ruudk Can you reopen this issue? |
Why? This has been fixed with another release. |
@ruudk Ah, I didn't know. How could I have seen this on my own? |
No worries. This PR reverted the broken behaviour: #35351 |
As of 2023 this is still an issue. On a new project. |
Oh my. I'm having a headache for some minutes/hours. Removing
However, this looks more like an issue of the documentation that is highlighting |
Symfony version(s) affected: 4.4
Description
We have a FileDumper that converts
messages.en.yml
tomessages.en.php
files. Since 4.4 this file becamemessage+intl-icu.en.php
with the same content.Upon reading these
+incl-icu.php
files, the%placeholder%
are no longer replaced with the correct value.Spoke with @yceruto in #35264 (comment) and he suggested this is a different issue.
How to reproduce
See commits on https://github.com/ruudk/symfony-translation-bug-poc/commits/master
Possible Solution
The FileDumper should not just add
+intl-icu
to files.The text was updated successfully, but these errors were encountered: