i18n DataGrid view-toggle tooltips
PR #4262 introduced a DataGrid view-toggle button with two hardcoded English tooltip strings ("Switch to table view" / "Switch to card view") and explicitly deferred translation to a follow-up. Without the keys in the locale JSON files, next-intl would surface the raw label paths at runtime for any non-English user once the strings move to t(). Adds switchToTableView and switchToCardView label entries in messages.ts, swaps the hardcoded strings in DataGrid.tsx for t(labels.x), and populates "switch-to-table-view" and "switch-to-card-view" in all 52 locale JSON files with proper translations (no English fallbacks). Verified in Playwright that the toggle tooltip renders the expected translated string in en-US, fr-FR and ja-JP via the same useMessages pipeline already used for the search field placeholder, with no MISSING_MESSAGE errors in the console.
This commit is contained in:
1 parent
cee7884a94
commit
c43dd1da92
54 files changed
+109
-1
No files matched your search
@@ -97,7 +97,9 @@ export function DataGrid({
|
||||
<Icon>{displayMode === 'cards' ? <Table2 /> : <LayoutGrid />}</Icon>
|
||||
</Button>
|
||||
<Tooltip>
|
||||
<Text>{displayMode === 'cards' ? 'Switch to table view' : 'Switch to card view'}</Text>
|
||||
<Text>
|
||||
{displayMode === 'cards' ? t(labels.switchToTableView) : t(labels.switchToCardView)}
|
||||
</Text>
|
||||
</Tooltip>
|
||||
</TooltipTrigger>
|
||||
);
|
||||
|
||||
@@ -365,6 +365,8 @@ export const labels: Record<string, string> = {
|
||||
support: 'label.support',
|
||||
documentation: 'label.documentation',
|
||||
switchAccount: 'label.switch-account',
|
||||
switchToTableView: 'label.switch-to-table-view',
|
||||
switchToCardView: 'label.switch-to-card-view',
|
||||
performance: 'label.performance',
|
||||
lcp: 'label.lcp',
|
||||
inp: 'label.inp',
|
||||
|
||||
Reference in new issue
Block a user