Skip to content
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

Closes #11: handle translations #12

Merged
merged 11 commits into from
Nov 28, 2024
Merged

Conversation

jeawhanlee
Copy link
Collaborator

Description

This PR adds a post install composer script to apply appropriate text domain during package install/update.

Fixes #11
Fixes translation issue with this package on plugins.

Type of change

  • Bug fix (non-breaking change which fixes an issue).
  • Enhancement (non-breaking change which improves an existing functionality).

Detailed scenario

Currently present on the latest stable.

Technical description

Documentation

Created a script to update the model data with the correct text domain gotten from the plugin composer config during package installation/update.

New dependencies

N/A

Risks

N/A

Mandatory Checklist

Code validation

  • I validated all the Acceptance Criteria. If possible, provide screenshots or videos.
  • I triggered all changed lines of code at least once without new errors/warnings/notices.

Code style

  • I wrote a self-explanatory code about what it does.
  • I protected entry points against unexpected inputs.
  • I did not introduce unnecessary complexity.
  • Output messages (errors, notices, logs) are explicit enough for users to understand the issue and are actionnable.

Unticked items justification

If some mandatory items are not relevant, explain why in this section.

Additional Checks

  • In the case of complex code, I wrote comments to explain it.
  • I added error handling logic when using functions that could throw errors (HTTP/API request, filesystem, etc.)

@jeawhanlee jeawhanlee linked an issue Nov 27, 2024 that may be closed by this pull request
@jeawhanlee jeawhanlee requested a review from a team November 27, 2024 14:07
@jeawhanlee jeawhanlee self-assigned this Nov 27, 2024
@jeawhanlee jeawhanlee added bug Something isn't working enhancement New feature or request labels Nov 27, 2024
@jeawhanlee
Copy link
Collaborator Author

As a follow-up we'll need to update the composer.json file for WP Rocket & Imagify to be compatible with these changes.

src/PostInstall.php Show resolved Hide resolved
Copy link

@wordpressfan wordpressfan left a comment

Choose a reason for hiding this comment

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

It works with me perfectly with both composer install and composer update.

I really was trying to include post-install-cmd and post-update-cmd inside the plugin family composer.json but for a security reason it didn't work and it needs to be inside the rocket composer file for example, I tried this to make the process easier because this will be integrated in multiple plugins.

The only remaining thing here is to document that in notion, can u plz create a document mentioning the steps to require this plugin family package in any plugin?

@Mai-Saad
Copy link

Mai-Saad commented Nov 28, 2024

@wp-media/engineering-plugin-team This one can be Test by dev: adding screenshot of the plugins view on WPR / imagify for FR translation (please check with product what other translation is there to be checked)

@jeawhanlee jeawhanlee merged commit 67e1323 into develop Nov 28, 2024
7 checks passed
@jeawhanlee jeawhanlee mentioned this pull request Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle translations
4 participants