Comments (5)
Looks like there's a core javascript function we can use for this: Intl.NumberFormat()
– and we only need to know the currency of the number + locale code 👍 Seems well supported in browsers too.
from woocommerce-admin.
For context, JetPack uses i18n-calypso
Seems reasonable to use it here as well.
from woocommerce-admin.
Chatted a bit with @ryelle about this topic today, and she brought up an excellent point that is might be a good instance where we could potentially contribute something back to Gutenberg/Core. JavaScript i18n is still in development in core, and numberFormat
as you noted is missing right now.
So in lieu of taking the easy road by using i18n-calypso.numberFormat()
we could consider porting the logic ( which appears pretty simple ) to wp.i18n
.
Seems like the items needed can be groked from $wp_locale
. Counterpart wp core code can be seen here
from woocommerce-admin.
Did a quick look at gutenberg again today to see if there was any hidden features around this, and at least in the word count component, there is no i18n on numbers happening:
from woocommerce-admin.
Great find @ryelle - since we only need to support IE11 and > # I think this will work perfectly - going to close out this issue
from woocommerce-admin.
Related Issues (20)
- [GlobalStep - 3.3.0-beta 1] "Setup additional payment providers" is shown under "Things to do next" without setting up WC Pay on "Woocommerce > Home" page. HOT 2
- Untranslated dates in New Sales Record notice HOT 1
- Fix some race conditions in WCA Install
- Run run_on_woocommerce_admin_updated as a scheduled action
- Update all linting, testing, `@types/*` DevDependencies
- Woo Navigation: Home item displayed under extensions
- Make packages work with pnpm nx install {package}
- `WC_Tests_API_Reports_Import::test_cancel_import` failed with woocommerce 6.3.0
- Industry tab in setup wizard not clickable after going back
- PHP Fatal error when running `wc_admin_daily` job
- Change image references to woocommerce
- PHP Notice when the `Purchase` task is visible
- Core `API tests` failing
- `ERROR: unable to select packages` in `pnpm run test:php`
- Dependency Dashboard
- Additional payments task is shown when set up payments is displayed in main task list HOT 1
- create-wc-extension ES Module Errors HOT 1
- Replace the `date_created` column name with a class property in the analytics DataStore HOT 1
- With WooCommerce Payments multicurrency functionality, numbers in the Revenue tab can be incorrect HOT 1
- Dependency on unsupported version of pnpm HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from woocommerce-admin.