Skip to content

i18n: extract hardcoded canvas-management strings to locale keys - #3

Draft
dalsoop wants to merge 5 commits into
BetterAndBetterII:multi-canvasfrom
dalsoop:i18n/extract-canvas-strings
Draft

i18n: extract hardcoded canvas-management strings to locale keys#3
dalsoop wants to merge 5 commits into
BetterAndBetterII:multi-canvasfrom
dalsoop:i18n/extract-canvas-strings

Conversation

@dalsoop

@dalsoop dalsoop commented Jun 21, 2026

Copy link
Copy Markdown

Problem

The canvas-management UI added in this fork hardcodes Chinese strings instead of going through the existing i18n system, so non-Chinese users see Chinese text in an otherwise localized app:

  • excalidraw-app/components/MyCreationsTab.tsx — empty-thumbnail placeholder 空空如也
  • excalidraw-app/utils/time.ts — relative time (刚刚, {{n}} 秒前, 分钟前, 小时前, 天前)
  • excalidraw-app/hooks/useCanvasManagement.ts — 4 login-required error messages (您需要登录才能…画布。)

Fix

Move these strings into the locale system via t():

  • New keys under myCreations, timeAgo, canvasManagement.
  • en.json gets English values (also the fallback / type source).
  • zh-CN.json gets the original Chinese values, so behavior is unchanged for zh-CN users.
  • All other locales now fall back to English instead of showing Chinese.

timeAgo.* use {{count}} interpolation, e.g. t("timeAgo.minutesAgo", { count }).

No functional change for zh-CN; this only stops leaking Chinese to non-Chinese locales.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request externalizes hardcoded Chinese strings into translation keys across several files, including MyCreationsTab.tsx, useCanvasManagement.ts, and time.ts. It also adds the corresponding English and Chinese translation strings in the locale files. I have no additional feedback to provide as the changes are clean and correctly implemented.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

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.

1 participant