diff --git a/.changeset/long-suits-obey.md b/.changeset/long-suits-obey.md new file mode 100644 index 0000000000..996bba6026 --- /dev/null +++ b/.changeset/long-suits-obey.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-user-settings': patch +--- + +Add some translation to user-setting plugin diff --git a/plugins/user-settings/report-alpha.api.md b/plugins/user-settings/report-alpha.api.md index 9b3b674a10..036ff2ff58 100644 --- a/plugins/user-settings/report-alpha.api.md +++ b/plugins/user-settings/report-alpha.api.md @@ -154,6 +154,8 @@ export const userSettingsTranslationRef: TranslationRef< readonly 'defaultSettingsPage.tabsTitle.general': 'General'; readonly 'settingsLayout.title': 'Settings'; readonly sidebarTitle: 'Settings'; + readonly 'profileCard.title': 'Profile'; + readonly 'appearanceCard.title': 'Appearance'; } >; diff --git a/plugins/user-settings/src/components/General/UserSettingsAppearanceCard.tsx b/plugins/user-settings/src/components/General/UserSettingsAppearanceCard.tsx index ca7378235d..0fa07eb5fa 100644 --- a/plugins/user-settings/src/components/General/UserSettingsAppearanceCard.tsx +++ b/plugins/user-settings/src/components/General/UserSettingsAppearanceCard.tsx @@ -19,13 +19,16 @@ import List from '@material-ui/core/List'; import { UserSettingsPinToggle } from './UserSettingsPinToggle'; import { UserSettingsThemeToggle } from './UserSettingsThemeToggle'; import { UserSettingsLanguageToggle } from './UserSettingsLanguageToggle'; +import { useTranslationRef } from '@backstage/frontend-plugin-api'; +import { userSettingsTranslationRef } from '../../translation'; /** @public */ export const UserSettingsAppearanceCard = () => { const { isMobile } = useSidebarPinState(); + const { t } = useTranslationRef(userSettingsTranslationRef); return ( - + diff --git a/plugins/user-settings/src/components/General/UserSettingsProfileCard.tsx b/plugins/user-settings/src/components/General/UserSettingsProfileCard.tsx index aa9301e379..ac871941dd 100644 --- a/plugins/user-settings/src/components/General/UserSettingsProfileCard.tsx +++ b/plugins/user-settings/src/components/General/UserSettingsProfileCard.tsx @@ -20,13 +20,16 @@ import { UserSettingsSignInAvatar } from './UserSettingsSignInAvatar'; import { UserSettingsMenu } from './UserSettingsMenu'; import { useUserProfile } from '../useUserProfileInfo'; import { InfoCard } from '@backstage/core-components'; +import { useTranslationRef } from '@backstage/frontend-plugin-api'; +import { userSettingsTranslationRef } from '../../translation'; /** @public */ export const UserSettingsProfileCard = () => { const { profile, displayName } = useUserProfile(); + const { t } = useTranslationRef(userSettingsTranslationRef); return ( - + diff --git a/plugins/user-settings/src/translation.ts b/plugins/user-settings/src/translation.ts index 9785c4afaa..0161508d14 100644 --- a/plugins/user-settings/src/translation.ts +++ b/plugins/user-settings/src/translation.ts @@ -119,5 +119,11 @@ export const userSettingsTranslationRef = createTranslationRef({ title: 'Settings', }, sidebarTitle: 'Settings', + profileCard: { + title: 'Profile', + }, + appearanceCard: { + title: 'Appearance', + }, }, });