Skip to content

Commit

Permalink
Make empty state titles easier to translate
Browse files Browse the repository at this point in the history
  • Loading branch information
kgabryje committed Feb 14, 2022
1 parent 480439c commit b0b80ab
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions superset-frontend/src/explore/components/DataTablesPane/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,11 @@ const DataTable = ({
}
if (data) {
if (data.length === 0) {
return (
<EmptyStateMedium
image="document.svg"
title={t(`No ${type} were returned for this query`)}
/>
);
const title =
type === 'samples'
? t('No samples were returned for this query')
: t('No results were returned for this query');
return <EmptyStateMedium image="document.svg" title={title} />;
}
return (
<TableView
Expand All @@ -177,12 +176,11 @@ const DataTable = ({
);
}
if (errorMessage) {
return (
<EmptyStateMedium
image="document.svg"
title={t(`Run a query to display ${type}`)}
/>
);
const title =
type === 'samples'
? t('Run a query to display samples')
: t('Run a query to display results');
return <EmptyStateMedium image="document.svg" title={title} />;
}
return null;
};
Expand Down

0 comments on commit b0b80ab

Please sign in to comment.