Skip to content

Commit

Permalink
feat: add academe i18n (#279)
Browse files Browse the repository at this point in the history
Signed-off-by: laixingyou <[email protected]>
  • Loading branch information
coder-sett authored Dec 10, 2023
1 parent 033f67f commit 281f62d
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 27 deletions.
2 changes: 1 addition & 1 deletion apps/web/i18n
Submodule i18n updated 2 files
+9 −6 en/academe.json
+10 −7 zh/academe.json
2 changes: 1 addition & 1 deletion apps/web/src/common/components/Header/MobileHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const MobileHeader: React.FC<PropsWithChildren> = ({ children }) => {
},
{
title: t('common:header.academe'),
href: '/academe',
href: '/collaboration',
icon: null,
},
{
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/common/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ const Header: React.FC<{
>
{t('common:header.projects')}
</Link>

<Link
href="/academe"
href="/collaboration"
className={'mx-6 px-2.5 font-medium text-white 2xl:mx-2'}
>
{t('common:header.academe')}
Expand Down
57 changes: 35 additions & 22 deletions apps/web/src/modules/academe/CooperationCase.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import classnames from 'classnames';
import { useTranslation } from 'next-i18next';
import { useTranslation, Trans } from 'next-i18next';
import Image from 'next/image';
import { Progress } from 'antd';
import Dialog, { Transition } from '@common/components/Dialog';
Expand Down Expand Up @@ -36,7 +36,8 @@ const CooperationCase = () => {
title: t('academe:nju_title'),
desc: (
<ul className="h-full w-full">
<li className="ml-4 list-disc">{t('academe:nju_author')}</li>
<li className="ml-4 mb-2 list-disc">{t('academe:nju_author')}</li>
<li className="ml-4 mb-2 list-disc">{t('academe:nju_author2')}</li>
<li className="ml-4 list-disc">
{t('academe:nju_desc')}
<a
Expand All @@ -62,8 +63,9 @@ const CooperationCase = () => {
title: t('academe:pku1_title'),
desc: (
<ul className="h-full w-full">
<li className="ml-4 list-disc">{t('academe:pku1_author')}</li>
<li className="ml-4 list-disc">
<li className="ml-4 mb-2 list-disc">{t('academe:pku1_author')}</li>
<li className="ml-4 mb-2 list-disc">{t('academe:pku1_author2')}</li>
<li className="ml-4 mb-2 list-disc">
<div className="line-clamp-6">{t('academe:pku1_desc1')}</div>
</li>
<li className="ml-4 list-disc">
Expand Down Expand Up @@ -96,8 +98,10 @@ const CooperationCase = () => {
title: t('academe:openeuler_title'),
desc: (
<ul className="h-full w-full">
<li className="ml-4 list-disc">{t('academe:openeuler_author')}</li>
<li className="ml-4 list-disc">
<li className="ml-4 mb-2 list-disc">
{t('academe:openeuler_author')}
</li>
<li className="ml-4 mb-2 list-disc">
<div className="line-clamp-6">{t('academe:openeuler_desc1')}</div>
</li>
<li className="ml-4 list-disc">
Expand Down Expand Up @@ -132,20 +136,27 @@ const CooperationCase = () => {
title: t('academe:pku2_title'),
desc: (
<ul className="h-full w-full">
<li className="ml-4 list-disc">{t('academe:author')}</li>
<div className="ml-8 flex list-disc">
<div className="mt-0.5 mr-2">
<TbPoint />
</div>
{t('academe:pku2_author')}
</div>
<div className="ml-8 flex list-disc">
<div className="mt-0.5 mr-2">
<TbPoint />
</div>
{t('academe:pku2_author2')}
<li className="ml-4 mb-2 list-disc">{t('academe:pku2_author')}</li>
<li className="ml-4 mb-2 list-disc">{t('academe:pku2_author2')}</li>
{/* <div className="ml-8 flex list-disc">
<Trans
i18nKey="pku2_author"
ns="academe"
components={{
br: <br />,
}}
/>
</div>
<li className="ml-4 list-disc">
<div className="ml-8 mb-2 flex list-disc">
<Trans
i18nKey="pku2_author2"
ns="academe"
components={{
br: <br />,
}}
/>
</div> */}
<li className="ml-4 mb-2 list-disc">
<div className="line-clamp-6">{t('academe:pku2_desc1')}</div>
</li>
<li className="ml-4 list-disc">
Expand Down Expand Up @@ -178,11 +189,13 @@ const CooperationCase = () => {
title: t('academe:pku3_title'),
desc: (
<ul className="h-full w-full">
<li className="ml-4 list-disc">{t('academe:pku3_author')}</li>
<li className="ml-4 list-disc">
<li className="ml-4 mb-2 list-disc">{t('academe:pku3_author')}</li>
<li className="ml-4 mb-2 list-disc">{t('academe:pku3_author2')}</li>

<li className="ml-4 mb-2 list-disc">
<div className="line-clamp-6">{t('academe:pku3_desc1')}</div>
</li>
<li className="ml-4 list-disc">
<li className="ml-4 mb-2 list-disc">
{t('academe:pku3_desc2')}
<a className="text-[#002fa7]" href={'https://licenserec.com'}>
https://licenserec.com
Expand Down
9 changes: 7 additions & 2 deletions apps/web/src/modules/analyze/DataView/Contributor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ContributorDomainPersona from './ContributorDomainPersona';
import ContributorMilestonePersona from './ContributorMilestonePersona';
import ContributorRolePersona from './ContributorRolePersona';
import AuthRequire from '@modules/auth/AuthRequire';

import { useRouter } from 'next/router';
import OverviewSummary from './OverviewSummary';
import MetricDashboard from '@modules/analyze/DataView/MetricDetail/MetricDashboard';
import TopicTitle from '@modules/analyze/components/TopicTitle';
Expand Down Expand Up @@ -46,8 +46,13 @@ const ContributorDataView = () => {
);
};
const Contributor = () => {
const router = useRouter();

return (
<AuthRequire loadingClassName="mx-auto w-[1200px] py-10 md:w-full md:px-6">
<AuthRequire
redirectTo={router.asPath}
loadingClassName="mx-auto w-[1200px] py-10 md:w-full md:px-6"
>
<ContributorDataView />
</AuthRequire>
);
Expand Down

2 comments on commit 281f62d

@vercel
Copy link

@vercel vercel bot commented on 281f62d Dec 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 281f62d Dec 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.