i18n: Internalise legacy CURRENCIES object from @automattic/format-currency#42457
i18n: Internalise legacy CURRENCIES object from @automattic/format-currency#42457chriskmnds wants to merge 7 commits intotrunkfrom
@automattic/format-currency#42457Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
@automattic/format-currency
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 1 file.
|
fc1c99b to
df63435
Compare
2453adb to
1d33313
Compare
1d33313 to
74ff52f
Compare
projects/plugins/jetpack/changelog/update-i18n-internalize-currencies-object
Outdated
Show resolved
Hide resolved
projects/js-packages/components/changelog/update-i18n-internalize-currencies-object
Outdated
Show resolved
Hide resolved
…ize-currencies-object
projects/plugins/jetpack/changelog/update-i18n-internalize-currencies-object
Outdated
Show resolved
Hide resolved
|
|
||
| /** | ||
| * Currency data for formatting currencies. | ||
| * This is an internalized version of the CURRENCIES object previously imported from format-currency. |
There was a problem hiding this comment.
Can you add a note that reads something like:
IMPORTANT: currency formatting is dependent on locale, not on currency code, so using `grouping` and `decimal` here will provide inaccurate results. Please use `@automattic/number-formatters` package for formatting.
There was a problem hiding this comment.
Thanks @sirbrillig ! Certainly. I need to rebase here, and it might be the case we no longer need this variable if #43418 suffices to migrate the donations block straight into using @automattic/number-formatters (without the separate currency symbol rendering). I still need to test that, so will return here once done.
|
Moving this back to draft - will return here once #43418 is ready 🙇 |
|
This PR has been marked as stale. This happened because:
If this PR is still useful, please do a [trunk merge or rebase](https://github.com/Automattic/jetpack/blob/trunk/docs/git-workflow.md#keeping-your-branch-up-to-date) and otherwise make sure it's up to date and has clear testing instructions. You may also want to ping possible reviewers in case they've forgotten about it. Please close this PR if you think it's not valid anymore — if you do, please add a brief explanation. If the PR is not updated (or at least commented on) in another month, it will be automatically closed. |
|
This PR has been automatically closed as it has not been updated in some time. If you want to resume work on the PR, feel free to restore the branch and reopen the PR. |
Part of a PT: pxLjZ-9ME-p2
Partly addresses https://github.com/Automattic/i18n-issues/issues/939 and https://github.com/Automattic/i18n-issues/issues/942
Based off #42456
Proposed changes:
Before we can consolidate number and currency formatting in Jetpack we need to bring
@automattic/format-currencyto the latest version (2.0.0). We internalise some of the legacy functionality that's no longer present informat-currencyso we upgrade.Fixing these cases (to remove the legacy code completely) can be done separately by folks more familiar with these components. Our goal is primarily to bring the latest version into JP, then replace it with our unified number-formatters component.
Update/Latest:
@automattic/format-currencyis no longer in use anywhere within JP by now, so internalising these methods, albeit not the grand solution, is at least a step in the right direction (to allow us to deprecate@automattic/format-currencycompletely - remove it from the wp-calypso monorepo). All code has migrated to@automattic/number-formattersat this point. This is just a follow-up on #42456Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
getCurrencyDefaultsmethod from@automattic/format-currency#42456