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

Fix paid requests localization #38946

Merged
merged 4 commits into from
Aug 27, 2024
Merged

Fix paid requests localization #38946

merged 4 commits into from
Aug 27, 2024

Conversation

d-alleyne
Copy link
Contributor

Fixes Automattic/i18n-issues#853

Proposed changes:

  • Updates the Jetpack Search features table to use the user's locale for number formatting.
  • This change replaces hardcoded 'en-US' locales with the user's locale for better internationalization support.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

Does this pull request change what data or activity we track or use?

Testing instructions:

  1. Check out the branch with the changes.
  2. Set the user's locale to Japanese.
  3. Navigate to the Jetpack Search screen (/wp-admin/admin.php?page=jetpack-search) and view the Features table.
  4. Verify that the number of records and requests is correctly formatted based on the user's locale. Specifically, 1万 is present.

@github-actions github-actions bot added the [Package] Search Contains core Search functionality for Jetpack and Search plugins label Aug 19, 2024
Copy link
Contributor

github-actions bot commented Aug 19, 2024

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Choose a review path based on your changes:
    • A. Team Review: add the "[Status] Needs Team Review" label
      • For most changes, including minor cross-team impacts.
      • Example: Updating a team-specific component or a small change to a shared library.
    • B. Crew Review: add the "[Status] Needs Review" label
      • For significant changes to core functionality.
      • Example: Major updates to a shared library or complex features.
    • C. Both: Start with Team, then request Crew
      • For complex changes or when you need extra confidence.
      • Example: Refactor affecting multiple systems.
  3. Get at least one approval before merging.

Still unsure? Reach out in #jetpack-developers for guidance!

@github-actions github-actions bot added the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Aug 19, 2024
Copy link
Contributor

github-actions bot commented Aug 19, 2024

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WordPress.com Simple site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin, and enable the fix/paid-requests-localization branch.

  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack fix/paid-requests-localization
    

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@d-alleyne d-alleyne force-pushed the fix/paid-requests-localization branch 3 times, most recently from e9cbb3b to 513bcb5 Compare August 21, 2024 19:07
@d-alleyne d-alleyne changed the title WIP: Fix paid requests localization Fix paid requests localization Aug 21, 2024
kangzj
kangzj previously approved these changes Aug 22, 2024
Copy link
Contributor

@kangzj kangzj left a comment

Choose a reason for hiding this comment

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

It tests well for self hosted!

Jetpack Search dashboard fails to load on trunk for Atomic. For awareness @ice9js @jeherve. I had a look - the assets don't seem to be loaded 🤔

More info: p1724102580150579-slack-C02ME06LF

jsnmoon
jsnmoon previously approved these changes Aug 22, 2024
Copy link
Member

@jsnmoon jsnmoon left a comment

Choose a reason for hiding this comment

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

These changes appear reasonable and work well on my self-hosted, simple, and atomic test sites:

image
Self-hosted

image
Simple

image
Atomic

Testing on Atomic was interesting. Currently, it's only possible to move a Dotcom site to the Atomic infra by purchasing a Business plan (which includes Jetpack Search classic), changing the host to wpcomstaging.com (via plugin install or hosting config panel), and then manually removing the business upgrade from the site.

@@ -155,7 +156,7 @@ const OldPricingComponent = ( { sendToCart } ) => {

Copy link
Member

Choose a reason for hiding this comment

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

We appear to internationalize number formatting in two ways in this file:

  1. Using Intl.NumberFormat as shown in this PR.
  2. Using __ as shown in line 313: __( '5k records', 'jetpack-search-pkg' ).

We should simplify this and use a single internationalization approach in a future PR.

@d-alleyne d-alleyne removed [Status] In Progress [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Aug 25, 2024
@d-alleyne d-alleyne dismissed stale reviews from jsnmoon and kangzj via 9836822 August 26, 2024 21:29
@d-alleyne d-alleyne force-pushed the fix/paid-requests-localization branch from 9836822 to e0ceb06 Compare August 27, 2024 13:58
@d-alleyne d-alleyne requested a review from jsnmoon August 27, 2024 14:55
jsnmoon
jsnmoon previously approved these changes Aug 27, 2024
@jsnmoon jsnmoon enabled auto-merge (squash) August 27, 2024 18:17
@jsnmoon jsnmoon force-pushed the fix/paid-requests-localization branch from 3773907 to 8aeb067 Compare August 27, 2024 18:32
@jsnmoon jsnmoon merged commit 5f324e9 into trunk Aug 27, 2024
59 checks passed
@jsnmoon jsnmoon deleted the fix/paid-requests-localization branch August 27, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Search Contains core Search functionality for Jetpack and Search plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants