Skip to content

fix(files): translate the upload counts, media load errors and loading text - #1379

Merged
agegr merged 2 commits into
agegr:mainfrom
Zhangs-11:fix/file-panel-i18n
Oct 29, 2026
Merged

agegr merged 2 commits into
agegr:mainfrom
Zhangs-11:fix/file-panel-i18n

Conversation

@Zhangs-11

@Zhangs-11 Zhangs-11 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

With the UI set to 简体中文 or 繁體中文, three places in the file panel stay English:

  • After an upload, the result counts' tooltips and labels read 2 uploaded, 1 skipped, 1 failed (components/FileExplorer.tsx).
  • When an image, audio or video preview cannot load, the panel shows Failed to load image / audio / video (components/FileViewer.tsx).
  • While the file tree loads, it shows Loading files... (components/FileExplorer.tsx), although the files.loading message with that text already exists in every language.

The rest of both panels is already translated (the upload buttons, the conflict prompt, Add all uploaded files to chat, …).

Reproduce on main

  1. Switch the UI to 简体中文.
  2. Upload two files to the project root from the Files toolbar, then hover the green count: 2 uploaded. Upload them again and pick 跳过已有文件: 2 skipped.
  3. Open a file named broken.png that is not really a PNG: Failed to load image.

Fix

  • Six new files.* messages in en, zh-CN and zh-TW, with {count} as a parameter as docs/i18n.md asks. The English strings are exactly the old ones.
  • The file tree's loading line uses the existing files.loading message.

Checks

  • npm test (2869 passed, 0 failed), node_modules/.bin/tsc --noEmit, npm run lint.
  • In headless Chrome with 简体中文: the broken image shows 图片加载失败, an upload of two files shows 已上传 2 个, and uploading them again with 跳过已有文件 shows 已跳过 2 个. The failed count uses the same code path; I did not trigger a failed upload locally. The loading line is only on screen for a moment and was checked in code.

🤖 Generated with Claude Code

Zhangs-11 and others added 2 commits October 21, 2026 16:21
The file panel's upload result counts ("2 uploaded", "1 skipped",
"1 failed") and the image, audio and video previews' load errors were
hard-coded English, so they stayed English in the Chinese UIs. They now
go through files.* messages in en, zh-CN and zh-TW; the English text is
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The file tree showed a hard-coded "Loading files..." although the
files.loading message with that text already exists in every language.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Zhangs-11 Zhangs-11 changed the title fix(files): translate the upload counts and media load errors fix(files): translate the upload counts, media load errors and loading text Oct 21, 2026
@agegr

agegr commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Thanks. I checked it: the English strings are unchanged, the six new keys are in all three languages with {count} as the parameter, and the zh-TW wording matches the existing 略過現有檔案. tsc, lint and tests pass, and it merges cleanly with #1378, #1382 and #1383 in any order.

@agegr
agegr merged commit 3aeba55 into agegr:main Oct 29, 2026
2 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