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

VAT Info: Use string interpolation for tax names #75044

Merged
merged 5 commits into from
Apr 7, 2023

Conversation

sirbrillig
Copy link
Member

@sirbrillig sirbrillig commented Mar 28, 2023

Proposed Changes

This is a follow-up to #74538 which localized the "VAT" term in checkout. Because the name of VAT changes based on country, it would be better to use a localized term. In #73686 we modified the labels for the VAT form use use the more generic term "Business Tax", but this is still a little unclear.

In this PR we switch each of these labels to replace "Business Tax" with the selected country's term for VAT (eg: "GST", "CT", etc.) on the user-level VAT form.

NOTE: This can only localize once a country is selected... which means that the button to reach the form will always read "Add VAT details" before the user reaches the form. To resolve that case, we use the useGeoLocationQuery() hook to provide a fallback country.

This is part of https://github.com/Automattic/payments-shilling/issues/1475 and https://github.com/Automattic/payments-shilling/issues/1474

Screenshots

Screenshot 2023-03-28 at 1 10 40 PM

Screenshot 2023-03-28 at 2 12 32 PM

Screenshot 2023-03-28 at 1 11 02 PM

Screenshot 2023-03-28 at 1 11 09 PM

Screenshot 2023-03-28 at 2 12 24 PM

Testing Instructions

  • Visit /me/purchases/vat-details.
  • Select a country that uses the term "VAT" like the United Kingdom.
  • Verify that all the form labels use the word "VAT".
  • Select a country that uses a different term like Australia, which uses "GST".
  • Verify that all the form labels use the word "GST" (except for the title, which won't change until the details are saved).
  • Visit /me/purchases/billing and set your geolocation (eg: using a VPN) to somewhere that is in a country that does not use "VAT" (eg: Australia).
  • Verify that the button at the bottom reads "Add GST details".

@sirbrillig sirbrillig self-assigned this Mar 28, 2023
@github-actions
Copy link

github-actions bot commented Mar 28, 2023

@matticbot
Copy link
Contributor

matticbot commented Mar 28, 2023

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~388 bytes added 📈 [gzipped])

name            parsed_size           gzip_size
purchases           +1370 B  (+0.1%)     +388 B  (+0.1%)
site-purchases       +440 B  (+0.0%)     +108 B  (+0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@sirbrillig sirbrillig marked this pull request as ready for review March 28, 2023 18:14
@sirbrillig sirbrillig requested a review from a team as a code owner March 28, 2023 18:14
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Mar 28, 2023
@sirbrillig sirbrillig added the [Status] String Freeze Add the [Status] String Freeze label to your PR to ensure new strings are translated before merging label Mar 28, 2023
@a8ci18n
Copy link

a8ci18n commented Mar 28, 2023

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/7892983

Thank you @sirbrillig for including a screenshot in the description! This is really helpful for our translators.

@spraveenitpro spraveenitpro self-assigned this Mar 29, 2023
@spraveenitpro
Copy link
Contributor

Functional Testing:

Before Applying the patch:

oGC28F.png

After applying the patch - Great Britain

LUBqFg.png

After applying the patch - Australia

HyXxG7.png

After applying the patch with VPN pointing to Australia

Rh5eJg.png

Copy link
Contributor

@spraveenitpro spraveenitpro left a comment

Choose a reason for hiding this comment

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

LGTM, excellent implementation of useQuery TIL!

@a8ci18n
Copy link

a8ci18n commented Apr 7, 2023

Translation for this Pull Request has now been finished.

@sirbrillig sirbrillig force-pushed the update/use-local-vat-name-in-vat-info-page branch from 11f5717 to bf5c406 Compare April 7, 2023 16:30
@michaeldcain michaeldcain merged commit 69d32ec into trunk Apr 7, 2023
@michaeldcain michaeldcain deleted the update/use-local-vat-name-in-vat-info-page branch April 7, 2023 18:29
@github-actions github-actions bot removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Status] String Freeze Add the [Status] String Freeze label to your PR to ensure new strings are translated before merging labels Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants