1
1
import { useRouter } from "next/router"
2
2
import { GetStaticProps } from "next/types"
3
- import { SSRConfig , useTranslation } from "next-i18next"
3
+ import { useTranslation } from "next-i18next"
4
4
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
5
5
import {
6
6
Box ,
@@ -12,6 +12,8 @@ import {
12
12
useColorModeValue ,
13
13
} from "@chakra-ui/react"
14
14
15
+ import { BasePageProps } from "@/lib/types"
16
+
15
17
import ActionCard from "@/components/ActionCard"
16
18
import Breadcrumbs from "@/components/Breadcrumbs"
17
19
import FeedbackCard from "@/components/FeedbackCard"
@@ -22,6 +24,7 @@ import Text from "@/components/OldText"
22
24
import PageMetadata from "@/components/PageMetadata"
23
25
import TranslationLeaderboard from "@/components/TranslationLeaderboard"
24
26
27
+ import { existsNamespace } from "@/lib/utils/existsNamespace"
25
28
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
26
29
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
27
30
@@ -40,25 +43,23 @@ const ContentHeading = (props: HeadingProps) => (
40
43
< OldHeading lineHeight = { 1.4 } { ...props } />
41
44
)
42
45
43
- type Props = SSRConfig & {
44
- lastDeployDate : string
45
- }
46
+ export const getStaticProps = ( async ( { locale } ) => {
47
+ const lastDeployDate = getLastDeployDate ( )
46
48
47
- export const getStaticProps = ( async ( context ) => {
48
- const { locale } = context
49
- // load i18n required namespaces for the given page
50
49
const requiredNamespaces = getRequiredNamespacesForPage (
51
50
"/contributing/translation-program/acknowledgements"
52
51
)
53
- const lastDeployDate = getLastDeployDate ( )
52
+
53
+ const contentNotTranslated = ! existsNamespace ( locale ! , requiredNamespaces [ 1 ] )
54
54
55
55
return {
56
56
props : {
57
57
...( await serverSideTranslations ( locale ! , requiredNamespaces ) ) ,
58
+ contentNotTranslated,
58
59
lastDeployDate,
59
60
} ,
60
61
}
61
- } ) satisfies GetStaticProps < Props >
62
+ } ) satisfies GetStaticProps < BasePageProps >
62
63
63
64
const TranslatorAcknowledgements = ( ) => {
64
65
const router = useRouter ( )
0 commit comments