Skip to content

Commit

Permalink
Add translation
Browse files Browse the repository at this point in the history
  • Loading branch information
kitloong committed May 12, 2024
1 parent 9605323 commit 17e7e38
Show file tree
Hide file tree
Showing 27 changed files with 597 additions and 292 deletions.
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NEXT_PUBLIC_POKEMON_LIST_API_BASE_URL=https://json-server-mock.vercel.app/api/
NEXT_PUBLIC_POKEMON_LIST_API_BASE_URL=https://json-server-git-feature-locale-kitloongs-projects.vercel.app/api/
NEXT_PUBLIC_API_RETRY_INTERVAL_IN_SECONDS=5
NEXT_PUBLIC_API_MAX_RETRY=5
NEXTAUTH_URL=http://localhost:3000
Expand Down
2 changes: 1 addition & 1 deletion .env.production
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NEXT_PUBLIC_POKEMON_LIST_API_BASE_URL=https://json-server-mock.vercel.app/api/
NEXT_PUBLIC_POKEMON_LIST_API_BASE_URL=https://json-server-git-feature-locale-kitloongs-projects.vercel.app//api/
NEXT_PUBLIC_API_RETRY_INTERVAL_IN_SECONDS=5
NEXT_PUBLIC_API_MAX_RETRY=5
NEXTAUTH_URL=https://nextjs-dashboard-olive.vercel.app/
Expand Down
7 changes: 3 additions & 4 deletions src/app/(authentication)/login/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default function Login({ callbackUrl }: { callbackUrl: string }) {
name="password"
required
disabled={submitting}
placeholder="Password"
placeholder={dict.login.form.password}
aria-label="Password"
defaultValue="Password"
/>
Expand All @@ -113,13 +113,12 @@ export default function Login({ callbackUrl }: { callbackUrl: string }) {
type="submit"
disabled={submitting}
>
Login
{dict.login.form.submit}
</Button>
</Col>
<Col xs={6} className="text-end">
<Link className="px-0" href="#">
Forgot
password?
{dict.login.forgot_password}
</Link>
</Col>
</Row>
Expand Down
11 changes: 4 additions & 7 deletions src/app/(authentication)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default async function Page({ searchParams }: { searchParams: SearchParam
<Col md={7} className="bg-white border p-5">
<div>
<h1>{dict.login.title}</h1>
<p className="text-black-50">Sign In to your account</p>
<p className="text-black-50">{dict.login.description}</p>

<LoginForm callbackUrl={getCallbackUrl()} />
</div>
Expand All @@ -33,13 +33,10 @@ export default async function Page({ searchParams }: { searchParams: SearchParam
className="bg-primary text-white d-flex align-items-center justify-content-center p-5"
>
<div className="text-center">
<h2>Sign up</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.
</p>
<h2>{dict.login.signup.title}</h2>
<p>{dict.login.signup.description}</p>
<Link className="btn btn-lg btn-outline-light mt-3" href="/register">
Register Now!
{dict.signup.register_now}
</Link>
</div>
</Col>
Expand Down
9 changes: 6 additions & 3 deletions src/app/(authentication)/register/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ import {
Card, CardBody, Col, Row,
} from 'react-bootstrap'
import Register from '@/app/(authentication)/register/register'
import { getDictionary } from '@/locales/dictionary'

export default async function Page() {
const dict = await getDictionary()

export default function Page() {
return (
<Row className="justify-content-center">
<Col md={6}>
<Card className="mb-4 rounded-0">
<CardBody className="p-4">
<h1>Register</h1>
<p className="text-black-50">Create your account</p>
<h1>{dict.signup.title}</h1>
<p className="text-black-50">{dict.signup.description}</p>
<Register />
</CardBody>
</Card>
Expand Down
14 changes: 8 additions & 6 deletions src/app/(authentication)/register/register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import { useRouter } from 'next/navigation'
import { useState } from 'react'
import InputGroupText from 'react-bootstrap/InputGroupText'
import { signIn } from 'next-auth/react'
import useDictionary from '@/locales/dictionary-hook'

export default function Register() {
const router = useRouter()
const dict = useDictionary()
const [submitting, setSubmitting] = useState(false)
const [error, setError] = useState('')

Expand Down Expand Up @@ -66,7 +68,7 @@ export default function Register() {
name="username"
required
disabled={submitting}
placeholder="Username"
placeholder={dict.signup.form.username}
aria-label="Username"
/>
</InputGroup>
Expand All @@ -80,7 +82,7 @@ export default function Register() {
name="email"
required
disabled={submitting}
placeholder="Email"
placeholder={dict.signup.form.email}
aria-label="Email"
/>
</InputGroup>
Expand All @@ -92,7 +94,7 @@ export default function Register() {
name="password"
required
disabled={submitting}
placeholder="Password"
placeholder={dict.signup.form.password}
aria-label="Password"
/>
</InputGroup>
Expand All @@ -104,13 +106,13 @@ export default function Register() {
name="password_repeat"
required
disabled={submitting}
placeholder="Repeat password"
aria-label="Repeat password"
placeholder={dict.signup.form.confirm_password}
aria-label="Confirm password"
/>
</InputGroup>

<Button type="submit" className="d-block w-100" disabled={submitting} variant="success">
Create Account
{dict.signup.form.submit}
</Button>
</Form>
</>
Expand Down
2 changes: 1 addition & 1 deletion src/app/(dashboard)/layout/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Breadcrumb from '@/app/(dashboard)/layout/Breadcrumb/Breadcrumb'
export default function Header() {
return (
<header className="header sticky-top mb-4 py-2 px-sm-2 border-bottom">
<Container fluid className="header-navbar d-flex align-items-center">
<Container fluid className="header-navbar d-flex align-items-center px-0 px-sm-3">
<HeaderSidebarToggler />
<Link href="/" className="header-brand d-md-none">
<svg width="80" height="46">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export default async function HeaderNotificationNav() {
<DropdownDivider />

<Link href="#" passHref legacyBehavior>
<DropdownItem className="text-center fw-bold">{dict.task.viewAll}</DropdownItem>
<DropdownItem className="text-center fw-bold">{dict.task.view_all}</DropdownItem>
</Link>

</DropdownMenu>
Expand Down
Loading

0 comments on commit 17e7e38

Please sign in to comment.