Uh oh!
There was an error while loading. Please reload this page.
fix(plugin-list): translate ListView empty-state title and message - #1610
Closed
baozhoutao wants to merge 1 commit into
Closed
fix(plugin-list): translate ListView empty-state title and message#1610baozhoutao wants to merge 1 commit into
baozhoutao wants to merge 1 commit into
Conversation
The empty-state heading and body hardcoded their English fallback instead
of going through the i18n t() helper like every other label in ListView,
so the empty state always rendered in English even when the active locale
had translations (zh.ts already defines list.noItems / list.noItemsMessage).
Route the fallbacks through t('list.noItems') / t('list.noItemsMessage').
A user-supplied schema.emptyState.title/message still takes precedence.The latest updates on your projects. Learn more about Vercel for GitHub. |
baozhoutao
commented
Jun 9, 2026
ContributorAuthor
Closing as superseded. After rebasing on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The empty-state heading and body in
ListViewrendered in English even when the active locale (e.g.zh-CN) had translations:Root cause
Every other label in
ListViewgoes through the i18nt()helper, but the empty-state title/message hardcoded their English fallback:The translation keys
list.noItems/list.noItemsMessagealready exist in every shipped locale (packages/i18n/src/locales/{en,zh,ja,ko,de,es,fr,pt,ru,ar}.ts) — they just weren't being used here.Fix
Route the fallbacks through
t():A user-supplied
schema.emptyState.title/messagestill takes precedence; only the default text now localizes. No new strings needed.Testing
pnpm vitest run src/__tests__/ListView.test.tsx→ 117 passed. The existing empty-state assertion (getByText('No items found')) still passes because, without anI18nProvider,t()falls back to the English default — behavior is unchanged in the default locale.A changeset (
@object-ui/plugin-list: patch) is included.