-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Translation][Loco] Loco Provider pull keys with hyphen notation instead of dot notation #43976
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
Labels
Comments
The only thing I would do is to use a different separator than |
Of course, it can be |
Let's use |
fabpot
added a commit
that referenced
this issue
Nov 16, 2021
…ing Loco do it (welcoMattic) This PR was merged into the 5.3 branch. Discussion ---------- [Translation] [Loco] Generate id parameter instead of letting Loco do it | Q | A | ------------- | --- | Branch? | 5.3 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #43976 | License | MIT | Doc PR | With this PR we get rid of the auto generated id from Loco (which generate id with dash notation). The counterpart is that we have to iterate over the fetched catalogues to transform the received translation keys, I'm not 100% sure about the performance impact on very large catalogues. Commits ------- 1a44526 Fix Loco Provider
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Symfony version(s) affected
5.3
Description
Following #43967, it seems that the bug is more serious than expected.
I seem to have inadvertently used a deprecated feature of the Loco API. As we were using it in php-translation loco adapter I haven't checked if it was already ok to use it.
The result is that now, we must pass globally unique id for each translation to Loco. The problem is that translation keys are unique by domain in Symfony.
How to reproduce
See #42395 (comment)
Possible Solution
One possible solution is to set id like:
And at the fetch time, iterate over all received messages, substract
$domain . '_'
from the id to set the right key:It could break something like the batch creation of assets (because local keys are not equals to the Loco ids now), but I think we can solve it.
Additional Context
this bug seems to not happen on Loco projects with an asset alias named
name
, which is the old and deprecated name oftext
parameter. It seems the value ofname
is auto generated by Loco with dot notation.The text was updated successfully, but these errors were encountered: