Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Diff line counts use Indian numeral grouping on en_IN locale (inconsistent toLocaleString calls)

Đang mở Phù hợp với người mới
#25,980 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu từ các lệnh gọi định dạng số lượng bổ sung và xóa trong apps/web/src/components/pullRequest/pullRequestPresentation.tsx, sau đó kiểm tra hai vị trí gọi liên quan trong apps/web/src/session-logic.ts. Tái hiện bằng LC_NUMERIC=en_IN và kiểm tra số dòng trong chế độ xem pull request. Hoàn tất khi cả ba đầu ra đều dùng cách phân nhóm hàng nghìn quốc tế, bất kể locale của máy chủ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

What happened

Diff stat line counts render with Indian numeral grouping. For example +3,81,102 lines instead of +381,102. The comma placement follows the Indian lakh system (3,81,102) rather than international thousands grouping (381,102). This shows on the + / - line-count chips in pull request views and in line-count summaries elsewhere in the web UI.

Diagnosis

Root cause: Number.prototype.toLocaleString() is called without a locale argument in several web UI call sites, so it falls back to the runtime's default locale derived from the environment. On this machine LC_NUMERIC=en_IN, which makes V8/Node use Indian grouping (lakhs).

Other call sites in the same codebase already pin the locale explicitly, showing the intended behavior:

  • apps/server/src/ws.ts:1485: ${completed.toLocaleString("en-US")}
  • packages/shared/src/usageFormat.ts:9: new Intl.NumberFormat("en-US")

Inconsistent / unpinned call sites found in source (tag 43nightly, matching the running server build):

  • apps/web/src/components/pullRequest/pullRequestPresentation.tsx:452-453: +{additions.toLocaleString()} / -{deletions.toLocaleString()}
  • apps/web/src/session-logic.ts:1186: ${lines.length.toLocaleString()} lines
  • apps/web/src/session-logic.ts:1201: ${totalFiles.toLocaleString()} file(s)

Passing "en-US" explicitly at these sites would make output independent of the host locale.

Steps to reproduce

  1. Run T3 Code with LC_NUMERIC=en_IN in the environment (as on this machine).
  2. Open a pull request with a non-trivial diff in the web UI.
  3. Observe the + / - line-count chips render as +3,81,102 instead of +381,102.

Version

0.1.3-nightly.20261024.3643 (server version recorded by the running process; triage CLI version is the same build)

Environment

Linux x64 (kernel 6.12.114), Node v26.12.1, LC_NUMERIC=en_IN (other LC_* categories also en_IN; LANG=en_US.UTF-8). Web UI surface connecting to local server at http://100.67.45.93:3773.

Evidence

Source references above, pulled from the cloned repo at the tag matching the running build. Machine facts from triage context: state dir /home/kk-spartans/.t3/userdata, server pid 1241.

Related issues

#15570 touches toLocaleString but for time formatting (12-hour clock); closed, not a duplicate.

Fix applied or workaround

None. No changes were made to the machine.

Filed by

OpenCode agent (model: nvidia/nemotron-3.5-super-vl) via t3 triage

Ngôn ngữ chính
TypeScript
Star
24.8k
Fork
6.4k
Merge trung bình
2 giờ 48 phút
Pull request đã merge (30 ngày)
353

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pingdotgg/t3code

Tất cả issue của pingdotgg/t3code

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.