Description
Symfony version(s) affected: 5.3.0-RC1
Description
The translation keys pushed to PoEditor translation provider with bin/console translation:push poeditor
are not the same as the ones pulled back using bin/console translation:pull poeditor --format yml
.
How to reproduce
Create a Symfony project and install symfony/translation
with symfony/po-editor-translation-provider
.
Configure a poeditor
provider and create 2 translation files for locales en
and cs
in the messages
domain.
Run bin/console translation:push poeditor
which pushes the translations to Po Editor as it should.
Run bin/console translation:pull poeditor --format yml
. The local translation file was updated:
I would expect that nothing should have happened because nothing was changed in Po Editor. Instead, it seems that the pull command uses the english translation as key when it reads data exported from Po Editor.
Possible Solution
I was able to fix the problem when I replaced this line:
$source = isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source;
with:
$source = $attributes['id'];
Additional context
In the Po Editor project settings, I have set English as the Default Reference Language.
I'm not sure if it's related to the issue but before I did that, the pull command would respond with these errors: