diff --git a/.github/workflows/main-suite.yml b/.github/workflows/main-suite.yml
index 9dc281853..a244c85d1 100644
--- a/.github/workflows/main-suite.yml
+++ b/.github/workflows/main-suite.yml
@@ -15,7 +15,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
- node: ["16", "18", "19", "20"]
+ node: ["20", "22"]
os: [ubuntu-latest, windows-latest]
steps:
diff --git a/.prettierignore b/.prettierignore
index 96d87a6b2..9afd6010b 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -11,3 +11,4 @@ coverage/
website/
.github
examples
+/.nx/workspace-data
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6177e7d0f..57466502e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## [5.0.0](https://github.com/lingui/js-lingui/compare/v4.14.1...v5.0.0) (2024-11-28)
+
+We are pleased to announce the release of Lingui 5.0! This release is a **major milestone** for the project and includes a number of new features, improvements and bug fixes.
+
+Check out the links below for more details:
+
+- [Blog Post: Announcing Lingui 5.0](https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0)
+- [Migration Guide from 4.x to 5.x](https://lingui.dev/releases/migration-5)
+- [Full Changelog](https://github.com/lingui/js-lingui/compare/v4.14.1...v5.0.0)
+
## [4.14.1](https://github.com/lingui/js-lingui/compare/v4.14.0...v4.14.1) (2024-11-28)
### Bug Fixes
diff --git a/README.md b/README.md
index 0f1f3a9b5..e21003f20 100644
--- a/README.md
+++ b/README.md
@@ -12,78 +12,56 @@
[![Join the community on Discord][Badge-Discord]][Discord]
[**Documentation**][Documentation] · [**Quickstart**](#quickstart) · [**Example**](#example) · [**Support**](#support) · [**Contribute**](#contribute) · [**License**](#license)
+
> Internationalization is the design and development of a product, application or document content that enables easy localization for target audiences that vary in culture, region, or language.
>
> --- [ W3C Web Internationalization FAQ](https://www.w3.org/International/questions/qa-i18n)
+Lingui is an easy yet powerful internationalization (i18n) framework for global projects.
-Lingui is an easy yet powerful internationalization framework for global projects.
-
-- **Clean and readable** - Keep your code clean and readable, while the library uses
- battle-tested and powerful **ICU MessageFormat** under the hood.
+- **Clean and readable** - Keep your code clean and readable, while the library uses battle-tested and powerful **ICU MessageFormat** under the hood.
-- **Universal** - Use it everywhere. `@lingui/core` provides the essential intl
- functionality which works in any JavaScript project while `@lingui/react` offers
- components to leverage React rendering.
+- **Universal** - Use it everywhere. `@lingui/core` provides the essential intl functionality which works in any JavaScript project while `@lingui/react` offers components to leverage React rendering, including React Server Components (RSC) support.
-- **Full rich-text support** - Use React components inside localized messages
- without any limitation. Writing rich-text messages is as easy as writing JSX.
+- **Full rich-text support** - Use React components inside localized messages without any limitation. Writing rich-text messages is as easy as writing JSX.
-- **Powerful tooling** - Manage the whole intl workflow using Lingui [CLI][RefCLI]. It
- extracts messages from source code, validates messages coming from translators and
- checks that all messages are translated before shipping to production.
+- **Powerful tooling** - Manage your intl workflow with the Lingui [CLI](https://lingui.dev/ref/cli), [Vite Plugin](https://lingui.dev/ref/vite-plugin), and [ESLint Plugin](https://lingui.dev/ref/eslint-plugin). The CLI extracts, compiles and validates messages, while the Vite plugin compiles catalogs on the fly, and the ESLint plugin helps catch common usage errors.
-- **Unopinionated** - Integrate Lingui into your existing workflow. It supports
- message keys as well as auto-generated messages. Translations are stored either in
- JSON or standard PO files, which are supported in almost all translation tools.
+- **Unopinionated** - Integrate Lingui into your existing workflow. It supports message keys as well as auto-generated messages. Translations are stored either in JSON or standard PO files, which are supported in almost all translation tools.
-- **Lightweight and optimized** - Core library is only [1.5 kB gzipped][BundleCore],
- React components are an additional [1.3 kBs gzipped][BundleReact]. That's less than Redux
- for a full-featured intl library.
+- **Lightweight and optimized** - Core library is less than [3 kB gzipped](https://bundlephobia.com/result?p=@lingui/core), React components are additional [1.4 kB gzipped](https://bundlephobia.com/result?p=@lingui/react).
-- **Active community** - Join us on [Discord][Discord] to discuss the latest development.
- At the moment, Lingui is the most active intl project on GitHub.
+- **Active community** - Join the growing [community of developers](https://lingui.dev/community) who are using Lingui to build global products.
-- **Compatible with react-intl** - Low-level React API is very similar to react-intl
- and the message format is the same. It's easy to migrate an existing project.
+- **Compatible with react-intl** - Low-level React API is very similar to react-intl and the message format is the same. It's easy to migrate an existing project.
## Quickstart
-### Install
-
-- [React projects][TutorialSetupReact]
-- [Vite project][SetupVite]
+1. [Introduction](https://lingui.dev/introduction)
+2. [Installation and Setup](https://lingui.dev/installation)
### Tutorials
-- [React][TutorialReact]
-- [React Native][TutorialReactNative]
-- [Plain JavaScript][TutorialJavaScript]
-- [Working with Command Line Tool][CLI]
-
-### Plugins
-
-- [SWC Plugin][SWCPlugin]
-- [Vite Plugin][VitePlugin]
-- [ESLint Plugin](ESLintPlugin)
-
-If you're a react-intl user, check out [a comparison of react-intl and Lingui](https://lingui.dev/misc/react-intl).
+- [React](https://lingui.dev/tutorials/react)
+- [React Server Components](https://lingui.dev/tutorials/react-rsc)
+- [React Native](https://lingui.dev/tutorials/react-native)
+- [JavaScript](https://lingui.dev/tutorials/javascript)
## Example
Short example how i18n looks with JSX:
```js
-import { Trans } from "@lingui/macro"
+import { Trans } from "@lingui/react/macro"
function App() {
return (
-
-
-
- My name is {{" "}} - {{name}} -
` - ) - - expect(actual).toBe( - `Hello World!My name is {{" "}}{{name}}
` - ) - }) - - it("should remove whitespace before/after tag", () => { - const actual = normalizeWhitespace( - `Property {0}, - function {1}, - array {2}, - constant {3}, - object {4}, - everything {5}` - ) - - expect(actual).toBe( - `Property {0}, function {1}, array {2}, constant {3}, object {4}, everything {5}` - ) - }) - - it("should remove trailing whitespaces in icu expressions", () => { - const actual = normalizeWhitespace( - `{count, plural, one { - - <0>#0> slot added - - } other { - - <1>#1> slots added - - }} -` - ) - - expect(actual).toBe( - `{count, plural, one {<0>#0> slot added} other {<1>#1> slots added}}` - ) - }) - - it("should remove leading whitespaces in icu expressions", () => { - const actual = normalizeWhitespace( - `{count, plural, one { - - One hello - - } other { - - Other hello - - }} -` - ) - - expect(actual).toBe( - `{count, plural, one {One hello} other {Other hello}}` - ) - }) - }) - describe("tokenizeTrans", () => { it("simple message without arguments", () => { const macro = createMacro() @@ -195,7 +124,7 @@ describe("jsx macro", () => { const exp = parseExpression( "