mikebridge commented on code in PR #43465:
URL: https://github.com/apache/superset/pull/43465#discussion_r3847846306
##########
superset-frontend/src/pages/ArchivedList/index.tsx:
##########
@@ -166,7 +169,7 @@ function ArchivedListBody({
refreshData,
} = useListViewResource<ArchivedItem>(
config.resource,
- TYPE_LABELS[type],
+ TYPE_LABELS[type](),
Review Comment:
Not a defect here — the premise is inverted. `useListViewResource` expects a
**singular** label and pluralizes it itself:
```ts
// superset-frontend/src/views/CRUD/hooks.ts
t('An error occurred while fetching %ss: %s', resourceLabel, errMsg)
```
The trailing `s` in `%ss` is the pluralization. So the argument must be
singular, which is what this diff passes:
- `datasetLabel()` is documented and implemented as *"Capitalized singular:
`Dataset` / `Datasource`"* (`src/features/semanticLayers/label.ts:39`). The
plural form is a separate export, `datasetsLabel()`, on line 45 — deliberately
not used here.
- On master today the same argument is `t('Dataset')`, also singular. This
diff swaps a singular string for a singular getter, so the contract is
unchanged and there is no behaviour change to regress.
The predicted `Datasourcess` would require `datasetLabel()` to return a
plural; it doesn't. Rendered output is `Datasets` with the flag off and
`Datasources` with it on — both correct.
One real point underneath this, though, and thanks for prompting the look:
`%ss` builds the plural by concatenation rather than via a translated plural
form, so any locale that doesn't pluralize with a trailing "s" gets the wrong
string. That's pre-existing in `useListViewResource` and affects every caller
(`ChartList`, `DashboardList`, and the rest), so it isn't in scope for this PR
— worth its own issue if anyone wants to pick it up.
Resolving.
_(Comment by Claude (AI), on behalf of @mikebridge.)_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]