Skip to content

Commit ad74e98

Browse files
fix(plugin-list): translate the synthetic "All records" user-filter tab (objectui#13405) (#13423)
Closes #13405 Clause-②: no ## What changed A tabs-mode user-filter bar with `showAllRecords` appends a synthetic trailing tab, `{ id: '__all__', … }`, whose label was the literal English string `'All records'`, so a zh-CN list showed it beside translated tabs. - `packages/plugin-list/src/UserFilters.tsx` (`TabFilters`): the label is now read through `useSafeTranslate()` (the hook `DropdownFilters` in the same file already uses) as `tt('list.userFilters.allRecords', 'All records')`. The translated value is read into a string before the `allTabs` memo, so the memo keys on that string and not on the per-render identity of `tt` (AGENTS.md #10). `TabFilters` is a component, so the hook path needed no workaround. - One new key, **`list.userFilters.allRecords`**, in all ten packs under `packages/i18n/src/locales/`: en `All records`, zh `全部记录`, ja `すべてのレコード`, ko `전체 레코드`, de `Alle Datensätze`, es `Todos los registros`, fr `Tous les enregistrements`, pt `Todos os registros`, ru `Все записи`, ar `جميع السجلات`. No other key is touched. - The `__all__` id and the tab's behaviour (no conditions, reported as `_tab: __all__`) are unchanged. - `.changeset/user-filters-all-records-label-13405.md`: patch for `@object-ui/plugin-list` and `@object-ui/i18n`. **Why a new key rather than the existing `list.allRecords`:** that key's en value is Title Case (`All Records`). Reusing it would change the English tab label, and the card asks for en to keep reading `All records`. Its translations match the new key's values in every non-en pack. ## Tests New file `packages/plugin-list/src/__tests__/UserFilters.allRecordsLabel-13405.test.tsx`: - zh: the `filter-tab-__all__` tab reads `全部记录`, and no `All records` text is drawn. - en: the tab reads `All records`. With no provider, the inline fallback also reads `All records`. - CONTROL: the authored tabs keep their authored labels in zh and en. - CONTROL: clicking the tab still emits `[]` and `{ _tab: ['__all__'] }`. - The controls wait for the catalogue through a separate probe (`t('common.more')`), not through the tab label, so they do not depend on the fix. Results at head `2fbb3b2033`: - `pnpm exec vitest run --maxWorkers=2 packages/plugin-list/ packages/i18n/` (under the verify lock): `Test Files 243 passed (243)`, `Tests 2945 passed | 13 skipped (2958)`, VERDICT command-exit 0. - `all-locales-key-parity` + `en-zh-key-parity` run explicitly: `Test Files 2 passed (2)`, `Tests 48 passed (48)`. - `pnpm check:i18n-keys`, `check:i18n-drift` (reports "0 en value(s) changed (1 key(s) added, 0 removed)"), `check:i18n-dead-keys` (the new key is not listed), and `check:i18n-designer-parity`: all exit 0. - `turbo run type-check --filter=@object-ui/plugin-list --filter=@object-ui/i18n`: `Tasks: 15 successful, 15 total`, 0 `error TS`. Both packages ran `tsc --noEmit && tsc -p tsconfig.test.json`. Dependents were not type-checked. - eslint on the touched files: 0 errors. The 30 warnings are existing `no-explicit-any` warnings, none on the changed lines. - `node scripts/check-changeset-presence.mjs`: ✅, 1 changeset declared. `pnpm check:new-line-citations`: 0 new citations. **Ablation.** The fix was committed first. Then the label was set back to the literal `'All records'` (on-disk check: injected=1, `allRecordsLabel` uses left=0) and the new file was run. Result: `Tests 1 failed | 4 passed (5)`. Only the zh pin went red; the en, no-provider and both control cases stayed green, as expected. The file was restored with `git checkout HEAD --`: `git diff HEAD` is empty and the blob hash matches HEAD. ## Acceptance notes - Noted, not filed: the same tab strip's `allowAddTab` affordances are also English literals (`title="Remove tab"`, the `Remove tab …` aria-label, `title="Add filter tab"`, `placeholder="Tab name"` and the `Add tab` button text in `TabFilters`). They are outside this card's surface and their reach was not measured. Carrier: none. - [x] Adds no product-specific widget, dialog, hook or string (see AGENTS.md › Product-neutral renderer) Session: `https://claude.ai/code/session_01WJozybDmRH8z2c5SD7vJkj` 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WJozybDmRH8z2c5SD7vJkj --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 130c77d commit ad74e98

13 files changed

Lines changed: 175 additions & 2 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@object-ui/plugin-list': patch
3+
'@object-ui/i18n': patch
4+
---
5+
6+
fix(plugin-list): the synthetic "All records" tab of a tabs-mode user-filter bar (`showAllRecords`) now reads its label from the new `list.userFilters.allRecords` i18n key, filled in every shipped locale (zh: 全部记录), instead of a hard-coded English string (objectui#13405). The tab's `__all__` id and behaviour are unchanged.

‎packages/i18n/src/locales/ar.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,9 @@ const ar = {
867867
viewAll: "عرض الكل",
868868
tabs: "علامات التبويب",
869869
allRecords: "جميع السجلات",
870+
userFilters: {
871+
allRecords: "جميع السجلات",
872+
},
870873
search: "بحث",
871874
filter: "تصفية",
872875
filterRecords: "تصفية السجلات",

‎packages/i18n/src/locales/de.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,9 @@ const de = {
770770
viewAll: "Alle anzeigen",
771771
tabs: "Tabs",
772772
allRecords: "Alle Datensätze",
773+
userFilters: {
774+
allRecords: "Alle Datensätze",
775+
},
773776
search: "Suche",
774777
filter: "Filtern",
775778
filterRecords: "Datensätze filtern",

‎packages/i18n/src/locales/en.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,10 @@ const en = {
972972
viewAll: 'View all',
973973
tabs: 'Tabs',
974974
allRecords: 'All Records',
975+
// objectui#13405 — the synthetic trailing tab a `showAllRecords` user-filter bar adds.
976+
userFilters: {
977+
allRecords: 'All records',
978+
},
975979
search: 'Search',
976980
filter: 'Filter',
977981
filterRecords: 'Filter Records',

‎packages/i18n/src/locales/es.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,9 @@ const es = {
797797
viewAll: "Ver todo",
798798
tabs: "Pestañas",
799799
allRecords: "Todos los registros",
800+
userFilters: {
801+
allRecords: "Todos los registros",
802+
},
800803
search: "Buscar",
801804
filter: "Filtrar",
802805
filterRecords: "Filtrar registros",

‎packages/i18n/src/locales/fr.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,9 @@ const fr = {
792792
viewAll: "Tout afficher",
793793
tabs: "Onglets",
794794
allRecords: "Tous les enregistrements",
795+
userFilters: {
796+
allRecords: "Tous les enregistrements",
797+
},
795798
search: "Rechercher",
796799
filter: "Filtrer",
797800
filterRecords: "Filtrer les enregistrements",

‎packages/i18n/src/locales/ja.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,9 @@ const ja = {
770770
viewAll: "すべて表示",
771771
tabs: "タブ",
772772
allRecords: "すべてのレコード",
773+
userFilters: {
774+
allRecords: "すべてのレコード",
775+
},
773776
search: "検索",
774777
filter: "フィルター",
775778
filterRecords: "レコードをフィルター",

‎packages/i18n/src/locales/ko.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,9 @@ const ko = {
770770
viewAll: "모두 보기",
771771
tabs: "탭",
772772
allRecords: "전체 레코드",
773+
userFilters: {
774+
allRecords: "전체 레코드",
775+
},
773776
search: "검색",
774777
filter: "필터",
775778
filterRecords: "레코드 필터",

‎packages/i18n/src/locales/pt.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,9 @@ const pt = {
792792
viewAll: "Ver tudo",
793793
tabs: "Abas",
794794
allRecords: "Todos os registros",
795+
userFilters: {
796+
allRecords: "Todos os registros",
797+
},
795798
search: "Pesquisar",
796799
filter: "Filtrar",
797800
filterRecords: "Filtrar registros",

‎packages/i18n/src/locales/ru.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,9 @@ const ru = {
820820
viewAll: "Показать все",
821821
tabs: "Вкладки",
822822
allRecords: "Все записи",
823+
userFilters: {
824+
allRecords: "Все записи",
825+
},
823826
search: "Поиск",
824827
filter: "Фильтр",
825828
filterRecords: "Фильтр записей",

0 commit comments

Comments
 (0)