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

feat: renaming Create to Self-service #2574

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion dynamic-plugins.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ plugins:
config:
priority: 90
props:
title: Create...
title: Self-service
icon: add
to: create
- mountPoint: global.header/component
Expand Down
4 changes: 1 addition & 3 deletions packages/app/src/components/AppBase/AppBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ const AppBase = () => {
<Route
path="/create"
element={
<ScaffolderPage
headerOptions={{ title: 'Software Templates' }}
/>
<ScaffolderPage headerOptions={{ title: 'Self-service' }} />
}
>
<ScaffolderFieldExtensions>
Expand Down
5 changes: 5 additions & 0 deletions packages/app/src/components/DynamicRoot/DynamicRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import extractDynamicConfig, {
DynamicRoute,
} from '../../utils/dynamicUI/extractDynamicConfig';
import initializeRemotePlugins from '../../utils/dynamicUI/initializeRemotePlugins';
import { catalogTranslations } from '../catalog/catalog-translations/catalog';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename the folder
packages/app/src/components/catalog/catalog-translations
to
packages/app/src/components/catalog/translations

This is aligned with https://backstage.io/docs/plugins/internationalization/#for-an-application-developer-overwrite-plugin-messages

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

import { MenuIcon } from '../Root/MenuIcon';
import CommonIcons from './CommonIcons';
import defaultAppComponents from './defaultAppComponents';
Expand Down Expand Up @@ -458,6 +459,10 @@ export const DynamicRoot = ({
api => !remoteApis.some(remoteApi => remoteApi.api.id === api.api.id),
);
app.current = createApp({
__experimentalTranslations: {
availableLanguages: ['en'],
resources: [catalogTranslations],
},
apis: [...filteredStaticApis, ...remoteApis],
bindRoutes({ bind }) {
bindAppRoutes(bind, resolvedRouteBindingTargets, routeBindings);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { createTranslationMessages } from '@backstage/core-plugin-api/alpha';
import { catalogTranslationRef } from '@backstage/plugin-catalog/alpha';

const en = createTranslationMessages({
ref: catalogTranslationRef,
full: false, // False means that this is a partial translation
messages: {
'indexPage.createButtonTitle': 'Self-service',
},
});

export default en;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { createTranslationResource } from '@backstage/core-plugin-api/alpha';
import { catalogTranslationRef } from '@backstage/plugin-catalog/alpha';

export const catalogTranslations = createTranslationResource({
ref: catalogTranslationRef,
translations: {
en: () => import('./catalog-en'),
},
});
2 changes: 1 addition & 1 deletion packages/app/src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const DefaultMainMenuItems = {
priority: 60,
},
'default.create': {
title: 'Create...',
title: 'Self-service',
icon: 'add',
to: 'create',
priority: 50,
Expand Down
Loading