We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b726ab6 + 4e98bce commit 1e5dbe5Copy full SHA for 1e5dbe5
src/pages/_document.tsx
@@ -12,11 +12,15 @@ import { isLangRightToLeft } from "@/lib/utils/translations"
12
13
class Document extends NextDocument {
14
static async getInitialProps(ctx: DocumentContext) {
15
- return await NextDocument.getInitialProps(ctx)
+ const initialProps = await NextDocument.getInitialProps(ctx)
16
+ // TODO: Fix this! Hacky way to get locale to fix search
17
+ // Get locale from query
18
+ const locale = ctx.query?.locale || "en"
19
+ return { ...initialProps, locale }
20
}
21
22
render() {
- const { locale } = this.props.__NEXT_DATA__
23
+ const locale = this.props.locale || "en"
24
const dir = isLangRightToLeft(locale as Lang) ? "rtl" : "ltr"
25
26
return (
0 commit comments