chore: Localization of superset pt. 2 (#22772)

This commit is contained in:
Artem Shumeiko
2023-01-30 19:20:43 +03:00
committed by GitHub
parent b94052e438
commit c839d0daf5
60 changed files with 260 additions and 157 deletions

View File

@@ -18,7 +18,7 @@
*/
import React from 'react';
import Label from 'src/components/Label';
import { STATE_TYPE_MAP } from 'src/SqlLab/constants';
import { STATE_TYPE_MAP, STATE_TYPE_MAP_LOCALIZED } from 'src/SqlLab/constants';
import { styled, Query } from '@superset-ui/core';
interface QueryStateLabelProps {
@@ -31,6 +31,8 @@ const StyledLabel = styled(Label)`
export default function QueryStateLabel({ query }: QueryStateLabelProps) {
return (
<StyledLabel type={STATE_TYPE_MAP[query.state]}>{query.state}</StyledLabel>
<StyledLabel type={STATE_TYPE_MAP[query.state]}>
{STATE_TYPE_MAP_LOCALIZED[query.state]}
</StyledLabel>
);
}

View File

@@ -360,8 +360,8 @@ const ResultSet = ({
message={t('%(rows)d rows returned', { rows })}
onClose={() => setAlertIsOpen(false)}
description={t(
'The number of rows displayed is limited to %s by the dropdown.',
rows,
'The number of rows displayed is limited to %(rows)d by the dropdown.',
{ rows },
)}
/>
</div>

View File

@@ -35,6 +35,7 @@ import {
STATUS_OPTIONS,
STATE_TYPE_MAP,
LOCALSTORAGE_MAX_QUERY_AGE_MS,
STATUS_OPTIONS_LOCALIZED,
} from '../../constants';
const TAB_HEIGHT = 140;
@@ -145,7 +146,7 @@ const SouthPane = ({
};
const renderOfflineStatus = () => (
<Label className="m-r-3" type={STATE_TYPE_MAP[STATUS_OPTIONS.offline]}>
{STATUS_OPTIONS.offline}
{STATUS_OPTIONS_LOCALIZED.offline}
</Label>
);