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 Automattic/payments-shilling#1475 and Automattic/payments-shilling#1474
Screenshots
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”.
Unfortunately, no screenshots were provided by the developer.