Skip to content

Commit

Permalink
Merge branch 'main' into vitest
Browse files Browse the repository at this point in the history
# Conflicts:
#	jest.config.js
#	package.json
#	packages/cli/src/api/__snapshots__/compile.test.ts.snap
#	packages/cli/src/api/extractors/index.ts
#	packages/conf/src/__snapshots__/index.test.ts.snap
#	packages/core/src/i18n.test.ts
#	packages/extractor-vue/package.json
#	packages/message-utils/src/compileMessage.test.ts
#	packages/vite-plugin/package.json
#	yarn.lock
  • Loading branch information
timofei-iatsenko committed Dec 23, 2024
2 parents 4dffd13 + 1cb5ecd commit 349e28d
Show file tree
Hide file tree
Showing 259 changed files with 22,946 additions and 12,270 deletions.
9 changes: 0 additions & 9 deletions .eslintignore

This file was deleted.

26 changes: 0 additions & 26 deletions .eslintrc

This file was deleted.

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ coverage/
website/
.github
examples
/.nx/workspace-data
58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,64 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [5.1.2](https://github.com/lingui/js-lingui/compare/v5.1.1...v5.1.2) (2024-12-16)

**Note:** Version bump only for package js-lingui-workspaces

## [5.1.1](https://github.com/lingui/js-lingui/compare/v5.1.0...v5.1.1) (2024-12-16)

**Note:** Version bump only for package js-lingui-workspaces

# [5.1.0](https://github.com/lingui/js-lingui/compare/v5.0.0...v5.1.0) (2024-12-06)

### Features

- **react:** add support for React 19 ([#2111](https://github.com/lingui/js-lingui/issues/2111)) ([e93b73d](https://github.com/lingui/js-lingui/commit/e93b73d075165d91fa598fa0c579a8ceb5c86845))
- **vite-plugin:** add support for vite@6 ([#2108](https://github.com/lingui/js-lingui/issues/2108)) ([38a0c6f](https://github.com/lingui/js-lingui/commit/38a0c6f8b7f4d961f1580228310f4ebe959eb5a5))

## [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

- don't report statistics for pseudo locale ([#2094](https://github.com/lingui/js-lingui/issues/2094)) ([113c05d](https://github.com/lingui/js-lingui/commit/113c05d91dba210b73444f4824c47d2709f8f5cf))

# [4.14.0](https://github.com/lingui/js-lingui/compare/v4.13.0...v4.14.0) (2024-11-07)

### Bug Fixes

- **extract:** when files are used, don't overwrite obsolete ([#1964](https://github.com/lingui/js-lingui/issues/1964)) ([e726b16](https://github.com/lingui/js-lingui/commit/e726b16a2a9299913d386489d92e0daa9c42e40d))

### Features

- **format-po-gettext:** respect Plural-Forms header ([#2070](https://github.com/lingui/js-lingui/issues/2070)) ([5d0516e](https://github.com/lingui/js-lingui/commit/5d0516e5ee8de5bd4369e8760b4a5c77259853db))

# [4.13.0](https://github.com/lingui/js-lingui/compare/v4.12.0...v4.13.0) (2024-10-15)

### Features

- adds custom prefix support for gettext po ([#2004](https://github.com/lingui/js-lingui/issues/2004)) ([25b3bc6](https://github.com/lingui/js-lingui/commit/25b3bc60b6b793cd0ef15c25f760de9fef7a6750))

# [4.12.0](https://github.com/lingui/js-lingui/compare/v4.11.4...v4.12.0) (2024-10-11)

### Bug Fixes

- unicode parsing ([#2030](https://github.com/lingui/js-lingui/issues/2030)) ([0ac26cc](https://github.com/lingui/js-lingui/commit/0ac26ccf6c0fce7a25950f5643e2d9937dd0b031))

### Features

- add metro transformer ([#1999](https://github.com/lingui/js-lingui/issues/1999)) ([cc7fe27](https://github.com/lingui/js-lingui/commit/cc7fe2744495e69984bf6839e217cb4216f004ce))
- enable importAttributes and explicitResourceManagement for extractor ([#2009](https://github.com/lingui/js-lingui/issues/2009)) ([c20ce12](https://github.com/lingui/js-lingui/commit/c20ce12dbc3edaf476fd745df7e8f8b1390afe95))

## [4.11.4](https://github.com/lingui/js-lingui/compare/v4.11.3...v4.11.4) (2024-09-02)

### Bug Fixes
Expand Down
71 changes: 19 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,57 +19,35 @@
>
> --- [ W3C Web Internationalization FAQ](https://www.w3.org/International/questions/qa-i18n)
Lingui is an easy yet powerful internationalization framework for global projects.
Lingui is an easy yet powerful internationalization (i18n) 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

Expand All @@ -95,15 +73,16 @@ msgid "msg.docs"
msgstr "Read the <0>documentation</0> for more info."
```

For more example see the [Examples][Examples] directory.
For more example see the [Examples](https://github.com/lingui/js-lingui/tree/main/examples) directory.

## Support

If you are having issues, please let us know.

- Join us on [Discord](https://discord.gg/gFWwAYnMtA) to chat with the community.
- Ask questions on [StackOverflow](https://stackoverflow.com/questions/ask?tags=linguijs) and mark it with [Lingui](https://stackoverflow.com/questions/tagged/linguijs) tag.
- Join us on [Discord][Discord] to chat with the community.
- Ask questions on [StackOverflow](https://stackoverflow.com/questions/ask?tags=linguijs) and mark it with the [`linguijs`](https://stackoverflow.com/questions/tagged/linguijs) tag.
- If something doesn't work as documented, documentation is missing or if you just want to suggest a new feature, [create an issue][Issues].
- You can also [Ask Lingui JS Guru](https://gurubase.io/g/lingui-js), it is a Lingui JS focused AI to answer your questions.

## Contribute

Expand All @@ -123,17 +102,7 @@ This project exists thanks to [all the people][Contributors] who contribute. [[C
The project is licensed under the [MIT][License] license.

[Documentation]: https://lingui.dev
[TutorialReact]: https://lingui.dev/tutorials/react
[TutorialReactNative]: https://lingui.dev/tutorials/react-native
[TutorialJavaScript]: https://lingui.dev/tutorials/javascript
[CLI]: https://lingui.dev/ref/cli
[TutorialSetupReact]: https://lingui.dev/tutorials/setup-react
[SetupVite]: https://lingui.dev/tutorials/setup-vite
[RefCLI]: https://lingui.dev/ref/cli
[Examples]: https://github.com/lingui/js-lingui/tree/main/examples
[SWCPlugin]: https://lingui.dev/ref/swc-plugin
[VitePlugin]: https://lingui.dev/ref/vite-plugin
[ESLintPlugin]: https://lingui.dev/ref/eslint-plugin
[Badge-MainSuite-GithubCI]: https://github.com/lingui/js-lingui/workflows/main-suite/badge.svg
[Badge-ReleaseWorkflowTesting-GithubCI]: https://github.com/lingui/js-lingui/workflows/release-workflow-test/badge.svg
[Badge-Coverage]: https://img.shields.io/codecov/c/github/lingui/js-lingui/main.svg
Expand All @@ -145,6 +114,4 @@ The project is licensed under the [MIT][License] license.
[Contributing]: https://github.com/lingui/js-lingui/blob/main/CONTRIBUTING.md
[Issues]: https://github.com/lingui/js-lingui/issues/new/choose
[PRWelcome]: http://makeapullrequest.com
[BundleReact]: https://bundlephobia.com/result?p=@lingui/react
[BundleCore]: https://bundlephobia.com/result?p=@lingui/core
[Discord]: https://discord.gg/gFWwAYnMtA
62 changes: 62 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import pluginJs from "@eslint/js"
import tseslint from "typescript-eslint"
import pluginReact from "eslint-plugin-react"
import { config } from "typescript-eslint"
import importPlugin from "eslint-plugin-import"

export default config(
{ files: ["./packages/**/*.{ts,tsx,js,jsx}"] },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
{
plugins: {
import: importPlugin,
},
},
importPlugin.flatConfigs.typescript,
{
ignores: [
"**/dist/*",
"**/fixtures/*",
"**/locale/*",
"**/test/**/expected/*",
"**/test/**/actual/*",
],
},
{
rules: {
"@typescript-eslint/no-unused-expressions": [
"error",
{
allowShortCircuit: true,
allowTernary: true,
},
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-unused-vars": "off",
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: [
"**/test/**",
"**/*.test.{ts,tsx}",
"**/*.test-d.{ts,tsx}",
"**/vite.config.ts",
],
},
],
"no-undef": "off",
},
},
{
files: ["**/*.test-d.{ts,tsx}", "**/*.test.{ts,tsx}", "eslint.config.mjs"],
rules: {
"import/no-extraneous-dependencies": "off",
},
},
{
files: ["./packages/react/*.{ts,tsx,js,jsx}"],
...pluginReact.configs.flat.recommended,
}
)
2 changes: 1 addition & 1 deletion examples/js/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
presets: ["@babel/env"],
plugins: ["macros"],
plugins: ["@lingui/babel-plugin-lingui-macro"],
}
6 changes: 3 additions & 3 deletions examples/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"extract": "lingui extract --clean"
},
"dependencies": {
"@lingui/core": "^4.1.2"
"@lingui/core": "^5.0.0-next.3"
},
"devDependencies": {
"@babel/core": "^7.20.12",
"@babel/preset-env": "^7.20.2",
"@lingui/cli": "^4.1.2",
"babel-plugin-macros": "^3.1.0",
"@lingui/babel-plugin-lingui-macro": "^5.0.0-next.3",
"@lingui/cli": "^5.0.0-next.3",
"jest": "^29.5.0"
}
}
Loading

0 comments on commit 349e28d

Please sign in to comment.