-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
PoEditor translation provider pulls wrong translation keys #41374
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
cc @welcoMattic |
It remembers me an edge case that I've meet during the development. I will check on it tomorrow, in order to fix it before the final release of 5.3. AFAIK, I've fixed it by changing the reference language in PoEditor settings of the projet. I will double check it. |
I've quickly checked the problem, it looks like we have to handle language creation from the Provider, like it's done in Lokalise provider. I'll try to do it by the end of the week, unless @majermi4 wants to open a PR 😉 |
@welcoMattic: I can have a look on the weekend and see if I can figure something out :) but can't promise anything
I'm not sure I get what you mean and how this is related 🤔 The main problem is that the keys pulled from PoEditor provider are indexed by the english (or whatever the main language is) translation instead of the keys that were pushed to PoEditor. |
I see 2 problems: 1: If you have no languages in PoEditor Project, you can not push anything. Event if you have 1 language, which if the default reference language, you can not push other languages.
This code fixes the problem, but it breaks many other things.
I'll try to figure it out tomorrow and this weekend. @majermi4 if you are on the Symfony Devs Slack, we can talk about this issue there. |
I sent an email to the PoEditor support, because I understood that the export files in XLIFF from PoEditor do not include the I will try to make them add the |
I contacted PoEditor and asked them to add the missing I guess we'll have to wait for PoEditor to fix the problem, and follow the XLIFF 1.2 specification correctly, by adding the I also tried to work around the problem by changing the exchange format between the Provider and the SaaS, I tried YML, CSV, INI, but none of them brings a satisfactory result. Another solution would be to parse the XLIFF before loading it as a Catalog, create the @Nyholm @nicolas-grekas @OskarStark @fabpot should we have to remove the PoEditor Provider from the 5.3 as it is not fully functional due to the lack of support of the resname attribute? |
I think we should remove support if it does not work. |
I also vote for removing the PoEditor provider from 5.3. We can revisit it for 5.4 if poeditor fixes their XLIFF in the meantime (which gives them 6 months) |
This PR was merged into the 5.3 branch. Discussion ---------- [Translation] Remove PoEditor Provider | 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 #41374 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | As it has been discussed in #41374, we have to remove the support of PoEditor as Translation Provider. The `translation:pull` command do not work as expected with PoEditor, translations keys are not retrieved as they do. I contacted PoEditor support in order to fix the bug (it miss the `resname` attribute of `trans-unit` tag in their XLIFF 1.2 export files). I will follow up their change in the next coming weeks/months, and I hope we could re-add the PoEditor Provider in Symfony for 5.4/6.0. Commits ------- b2ea42e Remove PoEditor Provider
This PR was submitted for the 5.4 branch but it was merged into the 5.3 branch instead. Discussion ---------- [Translation] Remove PoEditor Provider Following up to symfony/symfony#41374, we have to remove the PoEditor support until their XLIFF export file are fixed. Commits ------- 3a35658 Remove PoEditor Provider
@welcoMattic Any luck with getting POEditor to fix the export? I tried a manual export today and it doesn't look any better. Just wondering what I should be asking POEditor support what to fix, i.e. if you have an existing case we can reference to encourage them to get it fixed? |
@timwhite I've just checked my last email exchanges with POeditor in september 2021, and they told me that they were about to add the support of the missing attribute very soon. I didn't checked since. Can you open a new issue about adding POEditor Provider? Referencing this one, then we will discuss there. Thanks |
Hi, I tried to upload a Symfony generated xliff to POeditor for <trans-unit id="1UmtMTs" resname="last_price_of_day">
<source>last_price_of_day</source>
<target>Last Price of the Day</target>
</trans-unit> Does it mean that POeditor fixed the problem? Or did I misunderstand the problem? |
@NovakHonza please create a new issue instead of commenting on a PR merged 3 years ago that nobody looks at (I saw your comment with a 3 month delay, and totally by luck) |
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 usingbin/console translation:pull poeditor --format yml
.How to reproduce
Create a Symfony project and install
symfony/translation
withsymfony/po-editor-translation-provider
.Configure a
poeditor
provider and create 2 translation files for localesen
andcs
in themessages
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:
The text was updated successfully, but these errors were encountered: