fix: add sidebar translation
Signed-off-by: mario ma <mario.ma.node@gmail.com>
This commit is contained in:
@@ -153,6 +153,7 @@ export const userSettingsTranslationRef: TranslationRef<
|
||||
readonly 'defaultSettingsPage.tabsTitle.authProviders': 'Authentication Providers';
|
||||
readonly 'defaultSettingsPage.tabsTitle.general': 'General';
|
||||
readonly 'settingsLayout.title': 'Settings';
|
||||
readonly sideBarTitle: 'Settings';
|
||||
}
|
||||
>;
|
||||
|
||||
|
||||
@@ -18,10 +18,13 @@ import SettingsIcon from '@material-ui/icons/Settings';
|
||||
import { settingsRouteRef } from '../plugin';
|
||||
import { SidebarItem } from '@backstage/core-components';
|
||||
import { useRouteRef, IconComponent } from '@backstage/core-plugin-api';
|
||||
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
||||
import { userSettingsTranslationRef } from '../translation';
|
||||
|
||||
/** @public */
|
||||
export const Settings = (props: { icon?: IconComponent }) => {
|
||||
const routePath = useRouteRef(settingsRouteRef);
|
||||
const Icon = props.icon ? props.icon : SettingsIcon;
|
||||
return <SidebarItem text="Settings" to={routePath()} icon={Icon} />;
|
||||
const { t } = useTranslationRef(userSettingsTranslationRef);
|
||||
return <SidebarItem text={t('sideBarTitle')} to={routePath()} icon={Icon} />;
|
||||
};
|
||||
|
||||
@@ -118,5 +118,6 @@ export const userSettingsTranslationRef = createTranslationRef({
|
||||
settingsLayout: {
|
||||
title: 'Settings',
|
||||
},
|
||||
sideBarTitle: 'Settings',
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user