Skip to content

Commit a2de38f

Browse files
committed
fix from review
1 parent 5168ec2 commit a2de38f

1 file changed

Lines changed: 2 additions & 26 deletions

File tree

pages/license-filter.tsx

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import {
55
License,
66
} from 'license-filter';
77
import { observer } from 'mobx-react';
8-
import { GetServerSidePropsContext } from 'next';
9-
import { cache, compose, errorLogger } from 'next-ssr-middleware';
108
import { FC, useContext, useEffect, useState } from 'react';
119
import {
1210
Accordion,
@@ -18,17 +16,7 @@ import {
1816

1917
import { PageHead } from '../components/Layout/PageHead';
2018
import { 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

3321
interface 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

Comments
 (0)