Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Add context to Save verb and fix similar translation issues (#64077)

Romeo Van Snickccd8a11ee700
diff --git a/frontend/src/metabase/admin/upsells/UpsellUploads.tsx b/frontend/src/metabase/admin/upsells/UpsellUploads.tsx
index e80f9f85db4..c31e8f6ec08 100644
--- a/frontend/src/metabase/admin/upsells/UpsellUploads.tsx
+++ b/frontend/src/metabase/admin/upsells/UpsellUploads.tsx
@@ -24,6 +24,12 @@ export const UpsellUploads = ({ location }: { location: string }) => {
return null;
}
+ const upgrade = (
+ <strong key="upgrade">{c(
+ "in the sentence 'Upgrade to Metabase Pro to manage your uploaded files and available storage space.'",
+ ).t`Upgrade to Metabase Pro`}</strong>
+ );
+
return (
<UpsellCard
title={t`Manage your uploads`}
@@ -33,9 +39,8 @@ export const UpsellUploads = ({ location }: { location: string }) => {
location={location}
onClick={triggerUpsellFlow}
>
- {c("{0} is the string 'Upgrade to Metabase Pro'").jt`${(
- <strong key="upgrade">{t`Upgrade to Metabase Pro`}</strong>
- )} to manage your uploaded files and available storage space.`}
+ {c("{0} is the string 'Upgrade to Metabase Pro'").jt`${upgrade}
+ to manage your uploaded files and available storage space.`}
</UpsellCard>
);
};
diff --git a/frontend/src/metabase/databases/components/DatabaseForm/DatabaseFormFooter.tsx b/frontend/src/metabase/databases/components/DatabaseForm/DatabaseFormFooter.tsx
index e230e0a4f91..bcc8cf2fcdb 100644
--- a/frontend/src/metabase/databases/components/DatabaseForm/DatabaseFormFooter.tsx
+++ b/frontend/src/metabase/databases/components/DatabaseForm/DatabaseFormFooter.tsx
@@ -91,15 +91,18 @@ export const DatabaseFormFooter = ({
// to false, we can assume that the instance loads with the Sample Database.
// https://www.metabase.com/docs/latest/configuring-metabase/environment-variables#mb_load_sample_content
if (hasSampleDatabase !== false && showSampleDatabase) {
+ const sampleDatabaseLabel = (
+ <strong key="sample">{t`Sample Database`}</strong>
+ );
return (
<>
<Button variant="filled" mb="md" mt="lg" onClick={onCancel}>
{t`Continue with sample data`}
</Button>
<Text fz="sm">
- {c("{0} is 'Sample Database'").jt`Use our ${(
- <strong key="sample">{t`Sample Database`}</strong>
- )} to explore and test the app.`}
+ {c("{0} is 'Sample Database'").jt`Use our ${
+ sampleDatabaseLabel
+ } to explore and test the app.`}
</Text>
<Text fz="sm">{t`Add your own data at any time.`}</Text>
</>
diff --git a/frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/AddDataModal/Panels/AddDataModalEmptyStates.tsx b/frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/AddDataModal/Panels/AddDataModalEmptyStates.tsx
index 468a14a8917..4fc2dfcbfcc 100644
--- a/frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/AddDataModal/Panels/AddDataModalEmptyStates.tsx
+++ b/frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/AddDataModal/Panels/AddDataModalEmptyStates.tsx
@@ -175,6 +175,11 @@ export const CSVPanelEmptyState = ({
contactAdminReason: ContactReason;
upsell?: never;
}) => {
+ const text = (
+ <Text component="span" td="underline">{c(
+ "in the sentence 'To work with CSVs, enable file uploads in your database.'",
+ ).t`your database`}</Text>
+ );
const ctaSubtitle = c("{0} refers to the string 'your database'")
.jt`To work with CSVs, enable file uploads in ${(
<Tooltip
@@ -184,7 +189,7 @@ export const CSVPanelEmptyState = ({
label={t`PostgreSQL, MySQL, Redshift, and ClickHouse databases are supported for file storage.`}
key="database-tooltip"
>
- <Text component="span" td="underline">{t`your database`}</Text>
+ {text}
</Tooltip>
)}.`;
diff --git a/frontend/src/metabase/setup/components/DatabaseStep/DatabaseStep.tsx b/frontend/src/metabase/setup/components/DatabaseStep/DatabaseStep.tsx
index a399c0497ae..f655de97c81 100644
--- a/frontend/src/metabase/setup/components/DatabaseStep/DatabaseStep.tsx
+++ b/frontend/src/metabase/setup/components/DatabaseStep/DatabaseStep.tsx
@@ -72,6 +72,8 @@ export const DatabaseStep = ({ stepLabel }: NumberedStepProps): JSX.Element => {
);
}
+ const optional = <strong key="optional">{t`(optional)`}</strong>;
+
return (
<ActiveStep
title={getStepTitle(database, invite, isStepCompleted)}
@@ -79,7 +81,7 @@ export const DatabaseStep = ({ stepLabel }: NumberedStepProps): JSX.Element => {
>
<Text mt="sm" mb="md">
{c("{0} referes to the word '(optional)'")
- .jt`Are you ready to start exploring your data? Add it below ${(<strong key="optional">{t`(optional)`}</strong>)}.`}
+ .jt`Are you ready to start exploring your data? Add it below ${optional}.`}
</Text>
<DatabaseForm
diff --git a/frontend/src/metabase/visualizations/click-actions/actions/NativeQueryClickFallback.tsx b/frontend/src/metabase/visualizations/click-actions/actions/NativeQueryClickFallback.tsx
index 5ae85e5eb04..da08d0cbece 100644
--- a/frontend/src/metabase/visualizations/click-actions/actions/NativeQueryClickFallback.tsx
+++ b/frontend/src/metabase/visualizations/click-actions/actions/NativeQueryClickFallback.tsx
@@ -1,4 +1,4 @@
-import { jt, t } from "ttag";
+import { c } from "ttag";
import { isWithinIframe } from "metabase/lib/dom";
import { setUIControls } from "metabase/query_builder/actions";
@@ -24,22 +24,25 @@ export const NativeQueryClickFallback: LegacyDrill = ({ question }) => {
name: "fallback-native",
section: "info",
type: "custom",
- view: ({ dispatch }) => (
- <Flex display="flex" align="baseline" gap="0.25rem">
- {jt`${(
- <Button
- key=""
- variant="subtle"
- p={0}
- onClick={() =>
- dispatch(setUIControls({ modal: MODAL_TYPES.SAVE }))
- }
- >
- {t`Save`}
- </Button>
- )} this question to drill-through.`}
- </Flex>
- ),
+ view: ({ dispatch }) => {
+ const button = (
+ <Button
+ key="save-button"
+ variant="subtle"
+ p={0}
+ onClick={() => dispatch(setUIControls({ modal: MODAL_TYPES.SAVE }))}
+ >
+ {c('in the sentence "Save this question to drill-through"').t`Save`}
+ </Button>
+ );
+ return (
+ <Flex display="flex" align="baseline" gap="0.25rem">
+ {c('in the sentence "Save this question to drill-through"').jt`${
+ button
+ } this question to drill-through.`}
+ </Flex>
+ );
+ },
} as CustomClickActionWithCustomView,
];
};