55 License ,
66} from 'license-filter' ;
77import { observer } from 'mobx-react' ;
8- import { GetServerSidePropsContext } from 'next' ;
9- import { cache , compose , errorLogger } from 'next-ssr-middleware' ;
108import { FC , useContext , useEffect , useState } from 'react' ;
119import {
1210 Accordion ,
@@ -18,17 +16,7 @@ import {
1816
1917import { PageHead } from '../components/Layout/PageHead' ;
2018import { licenseTips , optionValue } from '../components/License/helper' ;
21- import { i18n , I18nContext , I18nProps , loadSSRLanguage } from '../models/Translation' ;
22-
23- export const getServerSideProps = compose ( cache ( ) , errorLogger , async ( context : GetServerSidePropsContext ) => {
24- const ssrData = await loadSSRLanguage ( context as any ) ;
25-
26- return {
27- props : JSON . parse ( JSON . stringify ( {
28- ...ssrData ,
29- } ) ) ,
30- } ;
31- } ) ;
19+ import { i18n , I18nContext , I18nProps } from '../models/Translation' ;
3220
3321interface List {
3422 license : License ;
@@ -121,19 +109,7 @@ const LicenseTool: FC<I18nProps> = observer(() => {
121109 className = "mb-3"
122110 variant = "info"
123111 now = { ( keyIndex + 1 ) * now }
124- label = { ( ( ) => {
125- const currentLang = i18n . currentLanguage ;
126- const stepNumber = keyIndex + 1 ;
127-
128- switch ( currentLang ) {
129- case 'zh-CN' :
130- case 'zh-TW' :
131- return `第 ${ stepNumber } 步` ;
132- case 'en-US' :
133- default :
134- return `step ${ stepNumber } ` ;
135- }
136- } ) ( ) }
112+ label = { t ( 'step_x' , { step : keyIndex + 1 } ) }
137113 />
138114 < Button className = "mb-2" variant = "warning" onClick = { backToLast } >
139115 { t ( 'last_step' ) }
0 commit comments