Skip to content

Commit 46fa95d

Browse files
committed
Merge branch 'release/1.0.0-beta.2'
2 parents 73bcf7d + 6aaeffe commit 46fa95d

File tree

7 files changed

+68
-33
lines changed

7 files changed

+68
-33
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.0.0-beta.2] - 2023-07-21
6+
7+
### <!-- 02 -->Bug Fixes
8+
9+
- Add page title and update locale files
10+
- Implement `useLingui` hook for proper translation rendering"
11+
12+
### <!-- 04 -->Refactor
13+
14+
- Improve code readability with proper spacing
15+
516
## [1.0.0-beta.1] - 2023-07-21
617

718
### <!-- 05 -->Documentation

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ by the coupling of Next.js's SSG and Lingui.
2323

2424
### Key Features
2525

26-
* **Static Site Generation with Next.js**: Experience the unique advantages of utilizing Next.js in our static web
26+
- **Static Site Generation with Next.js**: Experience the unique advantages of utilizing Next.js in our static web
2727
application. This includes benefits such as improved performance and SEO, client-side routing, and a more streamlined
2828
development process.
29-
* **Translation Management with Lingui**: Discover how Lingui simplifies handling translations in our static web app,
29+
- **Translation Management with Lingui**: Discover how Lingui simplifies handling translations in our static web app,
3030
from message extraction to language pluralization and localized formatting.
31-
* **Real-time Language Switching**: Experience an interactive feature of our static web app that enables dynamic
31+
- **Real-time Language Switching**: Experience an interactive feature of our static web app that enables dynamic
3232
language switching. This allows users to effortlessly switch between different languages without navigating away from
3333
their current page.
3434

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nextjs-lingui-template",
3-
"version": "1.0.0-beta.1",
3+
"version": "1.0.0-beta.2",
44
"private": true,
55
"scripts": {
66
"dev": "next dev",

src/locales/ar/messages.po

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@ msgstr ""
1313
"Plural-Forms: \n"
1414
"X-Generator: Poedit 3.3.2\n"
1515

16-
#: src/pages/[locale]/index.tsx:18
16+
#: src/pages/[locale]/index.tsx:28
1717
msgid "Building a Multi-Lingual Website"
1818
msgstr "بناء موقع متعدد اللغات"
1919

20+
#: src/pages/[locale]/index.tsx:18
21+
msgid "Next.js & Lingui: Building a Multi-Lingual Website"
22+
msgstr "Next.js & Lingui: بناء موقع متعدد اللغات"
23+
2024
#: src/components/locale-switcher.tsx:20
2125
msgid "Open options"
2226
msgstr "افتح الخيارات"
2327

24-
#: src/pages/[locale]/index.tsx:21
28+
#: src/pages/[locale]/index.tsx:31
2529
msgid "Welcome to our Next.js and Lingui demo site! Discover the power of combining Next.js, a powerful React framework for building server-side rendered applications, with Lingui, the ultimate solution for multi-lingual support in your web projects."
2630
msgstr "مرحبًا بك في موقعنا التجريبي لـ Next.js و Lingui! اكتشف قوة الجمع بين Next.js، إطار عمل React القوي لبناء تطبيقات تتم رسمها من جانب الخادم، مع Lingui، الحل النهائي للدعم متعدد اللغات في مشاريع الويب الخاصة بك."

src/locales/en/messages.po

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@ msgstr ""
1313
"X-Generator: Poedit 3.3.2\n"
1414
"Plural-Forms: \n"
1515

16-
#: src/pages/[locale]/index.tsx:18
16+
#: src/pages/[locale]/index.tsx:28
1717
msgid "Building a Multi-Lingual Website"
1818
msgstr "Building a Multi-Lingual Website"
1919

20+
#: src/pages/[locale]/index.tsx:18
21+
msgid "Next.js & Lingui: Building a Multi-Lingual Website"
22+
msgstr "Next.js & Lingui: Building a Multi-Lingual Website"
23+
2024
#: src/components/locale-switcher.tsx:20
2125
msgid "Open options"
2226
msgstr "Open options"
2327

24-
#: src/pages/[locale]/index.tsx:21
28+
#: src/pages/[locale]/index.tsx:31
2529
msgid "Welcome to our Next.js and Lingui demo site! Discover the power of combining Next.js, a powerful React framework for building server-side rendered applications, with Lingui, the ultimate solution for multi-lingual support in your web projects."
2630
msgstr "Welcome to our Next.js and Lingui demo site! Discover the power of combining Next.js, a powerful React framework for building server-side rendered applications, with Lingui, the ultimate solution for multi-lingual support in your web projects."

src/locales/fa/messages.po

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@ msgstr ""
1313
"Plural-Forms: \n"
1414
"X-Generator: Poedit 3.3.2\n"
1515

16-
#: src/pages/[locale]/index.tsx:18
16+
#: src/pages/[locale]/index.tsx:28
1717
msgid "Building a Multi-Lingual Website"
1818
msgstr "ساخت وب سایت چند زبانه"
1919

20+
#: src/pages/[locale]/index.tsx:18
21+
msgid "Next.js & Lingui: Building a Multi-Lingual Website"
22+
msgstr "Next.js & Lingui: ساخت یک وب سایت چند زبانه"
23+
2024
#: src/components/locale-switcher.tsx:20
2125
msgid "Open options"
2226
msgstr "باز کردن گزینه ها"
2327

24-
#: src/pages/[locale]/index.tsx:21
28+
#: src/pages/[locale]/index.tsx:31
2529
msgid "Welcome to our Next.js and Lingui demo site! Discover the power of combining Next.js, a powerful React framework for building server-side rendered applications, with Lingui, the ultimate solution for multi-lingual support in your web projects."
2630
msgstr "به سایت دمو Next.js و Lingui ما خوش آمدید! قدرت ترکیب Next.js، یک فریم‌ورک React قدرتمند برای ساخت برنامه های رندر شده در سمت سرور، با Lingui، راه حل نهایی برای پشتیبانی چند زبانه در پروژه های وب خود را کشف کنید."

src/pages/[locale]/index.tsx

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,49 @@
11
import {LocaleSwitcher} from '@/components/locale-switcher'
22
import {availableLocales, loadCatalog} from '@/utils/locales'
3-
import {Trans} from '@lingui/macro'
43
import {GetStaticPropsContext} from 'next'
54
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";
68

79
const vazirmatn = Vazirmatn({ subsets: ['latin', 'arabic'] })
810

911
export default function Home() {
12+
const { i18n } = useLingui()
13+
1014
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>
3042
</div>
3143
</div>
32-
</div>
33-
</section>
34-
</main>
44+
</section>
45+
</main>
46+
</>
3547
)
3648
}
3749

0 commit comments

Comments
 (0)