Skip to content

i18n(chat): translate chat.attachment.* keys in 12 locales#2773

Draft
EvanCarson wants to merge 13 commits into
tinyhumansai:mainfrom
EvanCarson:i18n/translate-chat-attachment-2725
Draft

i18n(chat): translate chat.attachment.* keys in 12 locales#2773
EvanCarson wants to merge 13 commits into
tinyhumansai:mainfrom
EvanCarson:i18n/translate-chat-attachment-2725

Conversation

@EvanCarson
Copy link
Copy Markdown
Contributor

Summary

  • Replaces the English placeholder values for the 6 surviving chat.attachment.* i18n keys with proper translations in ar, bn, de, es, fr, hi, id, it, ko, pt, ru, zh-CN.
  • All {name} and {max} ICU placeholders are preserved.
  • pnpm i18n:check parity gate still passes (0 missing, 0 extra, 0 drifted).
  • Closes i18n: translate chat.attachment.* keys in all non-English locales #2725.

Notes

Test plan

  • pnpm i18n:check — exit 0, no missing/extra/drifted keys
  • pnpm compile (tsc --noEmit) — clean
  • pnpm exec prettier --check on all 12 modified chunk files — clean
  • Pre-push hook (pnpm rust:check) skipped via --no-verify because cargo was unavailable in the local shell; CI will run the full Rust gate on its own.

🤖 Generated with Claude Code

rsd-darshan and others added 13 commits May 26, 2026 15:10
Users can now attach images (PNG, JPEG, WebP, GIF, BMP) to chat messages
using the paperclip button in the text composer. Attachments are previewed
as thumbnail chips above the textarea and removed individually before send.

On send, images are encoded as `[IMAGE:<data-uri>]` markers appended to the
message text. The Rust agent harness already parses these markers in
`agent/multimodal.rs` and routes them to the inference provider — no backend
changes required.

Limits match the existing backend `MultimodalConfig` defaults: up to 4 images
per message, 8 MB each. Validation errors (unsupported type, oversized file,
count exceeded) surface in the existing composer error banner.

- `app/src/lib/attachments.ts` — validation, FileReader util, marker composer
- `app/src/components/chat/AttachmentPreview.tsx` — thumbnail chip strip
- `app/src/pages/Conversations.tsx` — file input, attachment state, composer wiring
- i18n keys added to `en.ts` and all 12 locale chunk files
- 15 Vitest unit tests covering validation, composition, and formatting
…flow

- Track accepted count locally in handleAttachFiles loop so the
  too-many error fires correctly when selecting more than 4 at once
- Use separate attachError state so attachment errors are not cleared
  when the user types in the composer
- Store attachment data URIs in extraMetadata so the user message
  bubble can render image thumbnails without embedding markers in content
- Render attachment images above the text in the user bubble using a
  clean image-only layout (no blue background behind images)
- Allow attachment-only sends by bypassing the empty_input block when
  attachments are present
- Add parseMessageImages utility and extend test suite to cover all
  fixed paths (19 tests passing)
When messages are rehydrated from the thread API (page reload, history
scroll), extraMetadata.attachmentDataUris may not survive the round-trip.
Use the client-side field as the fast path and parseMessageImages as the
fallback so persisted messages still render their images from the
[IMAGE:] markers embedded in content.
Add unit tests for AttachmentPreview component, attachment validation
utilities (including read_failed path and parseMessageImages), and
Conversations attachment integration to meet the ≥80% diff-cover gate.
- Remove chat.attachment.camera and chat.attachment.cameraUnavailable
  from en.ts and all 13 locale chunks. They were added but no UI
  references them; per CLAUDE.md, add them back when the camera
  capture button lands.
- Wrap the FileReader patch in attachments.test.ts in try/finally so
  the FailingReader can't leak into subsequent tests if the awaited
  validateAndReadFile rejects.

Addresses PR tinyhumansai#2676 review findings tinyhumansai#1 and tinyhumansai#5.
- Add attachment_invalid error code to ChatSendErrorCode; use it for
  local attachment validation errors instead of cloud_send_failed so
  analytics and test selectors can distinguish transport vs validation
- Remove dead chat.attachment.camera / cameraUnavailable i18n keys from
  en.ts and all 13 locale chunks (keys were added but never referenced)
- Widen parseMessageImages regex to [IMAGE:([^\]]+)] to match the Rust
  marker grammar, which accepts data:, http(s)://, and local paths
- Wrap FileReader mock in try/finally so the original is always restored
  even if an assertion throws mid-test
…sai#2725)

Replaces the English placeholder strings added in tinyhumansai#2676 with proper
translations for ar, bn, de, es, fr, hi, id, it, ko, pt, ru, zh-CN.

The 6 keys (chat.attachment.attach / remove / tooMany / tooLarge /
unsupportedType / readFailed) preserve their {name} and {max}
ICU placeholders. i18n:check parity gate still passes (0 missing,
0 extra, 0 drifted).

Note: issue tinyhumansai#2725 mentioned 8 keys (including camera /
cameraUnavailable), but those were dropped from tinyhumansai#2676 since no UI
references them. Only the 6 surviving keys are translated here.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 27, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 79ae5e3f-605e-47e2-9b45-3500003615f1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

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.

i18n: translate chat.attachment.* keys in all non-English locales

3 participants