diff --git a/.changeset/curvy-carrots-dream.md b/.changeset/curvy-carrots-dream.md new file mode 100644 index 0000000000..64f1dfffb0 --- /dev/null +++ b/.changeset/curvy-carrots-dream.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-components': patch +--- + +The translation support for the `Link` component has been removed for now, in order to avoid broad breakages of tests in existing projects where the component is tested without being wrapped in an API provider. diff --git a/packages/core-components/api-report-alpha.md b/packages/core-components/api-report-alpha.md index f2b21f6d1e..1f4b999232 100644 --- a/packages/core-components/api-report-alpha.md +++ b/packages/core-components/api-report-alpha.md @@ -9,7 +9,6 @@ import { TranslationRef } from '@backstage/core-plugin-api/alpha'; export const coreComponentsTranslationRef: TranslationRef< 'core-components', { - readonly 'link.openNewWindow': 'Opens in a new window'; readonly 'table.filter.title': 'Filters'; readonly 'table.filter.clearAll': 'Clear all'; readonly 'signIn.title': 'Sign In'; diff --git a/packages/core-components/src/components/Link/Link.tsx b/packages/core-components/src/components/Link/Link.tsx index b426402ba9..e957390da8 100644 --- a/packages/core-components/src/components/Link/Link.tsx +++ b/packages/core-components/src/components/Link/Link.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ import { configApiRef, useAnalytics, useApi } from '@backstage/core-plugin-api'; -import { useTranslationRef } from '@backstage/core-plugin-api/alpha'; // eslint-disable-next-line no-restricted-imports import MaterialLink, { LinkProps as MaterialLinkProps, @@ -30,7 +29,6 @@ import { LinkProps as RouterLinkProps, Route, } from 'react-router-dom'; -import { coreComponentsTranslationRef } from '../../translation'; export function isReactRouterBeta(): boolean { const [obj] = createRoutesFromChildren(} />); @@ -163,7 +161,6 @@ export const Link = React.forwardRef( ({ onClick, noTrack, ...props }, ref) => { const classes = useStyles(); const analytics = useAnalytics(); - const { t } = useTranslationRef(coreComponentsTranslationRef); // Adding the base path to URLs breaks react-router v6 stable, so we only // do it for beta. The react router version won't change at runtime so it is @@ -202,7 +199,7 @@ export const Link = React.forwardRef( > {props.children} - {`, ${t('link.openNewWindow')}`} + , Opens in a new window ) : ( diff --git a/packages/core-components/src/translation.ts b/packages/core-components/src/translation.ts index 2acb4ea735..91474e73b7 100644 --- a/packages/core-components/src/translation.ts +++ b/packages/core-components/src/translation.ts @@ -80,9 +80,6 @@ export const coreComponentsTranslationRef = createTranslationRef({ login: 'Log in', rejectAll: 'Reject All', }, - link: { - openNewWindow: 'Opens in a new window', - }, supportButton: { title: 'Support', close: 'Close',