You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by vi...@apache.org on 2022/04/11 10:02:28 UTC
[superset] branch master updated: chore: clean up dynamic translation strings (#19641)
This is an automated email from the ASF dual-hosted git repository.
villebro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new f21ba68a30 chore: clean up dynamic translation strings (#19641)
f21ba68a30 is described below
commit f21ba68a304787a196eb03a31ccd64405e375c72
Author: Ville Brofeldt <33...@users.noreply.github.com>
AuthorDate: Mon Apr 11 13:02:20 2022 +0300
chore: clean up dynamic translation strings (#19641)
---
.../plugins/plugin-chart-echarts/src/Pie/transformProps.ts | 2 +-
superset-frontend/src/dashboard/actions/dashboardLayout.js | 2 +-
.../components/nativeFilters/FiltersConfigModal/Footer/Footer.tsx | 2 +-
superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx | 4 ++--
superset-frontend/src/views/CRUD/annotation/AnnotationList.tsx | 2 +-
.../src/views/CRUD/data/database/DatabaseModal/index.tsx | 2 +-
superset-frontend/src/views/CRUD/welcome/EmptyState.tsx | 3 +--
7 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Pie/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Pie/transformProps.ts
index aeeec088b0..cf40ce7e1b 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/Pie/transformProps.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/Pie/transformProps.ts
@@ -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',
},
diff --git a/superset-frontend/src/dashboard/actions/dashboardLayout.js b/superset-frontend/src/dashboard/actions/dashboardLayout.js
index e0cbe7aa00..8d4b3fa56c 100644
--- a/superset-frontend/src/dashboard/actions/dashboardLayout.js
+++ b/superset-frontend/src/dashboard/actions/dashboardLayout.js
@@ -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 &&
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/Footer/Footer.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/Footer/Footer.tsx
index 4c2f774a62..aed85af3a2 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/Footer/Footer.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/Footer/Footer.tsx
@@ -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>
);
}
diff --git a/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx b/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx
index 7a68b2663f..66b4b39006 100644
--- a/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx
+++ b/superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx
@@ -557,7 +557,7 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
return;
}
- addSuccessToast(t(`${data.type} updated`));
+ addSuccessToast(t('%s updated', data.type));
if (onAdd) {
onAdd();
@@ -573,7 +573,7 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
return;
}
- addSuccessToast(t(`${data.type} updated`));
+ addSuccessToast(t('%s updated', data.type));
if (onAdd) {
onAdd(response);
diff --git a/superset-frontend/src/views/CRUD/annotation/AnnotationList.tsx b/superset-frontend/src/views/CRUD/annotation/AnnotationList.tsx
index 413373aefc..c91099a6d5 100644
--- a/superset-frontend/src/views/CRUD/annotation/AnnotationList.tsx
+++ b/superset-frontend/src/views/CRUD/annotation/AnnotationList.tsx
@@ -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>
diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
index 583b540579..dee6f4dd3f 100644
--- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
+++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
@@ -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}
/>
</>
diff --git a/superset-frontend/src/views/CRUD/welcome/EmptyState.tsx b/superset-frontend/src/views/CRUD/welcome/EmptyState.tsx
index 379fbe3995..525c9ef62e 100644
--- a/superset-frontend/src/views/CRUD/welcome/EmptyState.tsx
+++ b/superset-frontend/src/views/CRUD/welcome/EmptyState.tsx
@@ -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>
)}