diff --git a/packages/frontend/core/src/desktop/dialogs/setting/index.tsx b/packages/frontend/core/src/desktop/dialogs/setting/index.tsx index 419ac312e6b0f..661835333eecd 100644 --- a/packages/frontend/core/src/desktop/dialogs/setting/index.tsx +++ b/packages/frontend/core/src/desktop/dialogs/setting/index.tsx @@ -15,7 +15,7 @@ import type { import { GlobalContextService } from '@affine/core/modules/global-context'; import { createIsland, type Island } from '@affine/core/utils/island'; import { ServerDeploymentType } from '@affine/graphql'; -import { Trans } from '@affine/i18n'; +import { Trans, useTranslation } from '@affine/i18n'; import { ContactWithUsIcon } from '@blocksuite/icons/rc'; import { FrameworkScope, useLiveData, useService } from '@toeverything/infra'; import { debounce } from 'lodash-es'; @@ -72,10 +72,12 @@ const SettingModalInner = ({ scrollAnchor: initialScrollAnchor, }); const globalContextService = useService(GlobalContextService); + const { i18n } = useTranslation('translation'); const currentServerId = useLiveData( globalContextService.globalContext.serverId.$ ); + const currentLanguageKey = i18n.resolvedLanguage ?? i18n.language; const serversService = useService(ServersService); const defaultServerService = useService(DefaultServerService); const currentServer = diff --git a/packages/frontend/i18n/src/react.ts b/packages/frontend/i18n/src/react.ts index 3cfe628f31aea..2408443279d51 100644 --- a/packages/frontend/i18n/src/react.ts +++ b/packages/frontend/i18n/src/react.ts @@ -9,4 +9,4 @@ export const useI18n = () => { return useMemo(() => createI18nWrapper(() => i18n), [i18n]); }; -export { I18nextProvider, Trans } from 'react-i18next'; +export { I18nextProvider, Trans, useTranslation } from 'react-i18next';