|
1 | 1 | import {LocaleSwitcher} from '@/components/locale-switcher' |
2 | 2 | import {availableLocales, loadCatalog} from '@/utils/locales' |
3 | | -import {Trans} from '@lingui/macro' |
4 | 3 | import {GetStaticPropsContext} from 'next' |
5 | 4 | import {Vazirmatn} from 'next/font/google' |
| 5 | +import Head from 'next/head' |
| 6 | +import {t, Trans} from "@lingui/macro"; |
| 7 | +import {useLingui} from "@lingui/react"; |
6 | 8 |
|
7 | 9 | const vazirmatn = Vazirmatn({ subsets: ['latin', 'arabic'] }) |
8 | 10 |
|
9 | 11 | export default function Home() { |
| 12 | + const { i18n } = useLingui() |
| 13 | + |
10 | 14 | return ( |
11 | | - <main |
12 | | - className={`flex min-h-screen flex-col items-center justify-between p-24 ${vazirmatn.className}`} |
13 | | - > |
14 | | - <section className="mt-16 py-8"> |
15 | | - <div className="container"> |
16 | | - <div className="mx-auto max-w-xl"> |
17 | | - <h1 className="mb-4 text-center text-4xl font-bold leading-tight text-gray-100"> |
18 | | - <Trans>Building a Multi-Lingual Website</Trans> |
19 | | - </h1> |
20 | | - <p className="mb-8 text-center text-lg text-gray-200"> |
21 | | - <Trans> |
22 | | - Welcome to our Next.js and Lingui demo site! Discover the power |
23 | | - of combining Next.js, a powerful React framework for building |
24 | | - server-side rendered applications, with Lingui, the ultimate |
25 | | - solution for multi-lingual support in your web projects. |
26 | | - </Trans> |
27 | | - </p> |
28 | | - <div className="mb-4 text-center "> |
29 | | - <LocaleSwitcher /> |
| 15 | + <> |
| 16 | + <Head> |
| 17 | + <title> |
| 18 | + {t(i18n)`Next.js & Lingui: Building a Multi-Lingual Website`} |
| 19 | + </title> |
| 20 | + </Head> |
| 21 | + <main |
| 22 | + className={`flex min-h-screen flex-col items-center justify-between p-24 ${vazirmatn.className}`} |
| 23 | + > |
| 24 | + <section className="mt-16 py-8"> |
| 25 | + <div className="container"> |
| 26 | + <div className="mx-auto max-w-xl"> |
| 27 | + <h1 className="mb-4 text-center text-4xl font-bold leading-tight text-gray-100"> |
| 28 | + <Trans>Building a Multi-Lingual Website</Trans> |
| 29 | + </h1> |
| 30 | + <p className="mb-8 text-center text-lg text-gray-200"> |
| 31 | + <Trans> |
| 32 | + Welcome to our Next.js and Lingui demo site! Discover the |
| 33 | + power of combining Next.js, a powerful React framework for |
| 34 | + building server-side rendered applications, with Lingui, the |
| 35 | + ultimate solution for multi-lingual support in your web |
| 36 | + projects. |
| 37 | + </Trans> |
| 38 | + </p> |
| 39 | + <div className="mb-4 text-center "> |
| 40 | + <LocaleSwitcher /> |
| 41 | + </div> |
30 | 42 | </div> |
31 | 43 | </div> |
32 | | - </div> |
33 | | - </section> |
34 | | - </main> |
| 44 | + </section> |
| 45 | + </main> |
| 46 | + </> |
35 | 47 | ) |
36 | 48 | } |
37 | 49 |
|
|
0 commit comments