-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Translation] With Loco provider, push command replaces dots with hyphens #42395
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
This is the repo where error is reproduced: https://github.com/jmunozco/symfony_issue_42395 |
friendly ping @welcoMattic |
Thanks @OskarStark for the ping. It is a very strange behaviour this "transformation" from dot notation to hyphen notation in Loco, I use Loco in some real projects, and I've never see it. Thanks @jmunozco for the reproducer, I'll try to check it as soon as I can. |
When creating an asset, if ID is not specified, Loco auto-generates one from text. Thus, provide ID when creating asset. |
@vlad-ghita I think you've found the source of the problem, which is |
I'll try to find some time. |
If you can't, let me know I could later this week |
Well, I'm a bit busy honestly and I'm not familiar with PR process for Symfony ... If you can do it, I'd appreciate it. You could incorporate #43954 as well while at it. |
… reading (welcoMattic) This PR was merged into the 5.4 branch. Discussion ---------- [Loco] Fix Loco Provider ID and pull & push local messages reading | 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 #42395 & #43954 | License | MIT | Doc PR | It fixes Loco push new messages and avoiding Loco auto-generation of ID for each new messages (which use dash notation instead of dot notation IIRC). And it fixes also the Translation push & pull commands when they read local messages for multiple domains. Commits ------- 51ea9c8 Fix Loco Provider
Symfony version(s) affected: 5.3.6
Description
When uploading to Loco by using
push
command, it appears (in Loco dashboard) dots have been replaced by hyphens, aspush
command seems to do this replacement and then fails oncepull
is doneHow to reproduce
composer require symfony/translation
and Loco package bycomposer require symfony/loco-translation-provider
and add configuration for locales and domains intranslations.yaml
. Also create a project in Loco (localise.biz) and configure itsAPI_KEY
for read and write permissions and place it in.env
file (LOCO_DSN
)TranslatorInterface
to have at least one translatable keystring (with dots)debug/translation
to confirm there are missing strings (one in this case)symfony console translation:update en --force
to generate the local file undertranslations
foldertranslation:push
to upload to LocoAdditional context
In the controller we have this line:
$translated = $translator->trans('index.home.msg');
In the generated translations file under
/translations
folder we have these lines:And in Loco we have this capture:

The text was updated successfully, but these errors were encountered: