Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: clean up dynamic translation strings #19641

Merged
merged 1 commit into from
Apr 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -210,7 +210,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 @@ -262,7 +262,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 @@ -122,11 +122,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