Skip to content

fix(i18n): missing number formatting#2158

Merged
ghostdevv merged 2 commits intonpmx-dev:mainfrom
DDeenis:fix/number-formatting
Mar 20, 2026
Merged

fix(i18n): missing number formatting#2158
ghostdevv merged 2 commits intonpmx-dev:mainfrom
DDeenis:fix/number-formatting

Conversation

@DDeenis
Copy link
Contributor

@DDeenis DDeenis commented Mar 19, 2026

🔗 Linked issue

🧭 Context

Was testing the site in different languages, and noticed that some numbers are not locale formatted
Unformatted numbers found in: packages table view, pagination

📚 Description

Updated components to use the $n function for formatting numbers, as well as previously built compact numbers formatter

@vercel
Copy link

vercel bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Mar 19, 2026 11:04pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Mar 19, 2026 11:04pm
npmx-lunaria Ignored Ignored Mar 19, 2026 11:04pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6aaa0dbc-497d-456a-9170-5e79b14de6c8

📥 Commits

Reviewing files that changed from the base of the PR and between 44e5ed4 and 848aedf.

📒 Files selected for processing (1)
  • app/components/Package/TableRow.vue

📝 Walkthrough

Walkthrough

Updated number localisation and formatting in three files. In app/components/Package/TableRow.vue the component-local formatDownloads was removed; the template now shows '-' when result.downloads?.weekly is undefined and otherwise uses compactNumberFormatter.format(...) obtained from useCompactNumberFormatter(). In app/components/PaginationControls.vue page-size option labels and rendered page numbers now use the $n() number formatter. In app/pages/search.vue the pageSize argument passed to the filters.count.showing_paginated translation is wrapped with $n(...).

Suggested reviewers

  • danielroe
  • serhalp
  • userquin
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly relates to the changeset, explaining the context of missing number formatting and describing the updates to use locale-aware number formatting functions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can customize the high-level summary generated by CodeRabbit.

Configure the reviews.high_level_summary_instructions setting to provide custom instructions for generating the high-level summary.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/pages/search.vue (1)

604-611: ⚠️ Potential issue | 🟡 Minor

Inconsistent formatting in live region message.

The screen reader live region at lines 604–611 still uses pSize.toString() for the pageSize parameter, while line 812 now uses $n(). For consistency and correct localisation in assistive technologies, this should also use $n().

🔧 Proposed fix
       return $t(
         'filters.count.showing_paginated',
         {
-          pageSize: pSize.toString(),
+          pageSize: $n(pSize),
           count: $n(effectiveTotal.value),
         },
         effectiveTotal.value,
       )

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d4531756-e379-4162-b665-994eb452e3ca

📥 Commits

Reviewing files that changed from the base of the PR and between 230b7c7 and 44e5ed4.

📒 Files selected for processing (3)
  • app/components/Package/TableRow.vue
  • app/components/PaginationControls.vue
  • app/pages/search.vue

@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/components/PaginationControls.vue 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@ghostdevv ghostdevv added this pull request to the merge queue Mar 20, 2026
Merged via the queue into npmx-dev:main with commit 62a9db0 Mar 20, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants