Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix: html tag should have correct lang attr (#884)

Peng Xiao7bd69809e9af
diff --git a/packages/app/src/pages/_app.tsx b/packages/app/src/pages/_app.tsx
index ca96b8ef68..f572774a0e 100644
--- a/packages/app/src/pages/_app.tsx
+++ b/packages/app/src/pages/_app.tsx
@@ -21,6 +21,8 @@ import { useAppState } from '@/providers/app-state-provider';
import { PageLoading } from '@/components/loading';
import Head from 'next/head';
import '@affine/i18n';
+import { useTranslation } from '@affine/i18n';
+import React from 'react';
const ThemeProvider = dynamic(() => import('@/providers/ThemeProvider'), {
ssr: false,
@@ -39,6 +41,11 @@ type AppPropsWithLayout = AppProps & {
const App = ({ Component, pageProps }: AppPropsWithLayout) => {
const getLayout = Component.getLayout || (page => page);
+ const { i18n } = useTranslation();
+
+ React.useEffect(() => {
+ document.documentElement.lang = i18n.language;
+ }, [i18n.language]);
return (
<>