Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: lingui/js-lingui
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.10.1
Choose a base ref
...
head repository: lingui/js-lingui
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.11.0
Choose a head ref
  • 5 commits
  • 45 files changed
  • 5 contributors

Commits on May 14, 2024

  1. fix: exclude .scss files from extract-experimental build (#1935)

    panbenson authored May 14, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d01fa96 View commit details
  2. feat(format-po): configure header attributes in PO file formatter (#1934

    )
    mariarchy authored May 14, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d90f778 View commit details

Commits on May 16, 2024

  1. fix: default message extraction (#1936)

    aseerkt authored May 16, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    8f1ddd7 View commit details
  2. fix(message-utils): correctly handle multi-digit complex argument cas…

    …es (#1937)
    
    * test: include failing tests for complex argument cases
    
    * fix: correctly handle multi digit complex argument cases
    
    * perf: replace regular expression with plain js
    Bertg authored May 16, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    47a0dde View commit details

Commits on May 17, 2024

  1. chore(release): published v4.11.0 [skip ci]

    lingui-bot committed May 17, 2024
    Copy the full SHA
    8668ba8 View commit details
Showing with 232 additions and 91 deletions.
  1. +12 −0 CHANGELOG.md
  2. +1 −1 lerna.json
  3. +4 −0 packages/babel-plugin-extract-messages/CHANGELOG.md
  4. +1 −1 packages/babel-plugin-extract-messages/package.json
  5. +7 −0 packages/cli/CHANGELOG.md
  6. +7 −7 packages/cli/package.json
  7. +4 −3 packages/cli/src/api/catalog/extractFromFiles.ts
  8. +1 −0 packages/cli/src/extract-experimental/bundleSource.ts
  9. +6 −0 packages/cli/test/extract-po-format/expected/en.po
  10. +6 −0 packages/cli/test/extract-po-format/expected/pl.po
  11. +4 −1 packages/cli/test/extract-po-format/fixtures/file-a.ts
  12. +2 −2 packages/cli/test/index.test.ts
  13. +4 −0 packages/conf/CHANGELOG.md
  14. +1 −1 packages/conf/package.json
  15. +6 −0 packages/core/CHANGELOG.md
  16. +2 −2 packages/core/package.json
  17. +3 −1 packages/core/src/interpolate.test.ts
  18. +4 −0 packages/detect-locale/CHANGELOG.md
  19. +1 −1 packages/detect-locale/package.json
  20. +4 −0 packages/extractor-vue/CHANGELOG.md
  21. +4 −4 packages/extractor-vue/package.json
  22. +4 −0 packages/format-csv/CHANGELOG.md
  23. +2 −2 packages/format-csv/package.json
  24. +4 −0 packages/format-json/CHANGELOG.md
  25. +2 −2 packages/format-json/package.json
  26. +4 −0 packages/format-po-gettext/CHANGELOG.md
  27. +4 −4 packages/format-po-gettext/package.json
  28. +6 −0 packages/format-po/CHANGELOG.md
  29. +7 −0 packages/format-po/README.md
  30. +3 −3 packages/format-po/package.json
  31. +21 −0 packages/format-po/src/po.test.ts
  32. +15 −2 packages/format-po/src/po.ts
  33. +4 −0 packages/loader/CHANGELOG.md
  34. +4 −4 packages/loader/package.json
  35. +4 −0 packages/macro/CHANGELOG.md
  36. +4 −4 packages/macro/package.json
  37. +6 −0 packages/message-utils/CHANGELOG.md
  38. +1 −1 packages/message-utils/package.json
  39. +3 −1 packages/message-utils/src/compileMessage.test.ts
  40. +3 −5 packages/message-utils/src/compileMessage.ts
  41. +4 −0 packages/react/CHANGELOG.md
  42. +2 −2 packages/react/package.json
  43. +4 −0 packages/vite-plugin/CHANGELOG.md
  44. +3 −3 packages/vite-plugin/package.json
  45. +34 −34 yarn.lock
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.11.0](https://github.com/lingui/js-lingui/compare/v4.10.1...v4.11.0) (2024-05-17)

### Bug Fixes

- default message extraction ([#1936](https://github.com/lingui/js-lingui/issues/1936)) ([8f1ddd7](https://github.com/lingui/js-lingui/commit/8f1ddd787b79510b112b87c21d4a23b875722edc))
- exclude .scss files from extract-experimental build ([#1935](https://github.com/lingui/js-lingui/issues/1935)) ([d01fa96](https://github.com/lingui/js-lingui/commit/d01fa969622605e40f417a85b98bce1f88771445))
- **message-utils:** correctly handle multi-digit complex argument cases ([#1937](https://github.com/lingui/js-lingui/issues/1937)) ([47a0dde](https://github.com/lingui/js-lingui/commit/47a0dded190fa990ea21239a464073348209b8f0))

### Features

- **format-po:** configure header attributes in PO file formatter ([#1934](https://github.com/lingui/js-lingui/issues/1934)) ([d90f778](https://github.com/lingui/js-lingui/commit/d90f77813381e8a74dc9e16662a3ce384c683493))

## [4.10.1](https://github.com/lingui/js-lingui/compare/v4.10.0...v4.10.1) (2024-05-03)

### Bug Fixes
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "4.10.1",
"version": "4.11.0",
"packages": ["packages/*"],
"npmClient": "yarn",
"useWorkspaces": true,
4 changes: 4 additions & 0 deletions packages/babel-plugin-extract-messages/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.11.0](https://github.com/lingui/js-lingui/compare/v4.10.1...v4.11.0) (2024-05-17)

**Note:** Version bump only for package @lingui/babel-plugin-extract-messages

## [4.10.1](https://github.com/lingui/js-lingui/compare/v4.10.0...v4.10.1) (2024-05-03)

**Note:** Version bump only for package @lingui/babel-plugin-extract-messages
2 changes: 1 addition & 1 deletion packages/babel-plugin-extract-messages/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingui/babel-plugin-extract-messages",
"version": "4.10.1",
"version": "4.11.0",
"description": "Babel plugin for collecting messages from source code for internationalization",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
7 changes: 7 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.11.0](https://github.com/lingui/js-lingui/compare/v4.10.1...v4.11.0) (2024-05-17)

### Bug Fixes

- default message extraction ([#1936](https://github.com/lingui/js-lingui/issues/1936)) ([8f1ddd7](https://github.com/lingui/js-lingui/commit/8f1ddd787b79510b112b87c21d4a23b875722edc))
- exclude .scss files from extract-experimental build ([#1935](https://github.com/lingui/js-lingui/issues/1935)) ([d01fa96](https://github.com/lingui/js-lingui/commit/d01fa969622605e40f417a85b98bce1f88771445))

## [4.10.1](https://github.com/lingui/js-lingui/compare/v4.10.0...v4.10.1) (2024-05-03)

**Note:** Version bump only for package @lingui/cli
14 changes: 7 additions & 7 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingui/cli",
"version": "4.10.1",
"version": "4.11.0",
"description": "CLI for working wit message catalogs",
"keywords": [
"cli",
@@ -53,11 +53,11 @@
"@babel/parser": "^7.21.2",
"@babel/runtime": "^7.21.0",
"@babel/types": "^7.21.2",
"@lingui/babel-plugin-extract-messages": "4.10.1",
"@lingui/conf": "4.10.1",
"@lingui/core": "4.10.1",
"@lingui/format-po": "4.10.1",
"@lingui/message-utils": "4.10.1",
"@lingui/babel-plugin-extract-messages": "4.11.0",
"@lingui/conf": "4.11.0",
"@lingui/core": "4.11.0",
"@lingui/format-po": "4.11.0",
"@lingui/message-utils": "4.11.0",
"babel-plugin-macros": "^3.0.1",
"chalk": "^4.1.0",
"chokidar": "3.5.1",
@@ -80,7 +80,7 @@
},
"devDependencies": {
"@lingui/jest-mocks": "*",
"@lingui/macro": "4.10.1",
"@lingui/macro": "4.11.0",
"@types/convert-source-map": "^2.0.0",
"@types/glob": "^8.1.0",
"@types/micromatch": "^4.0.1",
7 changes: 4 additions & 3 deletions packages/cli/src/api/catalog/extractFromFiles.ts
Original file line number Diff line number Diff line change
@@ -3,11 +3,11 @@ import type {
ExtractorType,
LinguiConfigNormalized,
} from "@lingui/conf"
import extract from "../extractors"
import path from "path"
import chalk from "chalk"
import path from "path"
import extract from "../extractors"
import { ExtractedCatalogType, MessageOrigin } from "../types"
import { prettyOrigin } from "../utils"
import { MessageOrigin, ExtractedCatalogType } from "../types"

export async function extractFromFiles(
paths: string[],
@@ -50,6 +50,7 @@ export async function extractFromFiles(

messages[next.id] = {
...prev,
message: prev.message ?? next.message,
comments: next.comment
? [...prev.comments, next.comment]
: prev.comments,
1 change: 1 addition & 0 deletions packages/cli/src/extract-experimental/bundleSource.ts
Original file line number Diff line number Diff line change
@@ -32,6 +32,7 @@ export async function bundleSource(
"png",
"css",
"sass",
"scss",
"less",
"jpg",
]
6 changes: 6 additions & 0 deletions packages/cli/test/extract-po-format/expected/en.po
Original file line number Diff line number Diff line change
@@ -7,6 +7,12 @@ msgstr ""
"X-Generator: @lingui/cli\n"
"Language: en\n"

#. js-lingui-explicit-id
#: fixtures/file-a.ts:22
#: fixtures/file-a.ts:23
msgid "addToCart"
msgstr "Add To Cart"

#. this is a comment
#: fixtures/file-b.tsx:6
msgid "Hello this is JSX Translation"
6 changes: 6 additions & 0 deletions packages/cli/test/extract-po-format/expected/pl.po
Original file line number Diff line number Diff line change
@@ -7,6 +7,12 @@ msgstr ""
"X-Generator: @lingui/cli\n"
"Language: pl\n"

#. js-lingui-explicit-id
#: fixtures/file-a.ts:22
#: fixtures/file-a.ts:23
msgid "addToCart"
msgstr ""

#. this is a comment
#: fixtures/file-b.tsx:6
msgid "Hello this is JSX Translation"
5 changes: 4 additions & 1 deletion packages/cli/test/extract-po-format/fixtures/file-a.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineMessage, t } from "@lingui/macro"
import { i18n } from "@lingui/core"
import { defineMessage, t } from "@lingui/macro"

const msg = t`Hello world`

@@ -18,3 +18,6 @@ const msgDescriptor = defineMessage({
})

i18n._(msgDescriptor)

i18n._("addToCart")
i18n._({id: "addToCart", message: "Add To Cart"})
4 changes: 2 additions & 2 deletions packages/cli/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -69,8 +69,8 @@ describe("E2E Extractor Test", () => {
┌─────────────┬─────────────┬─────────┐
│ Language │ Total count │ Missing │
├─────────────┼─────────────┼─────────┤
│ en (source) │ 7 │ - │
│ pl │ 77
│ en (source) │ 8 │ - │
│ pl │ 88
└─────────────┴─────────────┴─────────┘
(use "yarn extract" to update catalogs with new messages)
4 changes: 4 additions & 0 deletions packages/conf/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.11.0](https://github.com/lingui/js-lingui/compare/v4.10.1...v4.11.0) (2024-05-17)

**Note:** Version bump only for package @lingui/conf

## [4.10.1](https://github.com/lingui/js-lingui/compare/v4.10.0...v4.10.1) (2024-05-03)

**Note:** Version bump only for package @lingui/conf
2 changes: 1 addition & 1 deletion packages/conf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingui/conf",
"version": "4.10.1",
"version": "4.11.0",
"sideEffects": false,
"description": "Get lingui configuration from package.json",
"keywords": [
6 changes: 6 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.11.0](https://github.com/lingui/js-lingui/compare/v4.10.1...v4.11.0) (2024-05-17)

### Bug Fixes

- **message-utils:** correctly handle multi-digit complex argument cases ([#1937](https://github.com/lingui/js-lingui/issues/1937)) ([47a0dde](https://github.com/lingui/js-lingui/commit/47a0dded190fa990ea21239a464073348209b8f0))

## [4.10.1](https://github.com/lingui/js-lingui/compare/v4.10.0...v4.10.1) (2024-05-03)

### Bug Fixes
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingui/core",
"version": "4.10.1",
"version": "4.11.0",
"sideEffects": false,
"description": "I18n tools for javascript",
"main": "./dist/index.cjs",
@@ -54,7 +54,7 @@
],
"dependencies": {
"@babel/runtime": "^7.20.13",
"@lingui/message-utils": "4.10.1",
"@lingui/message-utils": "4.11.0",
"unraw": "^3.0.0"
},
"devDependencies": {
4 changes: 3 additions & 1 deletion packages/core/src/interpolate.test.ts
Original file line number Diff line number Diff line change
@@ -39,10 +39,12 @@ describe("interpolate", () => {

it("should interpolate plurals", () => {
const plural = prepare(
"{value, plural, one {{value} Book} other {# Books}}"
"{value, plural, one {{value} Book} =4 {Four books} =99 { Books with problems } other {# Books}}"
)
expect(plural({ value: 1 })).toEqual("1 Book")
expect(plural({ value: 2 })).toEqual("2 Books")
expect(plural({ value: 4 })).toEqual("Four books")
expect(plural({ value: 99 })).toEqual("Books with problems")

const offset = prepare(
"{value, plural, offset:1 =0 {No Books} one {# Book} other {# Books}}"
4 changes: 4 additions & 0 deletions packages/detect-locale/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.11.0](https://github.com/lingui/js-lingui/compare/v4.10.1...v4.11.0) (2024-05-17)

**Note:** Version bump only for package @lingui/detect-locale

## [4.10.1](https://github.com/lingui/js-lingui/compare/v4.10.0...v4.10.1) (2024-05-03)

**Note:** Version bump only for package @lingui/detect-locale
2 changes: 1 addition & 1 deletion packages/detect-locale/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingui/detect-locale",
"version": "4.10.1",
"version": "4.11.0",
"sideEffects": false,
"description": "@Lingui package to help you find the correct browser/server locale",
"main": "./dist/index.cjs",
4 changes: 4 additions & 0 deletions packages/extractor-vue/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.11.0](https://github.com/lingui/js-lingui/compare/v4.10.1...v4.11.0) (2024-05-17)

**Note:** Version bump only for package @lingui/extractor-vue

## [4.10.1](https://github.com/lingui/js-lingui/compare/v4.10.0...v4.10.1) (2024-05-03)

**Note:** Version bump only for package @lingui/extractor-vue
8 changes: 4 additions & 4 deletions packages/extractor-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingui/extractor-vue",
"version": "4.10.1",
"version": "4.11.0",
"description": "Custom Vue.js extractor to be used with the CLI tool",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
@@ -38,12 +38,12 @@
"/dist"
],
"dependencies": {
"@lingui/cli": "4.10.1",
"@lingui/conf": "4.10.1",
"@lingui/cli": "4.11.0",
"@lingui/conf": "4.11.0",
"@vue/compiler-sfc": "^3.2.47"
},
"devDependencies": {
"@lingui/babel-plugin-extract-messages": "4.10.1",
"@lingui/babel-plugin-extract-messages": "4.11.0",
"unbuild": "2.0.0"
}
}
4 changes: 4 additions & 0 deletions packages/format-csv/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.11.0](https://github.com/lingui/js-lingui/compare/v4.10.1...v4.11.0) (2024-05-17)

**Note:** Version bump only for package @lingui/format-csv

## [4.10.1](https://github.com/lingui/js-lingui/compare/v4.10.0...v4.10.1) (2024-05-03)

**Note:** Version bump only for package @lingui/format-csv
4 changes: 2 additions & 2 deletions packages/format-csv/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingui/format-csv",
"version": "4.10.1",
"version": "4.11.0",
"description": "CSV format for Lingui Catalogs",
"main": "./dist/csv.cjs",
"module": "./dist/csv.mjs",
@@ -39,7 +39,7 @@
"dist/"
],
"dependencies": {
"@lingui/conf": "4.10.1",
"@lingui/conf": "4.11.0",
"papaparse": "^5.4.0"
},
"devDependencies": {
4 changes: 4 additions & 0 deletions packages/format-json/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.11.0](https://github.com/lingui/js-lingui/compare/v4.10.1...v4.11.0) (2024-05-17)

**Note:** Version bump only for package @lingui/format-json

## [4.10.1](https://github.com/lingui/js-lingui/compare/v4.10.0...v4.10.1) (2024-05-03)

**Note:** Version bump only for package @lingui/format-json
4 changes: 2 additions & 2 deletions packages/format-json/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingui/format-json",
"version": "4.10.1",
"version": "4.11.0",
"description": "JSON format for Lingui Catalogs",
"main": "./dist/json.cjs",
"module": "./dist/json.mjs",
@@ -39,7 +39,7 @@
"dist/"
],
"dependencies": {
"@lingui/conf": "4.10.1",
"@lingui/conf": "4.11.0",
"ramda": "^0.28.0"
},
"devDependencies": {
4 changes: 4 additions & 0 deletions packages/format-po-gettext/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.11.0](https://github.com/lingui/js-lingui/compare/v4.10.1...v4.11.0) (2024-05-17)

**Note:** Version bump only for package @lingui/format-po-gettext

## [4.10.1](https://github.com/lingui/js-lingui/compare/v4.10.0...v4.10.1) (2024-05-03)

**Note:** Version bump only for package @lingui/format-po-gettext
8 changes: 4 additions & 4 deletions packages/format-po-gettext/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingui/format-po-gettext",
"version": "4.10.1",
"version": "4.11.0",
"description": "Gettext PO format with gettext-style plurals for Lingui Catalogs",
"main": "./dist/po-gettext.cjs",
"module": "./dist/po-gettext.mjs",
@@ -41,9 +41,9 @@
"dist/"
],
"dependencies": {
"@lingui/conf": "4.10.1",
"@lingui/format-po": "4.10.1",
"@lingui/message-utils": "4.10.1",
"@lingui/conf": "4.11.0",
"@lingui/format-po": "4.11.0",
"@lingui/message-utils": "4.11.0",
"@messageformat/parser": "^5.0.0",
"node-gettext": "^3.0.0",
"plurals-cldr": "^2.0.1",
6 changes: 6 additions & 0 deletions packages/format-po/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.11.0](https://github.com/lingui/js-lingui/compare/v4.10.1...v4.11.0) (2024-05-17)

### Features

- **format-po:** configure header attributes in PO file formatter ([#1934](https://github.com/lingui/js-lingui/issues/1934)) ([d90f778](https://github.com/lingui/js-lingui/commit/d90f77813381e8a74dc9e16662a3ce384c683493))

## [4.10.1](https://github.com/lingui/js-lingui/compare/v4.10.0...v4.10.1) (2024-05-03)

**Note:** Version bump only for package @lingui/format-po
Loading