diff --git a/.changeset/lazy-terms-shake.md b/.changeset/lazy-terms-shake.md index 03c0fee21f..efe89f1c12 100644 --- a/.changeset/lazy-terms-shake.md +++ b/.changeset/lazy-terms-shake.md @@ -2,4 +2,4 @@ '@backstage/plugin-linguist': patch --- -Get component's title from translation file +Get component's title from translation file. See: https://backstage.io/docs/plugins/internationalization#for-an-application-developer-overwrite-plugin-messages diff --git a/plugins/linguist/api-report-alpha.md b/plugins/linguist/api-report-alpha.md index 418439d331..4a250535b0 100644 --- a/plugins/linguist/api-report-alpha.md +++ b/plugins/linguist/api-report-alpha.md @@ -4,10 +4,20 @@ ```ts import { BackstagePlugin } from '@backstage/frontend-plugin-api'; +import { TranslationRef } from '@backstage/core-plugin-api/alpha'; // @alpha (undocumented) const _default: BackstagePlugin<{}, {}>; export default _default; +// @alpha (undocumented) +export const linguistTranslationRef: TranslationRef< + 'linguist', + { + readonly 'component.title': 'Languages'; + readonly 'component.noData': 'There is currently no language data for this entity.'; + } +>; + // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/linguist/package.json b/plugins/linguist/package.json index dbc5da2d31..4d308b2f73 100644 --- a/plugins/linguist/package.json +++ b/plugins/linguist/package.json @@ -10,8 +10,7 @@ "exports": { ".": "./src/index.ts", "./alpha": "./src/alpha.ts", - "./package.json": "./package.json", - "./src/translation": "./src/translation.ts" + "./package.json": "./package.json" }, "typesVersions": { "*": { diff --git a/plugins/linguist/src/alpha.ts b/plugins/linguist/src/alpha.ts index e80f131817..287775ade0 100644 --- a/plugins/linguist/src/alpha.ts +++ b/plugins/linguist/src/alpha.ts @@ -16,3 +16,4 @@ export * from './alpha/index'; export { default } from './alpha/index'; +export * from './translation'; diff --git a/plugins/linguist/src/components/LinguistCard/LinguistCard.tsx b/plugins/linguist/src/components/LinguistCard/LinguistCard.tsx index 95aa5e0d89..3a07dd35e2 100644 --- a/plugins/linguist/src/components/LinguistCard/LinguistCard.tsx +++ b/plugins/linguist/src/components/LinguistCard/LinguistCard.tsx @@ -76,9 +76,7 @@ export const LinguistCard = () => { - - There is currently no language data for this entity. - + {t('component.noData')} diff --git a/plugins/linguist/src/translation.ts b/plugins/linguist/src/translation.ts index 78a34f2f7e..f971b70490 100644 --- a/plugins/linguist/src/translation.ts +++ b/plugins/linguist/src/translation.ts @@ -21,6 +21,7 @@ export const linguistTranslationRef = createTranslationRef({ messages: { component: { title: 'Languages', + noData: 'There is currently no language data for this entity.', }, }, });