8000 Update Transifex to use new SDK & improve code for M4 by escopecz · Pull Request #11758 · mautic/mautic · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update Transifex to use new SDK & improve code for M4 #11758

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

Merged
merged 18 commits into from
Nov 30, 2022

Conversation

escopecz
Copy link
Member
@escopecz escopecz commented Nov 29, 2022

This is duplicate of #11724

Q A
Bug fix? (use the a.b branch) [ ]
New feature/enhancement? (use the a.x branch) [ ]
Deprecations? [ ]
BC breaks? (use the c.x branch) [ ]
Automated tests included? [ ]
Related user documentation PR URL mautic/mautic-documentation#...
Related developer documentation PR URL mautic/developer-documentation#...
Issue(s) addressed Fixes #...

Description:

This PR implements new Transifex SDK version:

mautic/Transifex-API#4

And improves the code related to pushing and pulling translations.

The API version we use today will stop work at the end of the month!

The old mautic:transifex:push used to only update resources. It never created the new ones. It had a --create option for that. The new command checks whether the resource exists and decides whether it needs to create or update it. So it may happen that once we run the new command for the first time we'll get a bunch of new resources created.

Steps to test this PR:

  1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs here) You must have admin access to the mautic/mautic Transifex project, so skip testing this if you don't.
  2. Generate new API key: https://developers.transifex.com/reference/api-authentication
  3. Store it in app/config/local.php under key transifex_api_token
  4. Test the bin/console mautic:transifex:pull command. It should download all translations that are translated from at least 80%. This constraint is checked for every file. Not by language. Check that files in the translations directory are being updated or created based on if the file existed before or not. Feel free to use the --language and --bundle filters to test for only certain languages or bundles.
  5. bin/console mautic:transifex:push command. ⚠️ this is going to push to the production Transifex project! so possibly use the --bundle option to push only files for one bundle in case this I made a mistake somewhere. Then check in the Transifex UI that the resource is still translatable.

@cla-bot cla-bot bot added the cla-signed The PR contributors have signed the contributors agreement label Nov 29, 2022
@escopecz escopecz force-pushed the TPROD-346-transifex-m4 branch from 777af4d to ce039a3 Compare November 29, 2022 15:54
@codecov
Copy link
codecov bot commented Nov 29, 2022

Codecov Report

Merging #11758 (ce039a3) into 4.4 (56e6980) will increase coverage by 0.10%.
The diff coverage is 84.61%.

Impacted file tree graph

@@             Coverage Diff              @@
##                4.4   #11758      +/-   ##
============================================
+ Coverage     49.97%   50.07%   +0.10%     
+ Complexity    35424    35418       -6     
============================================
  Files          2145     2145              
  Lines        106358   106348      -10     
============================================
+ Hits          53153    53256     +103     
+ Misses        53205    53092     -113     
Impacted Files Coverage Δ
...undles/CoreBundle/Command/PushTransifexCommand.php 80.39% <77.50%> (+64.26%) ⬆️
...undles/CoreBundle/Command/PullTransifexCommand.php 79.03% <84.44%> (+67.92%) ⬆️
app/bundles/CoreBundle/Helper/LanguageHelper.php 68.30% <87.09%> (+5.70%) ⬆️
...pp/bundles/CoreBundle/Factory/TransifexFactory.php 100.00% <100.00%> (ø)
app/bundles/CoreBundle/Helper/UrlHelper.php 66.92% <100.00%> (+1.92%) ⬆️
...dle/Integration/Pipedrive/Export/CompanyExport.php 72.60% <0.00%> (-1.37%) ⬇️
...s/PluginBundle/Integration/AbstractIntegration.php 34.95% <0.00%> (+0.43%) ⬆️
...Bundle/Integration/Pipedrive/Export/LeadExport.php 79.56% <0.00%> (+3.22%) ⬆️

Copy link
Member
@RCheesley RCheesley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great for both pulling (with DE language) and pushing (with Webhooks bundle).

@RCheesley RCheesley added bug Issues or PR's relating to bugs translations Anything related to translations essential This must be done to close the milestone labels Nov 30, 2022
@RCheesley RCheesley added this to the 4.4.5 milestone Nov 30, 2022
@RCheesley RCheesley added the ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged label Nov 30, 2022
@RCheesley RCheesley merged commit 81257b7 into mautic:4.4 Nov 30, 2022
@escopecz escopecz deleted the TPROD-346-transifex-m4 branch November 30, 2022 11:23
@RCheesley RCheesley changed the title Tprod 346 transifex for M4 Update Transifex to use new SDK & improve code for M4 Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues or PR's relating to bugs cla-signed The PR contributors have signed the contributors agreement essential This must be done to close the milestone ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged translations Anything related to translations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0