Skip to content

Commit

Permalink
chore: clean up dynamic translation strings (apache#19641)
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro authored and philipher29 committed Jun 9, 2022
1 parent 4fa3d49 commit 8b16419
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ export default function transformProps(
type: 'text',
...getTotalValuePadding({ chartPadding, donut, width, height }),
style: {
text: t(`Total: ${numberFormatter(totalValue)}`),
text: t('Total: %s', numberFormatter(totalValue)),
fontSize: 16,
fontWeight: 'bold',
},
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/dashboard/actions/dashboardLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export function handleComponentDrop(dropResult) {
destination.id !== rootChildId
) {
return dispatch(
addWarningToast(t(`Can not move top level tab into nested tabs`)),
addWarningToast(t('Can not move top level tab into nested tabs')),
);
} else if (
destination &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const Footer: FC<FooterProps> = ({
onConfirm={onConfirmCancel}
onDismiss={onDismiss}
>
{t(`Are you sure you want to cancel?`)}
{t('Are you sure you want to cancel?')}
</CancelConfirmationAlert>
);
}
Expand Down
4 changes: 2 additions & 2 deletions superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
return;
}

addSuccessToast(t(`${data.type} updated`));
addSuccessToast(t('%s updated', data.type));

if (onAdd) {
onAdd();
Expand All @@ -573,7 +573,7 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
return;
}

addSuccessToast(t(`${data.type} updated`));
addSuccessToast(t('%s updated', data.type));

if (onAdd) {
onAdd(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ function AnnotationList({
<SubMenu
name={
<StyledHeader>
<span>{t(`Annotation Layer ${annotationLayerName}`)}</span>
<span>{t('Annotation Layer %s', annotationLayerName)}</span>
<span>
{hasHistory ? (
<Link to="/annotationlayermodelview/list/">Back to all</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
}
validationMethods={{ onBlur: () => {} }}
errorMessage={validationErrors?.password_needed}
label={t(`${database.slice(10)} PASSWORD`)}
label={t('%s PASSWORD', database.slice(10))}
css={formScrollableStyles}
/>
</>
Expand Down
3 changes: 1 addition & 2 deletions superset-frontend/src/views/CRUD/welcome/EmptyState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,10 @@ export default function EmptyState({ tableName, tab }: EmptyStateProps) {
<i className="fa fa-plus" />
{tableName === 'SAVED_QUERIES'
? t('SQL query')
: t(`${tableName
: tableName
.split('')
.slice(0, tableName.length - 1)
.join('')}
`)}
</Button>
</ButtonContainer>
)}
Expand Down

0 comments on commit 8b16419

Please sign in to comment.