-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Overwrite Persian numbering for StatsBoxes #5911
Conversation
Gatsby Cloud Build Reportethereum-org-website-dev 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 16m PerformanceLighthouse report
|
src/utils/formatLocaleNumbers.js
Outdated
@@ -0,0 +1,9 @@ | |||
// Overwrites the default Persian numbering of the Farsi language to use Hindu-Arabic numerals (0-9) | |||
// Context: https://github.com/ethereum/ethereum-org-website/pull/5490#pullrequestreview-892596553 | |||
export const formatLocaleNumbers = (locale) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not opposed to a new file but we do have an existing translations.js
utils file that I feel like this function could fit within, given it deals with language formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also given I'm already nitpicking 😅 I think the name could be a bit clearer - it's slightly misleading since this function doesn't actually format anything. Maybe something like getLocaleNumberFormat
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not opposed to a new file but we do have an existing
translations.js
utils file that I feel like this function could fit within, given it deals with language formatting.
Good point. Moved it in there.
Also given I'm already nitpicking 😅 I think the name could be a bit clearer - it's slightly misleading since this function doesn't actually format anything. Maybe something like getLocaleNumberFormat?
Not nitpicking at all it was a bad name 😬 updated it to getLocaleForNumberFormat
.
Description
Context: As noted in #5490, we were mixing Persian and Hindu-Arabic numerals. After consulting Farsi speakers, we realised this was undesirable.
This PR overwrites the number formatting of the Farsi language on our StatsBox components to use Hindu-Arabic formatting.
Additional context
Preview
Related Issue
#5490 #5748