Skip to content

Commit e2a10e2

Browse files
committed
feat: update translations
1 parent 2195d3b commit e2a10e2

File tree

5 files changed

+119
-96
lines changed

5 files changed

+119
-96
lines changed

client/src/components/layouts/publish/header.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'
55
import { Link } from 'react-router-dom'
66

77
const Header = () => {
8-
const { t } = useTranslation('landingPage')
8+
const { t } = useTranslation('layout')
99

1010
return (
1111
<header className='h-header flex items-center fixed top-0 left-0 right-0 bg-background z-50'>
@@ -18,9 +18,19 @@ const Header = () => {
1818
<LogoText className='text-primary text-xl' />
1919
</Link>
2020

21-
<Link to={ROUTES.AUTH.LOGIN} className={buttonVariants()}>
22-
{t('start_now')}
23-
</Link>
21+
<div>
22+
<Link
23+
to={ROUTES.PUBLIC.HELP}
24+
className={buttonVariants({
25+
variant: 'link',
26+
})}
27+
>
28+
{t('public_layout.help')}
29+
</Link>
30+
<Link to={ROUTES.AUTH.LOGIN} className={buttonVariants()}>
31+
{t('public_layout.start_now')}
32+
</Link>
33+
</div>
2434
</div>
2535
</header>
2636
)

client/src/locales/en/layout.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
},
66
"public_layout": {
77
"footer_subtitle": "DialogBot is a platform that allows you to create and publish chatbots for your website.",
8-
"footer_built_by": "Built with ❤️ by Hoang Huy, Van Khanh"
8+
"footer_built_by": "Built with ❤️ by Hoang Huy, Van Khanh",
9+
"start_now": "Start now",
10+
"help": "Help"
911
}
1012
}

client/src/locales/vi/layout.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
},
66
"public_layout": {
77
"footer_subtitle": "DialogBot là một nền tảng cho phép bạn tạo và xuất bản chatbot cho trang web của mình.",
8-
"footer_built_by": "Xây dựng bởi Hoang Huy, Van Khanh"
8+
"footer_built_by": "Xây dựng bởi Hoang Huy, Van Khanh",
9+
"start_now": "Bắt đầu ngay",
10+
"help": "Trợ giúp"
911
}
1012
}

client/src/pages/help-detail.tsx

Lines changed: 80 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import {
2+
Cell,
23
H1,
3-
Link,
44
H2,
55
H3,
66
H4,
7-
TypographyP,
8-
TypographyBlockquote,
9-
Table,
10-
Cell,
117
Head,
128
HeadCell,
13-
Row,
9+
Link,
1410
OrderedList,
11+
Row,
12+
Table,
13+
TypographyBlockquote,
14+
TypographyP,
1515
UnOrderList,
1616
} from '@/components/typography'
1717
import { buttonVariants } from '@/components/ui'
@@ -21,9 +21,9 @@ import { cn } from '@/lib/utils'
2121
import { format } from 'date-fns'
2222
import { ArrowLeft, ArrowRight } from 'lucide-react'
2323
import {
24-
useLoaderData,
2524
Link as RLink,
2625
ScrollRestoration,
26+
useLoaderData,
2727
} from 'react-router-dom'
2828

2929
const HelpDetail = () => {
@@ -34,78 +34,82 @@ const HelpDetail = () => {
3434
}
3535

3636
return (
37-
<div className='container py-6'>
38-
<ScrollRestoration />
39-
<div className='max-w-3xl mx-auto'>
40-
<div>
41-
<div className='mb-8'>
42-
<H1 className='mb-4'>{data.article.title}</H1>
43-
<div className='flex items-center gap-2'>
44-
<span className='text-muted-foreground text-sm'>
45-
{format(new Date(data.article.date), 'MMMM dd, yyyy')}
46-
</span>
47-
<span className='font-semibold text-sm'>
48-
By {data.article.author}
49-
</span>
50-
</div>
51-
</div>
37+
<div className='pt-header'>
38+
<div className='container py-6'>
39+
<ScrollRestoration />
40+
<div className='max-w-3xl mx-auto'>
5241
<div>
53-
{data.article.content({
54-
components: {
55-
a: (props: any) => (
56-
<Link
57-
{...props}
58-
to={(props.href as string) || props?.to || '#'}
59-
/>
60-
),
61-
h1: (props: any) => <H1 {...props} />,
62-
h2: (props: any) => <H2 {...props} />,
63-
h3: (props: any) => <H3 {...props} />,
64-
h4: (props: any) => <H4 {...props} />,
65-
p: (props: any) => <TypographyP {...props} />,
66-
blockquote: (props: any) => <TypographyBlockquote {...props} />,
67-
ul: (props: any) => <UnOrderList {...props} />,
68-
table: (props: any) => <Table {...props} />,
69-
th: (props: any) => <HeadCell {...props} />,
70-
tr: (props: any) => <Row {...props} />,
71-
td: (props: any) => <Cell {...props} />,
72-
thead: (props: any) => <Head {...props} />,
73-
ol: (props: any) => <OrderedList {...props} />,
74-
},
75-
})}
76-
</div>
77-
78-
{data.prev || data.next ? (
79-
<div>
80-
<hr className='my-8' />
81-
<div className='flex flex-col gap-4'>
82-
{data.prev ? (
83-
<RLink
84-
to={`${ROUTES.PUBLIC.HELP}/${data.prev.slug}`}
85-
className={cn(
86-
buttonVariants({ variant: 'outline' }),
87-
'min-h-16 justify-start gap-4',
88-
)}
89-
>
90-
<ArrowLeft />
91-
<span>{data.prev.title}</span>
92-
</RLink>
93-
) : null}
94-
{data.next ? (
95-
<RLink
96-
to={`${ROUTES.PUBLIC.HELP}/${data.next.slug}`}
97-
className={cn(
98-
buttonVariants({ variant: 'outline' }),
99-
'min-h-16 justify-end gap-4',
100-
)}
101-
>
102-
<span>{data.next.title}</span>
103-
<ArrowRight />
104-
</RLink>
105-
) : null}
42+
<div className='mb-8'>
43+
<H1 className='mb-4'>{data.article.title}</H1>
44+
<div className='flex items-center gap-2'>
45+
<span className='text-muted-foreground text-sm'>
46+
{format(new Date(data.article.date), 'MMMM dd, yyyy')}
47+
</span>
48+
<span className='font-semibold text-sm'>
49+
By {data.article.author}
50+
</span>
10651
</div>
10752
</div>
108-
) : null}
53+
<div>
54+
{data.article.content({
55+
components: {
56+
a: (props: any) => (
57+
<Link
58+
{...props}
59+
to={(props.href as string) || props?.to || '#'}
60+
/>
61+
),
62+
h1: (props: any) => <H1 {...props} />,
63+
h2: (props: any) => <H2 {...props} />,
64+
h3: (props: any) => <H3 {...props} />,
65+
h4: (props: any) => <H4 {...props} />,
66+
p: (props: any) => <TypographyP {...props} />,
67+
blockquote: (props: any) => (
68+
<TypographyBlockquote {...props} />
69+
),
70+
ul: (props: any) => <UnOrderList {...props} />,
71+
table: (props: any) => <Table {...props} />,
72+
th: (props: any) => <HeadCell {...props} />,
73+
tr: (props: any) => <Row {...props} />,
74+
td: (props: any) => <Cell {...props} />,
75+
thead: (props: any) => <Head {...props} />,
76+
ol: (props: any) => <OrderedList {...props} />,
77+
},
78+
})}
79+
</div>
80+
81+
{data.prev || data.next ? (
82+
<div>
83+
<hr className='my-8' />
84+
<div className='flex flex-col gap-4'>
85+
{data.prev ? (
86+
<RLink
87+
to={`${ROUTES.PUBLIC.HELP}/${data.prev.slug}`}
88+
className={cn(
89+
buttonVariants({ variant: 'outline' }),
90+
'min-h-16 justify-start gap-4',
91+
)}
92+
>
93+
<ArrowLeft />
94+
<span>{data.prev.title}</span>
95+
</RLink>
96+
) : null}
97+
{data.next ? (
98+
<RLink
99+
to={`${ROUTES.PUBLIC.HELP}/${data.next.slug}`}
100+
className={cn(
101+
buttonVariants({ variant: 'outline' }),
102+
'min-h-16 justify-end gap-4',
103+
)}
104+
>
105+
<span>{data.next.title}</span>
106+
<ArrowRight />
107+
</RLink>
108+
) : null}
109+
</div>
110+
</div>
111+
) : null}
112+
</div>
109113
</div>
110114
</div>
111115
</div>

client/src/pages/help.tsx

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
import { Article } from '@/components/pages/helps'
12
import { Article as TArticle } from '@/lib/content'
2-
import { useLoaderData } from 'react-router-dom'
33
import { useTranslation } from 'react-i18next'
4-
import { H1 } from '@/components/typography'
5-
import { Article } from '@/components/pages/helps'
4+
import { useLoaderData } from 'react-router-dom'
65

76
const Help = () => {
87
const data = useLoaderData() as {
@@ -12,17 +11,23 @@ const Help = () => {
1211
const { t } = useTranslation('help')
1312

1413
return (
15-
<div className='container'>
16-
<div className='py-16'>
17-
<H1 className='text-center'>{t('title')}</H1>
18-
<p className='text-center text-lg text-muted-foreground mt-4'>
19-
{t('desc')}
20-
</p>
21-
</div>
22-
<div className='pl-4 border-l-2'>
23-
{data.articles.map((article) => (
24-
<Article key={article.slug} article={article} />
25-
))}
14+
<div className='pt-header'>
15+
<div className='container pt-header py-10 md:py-20'>
16+
<div className='mb-10'>
17+
<h1 className='text-3xl md:text-5xl font-bold text-center max-w-2xl mx-auto'>
18+
{t('title')}
19+
</h1>
20+
<p className='text-center text-lg text-muted-foreground mt-4'>
21+
{t('desc')}
22+
</p>
23+
</div>
24+
<div>
25+
<div className='pl-4 border-l-2'>
26+
{data.articles.map((article) => (
27+
<Article key={article.slug} article={article} />
28+
))}
29+
</div>
30+
</div>
2631
</div>
2732
</div>
2833
)

0 commit comments

Comments
 (0)