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

Overwrite Persian numbering for StatsBoxes #5911

Merged
merged 4 commits into from
Apr 14, 2022
Merged

Conversation

minimalsm
Copy link
Contributor

@minimalsm minimalsm commented Apr 5, 2022

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.

  • Updates homepage StatsBox
  • Updates layer-2 page StatsBox

Additional context

  • We should do the same for our staking pages

Preview

Related Issue

#5490 #5748

@gatsby-cloud
Copy link

gatsby-cloud bot commented Apr 5, 2022

Gatsby Cloud Build Report

ethereum-org-website-dev

🎉 Your build was successful! See the Deploy preview here.

Build Details

View the build logs here.

🕐 Build time: 16m

Performance

Lighthouse report

Metric Score
Performance 🔶 23
Accessibility 💚 100
Best Practices 💚 100
SEO 🔶 85

🔗 View full report

@@ -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) => {
Copy link
Contributor

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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.

@github-actions github-actions bot added the translation 🌍 This is related to our Translation Program label Apr 5, 2022
@minimalsm minimalsm merged commit 92d8a9f into dev Apr 14, 2022
@minimalsm minimalsm deleted the overwritePersianNumbers branch April 14, 2022 15:57
@wackerow wackerow mentioned this pull request Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content 🖋️ This involves copy additions or edits translation 🌍 This is related to our Translation Program
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants