mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-09 23:15:36 +00:00
Add translation (#9)
* feat(wip): translation * fix: some i18n errors + use ssr translation * fix: i18next implementation * fix: tsc errors * feat: i18n middleware * feat: translate link view home page * feat: translate quick actions * feat: translate search modal * feat: translate side menu * feat: native error boundary + translation * feat: translate error pages * feat: translate category forms * feat: translate link forms * refactor: LangSelector is no longer absolute by default
This commit is contained in:
@@ -1,17 +1,16 @@
|
||||
import ErrorBoundary from "components/ErrorBoundary/ErrorBoundary";
|
||||
import * as Keys from "constants/keys";
|
||||
import PATHS from "constants/paths";
|
||||
import { SessionProvider } from "next-auth/react";
|
||||
import { appWithTranslation } from "next-i18next";
|
||||
import { DefaultSeo } from "next-seo";
|
||||
import { useRouter } from "next/router";
|
||||
import nProgress from "nprogress";
|
||||
import "nprogress/nprogress.css";
|
||||
import { useEffect } from "react";
|
||||
import { useHotkeys } from "react-hotkeys-hook";
|
||||
|
||||
import AppErrorBoundary from "components/AppErrorBoundary";
|
||||
|
||||
import * as Keys from "constants/keys";
|
||||
import PATHS from "constants/paths";
|
||||
|
||||
import "nprogress/nprogress.css";
|
||||
import "styles/globals.scss";
|
||||
import nextI18nextConfig from "../../next-i18next.config";
|
||||
|
||||
function MyApp({ Component, pageProps: { session, ...pageProps } }) {
|
||||
const router = useRouter();
|
||||
@@ -22,7 +21,7 @@ function MyApp({ Component, pageProps: { session, ...pageProps } }) {
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
// Chargement pages
|
||||
// Page loading events
|
||||
router.events.on("routeChangeStart", nProgress.start);
|
||||
router.events.on("routeChangeComplete", nProgress.done);
|
||||
router.events.on("routeChangeError", nProgress.done);
|
||||
@@ -37,11 +36,11 @@ function MyApp({ Component, pageProps: { session, ...pageProps } }) {
|
||||
return (
|
||||
<SessionProvider session={session}>
|
||||
<DefaultSeo titleTemplate="MyLinks — %s" defaultTitle="MyLinks" />
|
||||
<AppErrorBoundary>
|
||||
<ErrorBoundary>
|
||||
<Component {...pageProps} />
|
||||
</AppErrorBoundary>
|
||||
</ErrorBoundary>
|
||||
</SessionProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export default MyApp;
|
||||
export default appWithTranslation(MyApp, nextI18nextConfig);
|
||||
|
||||
Reference in New Issue
Block a user