All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.
5.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:
4.14.1 (2024-11-28)
4.14.0 (2024-11-07)
4.13.0 (2024-10-15)
4.12.0 (2024-10-11)
- add metro transformer (#1999) (cc7fe27)
- enable importAttributes and explicitResourceManagement for extractor (#2009) (c20ce12)
4.11.4 (2024-09-02)
- cli: use caret range for
micromatch
dependency (#2020) (be441e3) - escape nested brackets (#2001) (6d00301)
- return a single node when applicable (#2016) (68d8358)
- run type tests in test:all (#2017) (b9e89c1)
4.11.3 (2024-08-09)
- cli: add pnpm detection to command suggestions (#1989) (287a688)
- extract: escape special regex characters used in file-based routing systems when files are passed in options (#1984) (fd92d20)
4.11.2 (2024-07-03)
- cli: update translationIO service in CLI package (to handle context) (#1949) (ea7b9e7)
- include type cast on ts compilation (#1962) (0f66617)
4.11.1 (2024-05-30)
4.11.0 (2024-05-17)
- default message extraction (#1936) (8f1ddd7)
- exclude .scss files from extract-experimental build (#1935) (d01fa96)
- message-utils: correctly handle multi-digit complex argument cases (#1937) (47a0dde)
4.10.1 (2024-05-03)
4.10.0 (2024-04-12)
4.9.0 (2024-04-12)
4.8.0 (2024-04-03)
4.7.2 (2024-03-26)
- allow parentheses in catalog pathnames (#1890) (d6b9698)
- typo: Correct typo in build script of nextjs-swc example (#1885) (7473bc4)
4.7.1 (2024-02-20)
- compile should generate a TS file (#1851) (e4fbd59)
- core: use named instead of default export for unraw lib (#1837) (85f0944)
- don't replace octothorpe coming from variable (#1850) (e321729)
4.7.0 (2024-01-05)
- allow parentheses in catalog pathnames (#1820) (f5fae0e)
- double render due to wrong assertion (#1817) (8830f2e)
- double render due to wrong assertion (#1824) (bd8ad11)
- warnings about invalid dependencies on Windows (#1828) (5f07937)
4.6.0 (2023-12-01)
- cli: import type as type (#1802) (960aadb)
- cli: sorting issue when different locales are used on host machines (#1808) (4b8b2a7)
- experimental-extractor: fix ERR_IMPORT_ASSERTION_TYPE_MISSING issue (#1775) (efcd405)
- format-json: ability to set indentation (#1807) (6ee7e63)
- message-utils: make generateMessageId to be working in browser (#1776) (f879ddb)
4.5.0 (2023-09-14)
4.4.2 (2023-08-31)
- Revert "refactor: use useSyncExternalStore to subscribe for context updates (#1746)" (#1755) (4164893), closes #1746 #1755
4.4.1 (2023-08-30)
4.4.0 (2023-08-08)
4.3.0 (2023-06-29)
- allow comment prop on react Trans component (#1718) (3477c32)
- extractor: expose extractFromFileWithBabel function for better flexibility (#1719) (43486dc)
- vite-plugin: report user-friendly error when macro used without transformation (#1720) (53f6a7c)
4.2.1 (2023-06-07)
- core: don't crash on escaped unicode symbols in messages (#1692) (461c2fc)
- extractor: support jsx in js files (#1678) (e335458)
4.2.0 (2023-05-26)
- fallback to
other
only when undefined (#1665) (a79de75) - webpack + vite: fix dependency watching in loader (#1671) (f06cdf5)
4.1.2 (2023-05-17)
4.1.1 (2023-05-17)
4.1.0 (2023-05-15)
- format should follow locale order (#1619) (4d53b7b)
- just use require to import services (#1647) (388c77b)
- message-utils: workaround package.json exports field (#1650) (3bee00c)
- react macro types (#1620) (8a48b9f)
- vue-extractor: don't crash when there is no in an SFC (#1623) (9e6ea70)
- vue-extractor: fix default export burden with /api/extractors/babel (#1626) (045eb21)
- config: show more clear error message when config is not found (#1606) (d84bb8c)
- react native docs (#1506) (eb0ceac)
- Hash-based message ID + Context (#1440)
- Custom Formatters
- Custom Extractors
- Message Extraction guide, experimental dependency tree crawling
- Vue.js Extractor
- macro: support JSX macro inside conditional expressions (#1436)
- macro: support renamed identifiers in macro (#1463)
- extractor: (Experimental): Deps extractor (#1469)
- core (Experimental): add new core API for Node/JS usage without macros (#1564)
- core: support extracting from all forms of
i18n._
/i18n.t
calls (#1586) - extractor: add new package with vue extractor (#1578)
- extractor: support TS experimental decorators (#1517)
- webpack-loader: support JSON catalogs (#1525)
- formats: extract formats into separate packages (#1536)
- macro: support tagged templates in
defineMessage
+ short alias (#1495) - conf: clarify the order by
messageId
and support order bymessage
(#1515) - extractor: allow
i18._(foo.bar)
without warning (#1492) - core: add
i18n.setCatalogAndActivate
for easier nextjs integration (#1541) - macro: allow passing any expression as custom i18n instance (#1475)
- extractor: respect sourcemaps (#1459)
- examples: update examples (nextjs-babel, nextjs-swc, js, create-react-app) (#1550)
- examples: add vite-react-babel example (#1558)
- always honor
process.env.LINGUI_CONFIG
(#1447) - core: use
Intl.PluralRules
instead ofi18n.loadLocaleData
(#1486) - core: do not ignore empty plural values (#1504)
- macro: expression only choices / select options (#1523)
- macro: mark
other
as required forChoiceOptions
(#1527) - react: remove deprecated
defaultProps
from Trans component (#1494) - cli: exclude pseudo locale during sync (#1455)
- react: do not remount children of
I18nProvider
(#1501) - react: support array of react components in values (#1593)
- build: migrate to unbuild (#1545)
- extractor/babel: non-fragile babel extractor options (#1367)
- extractor: don't use intermediate catalogs (#1358)
- macro: Trans inside Plural has leading whitespace (#1437)
- react: remove
withI18n
(#1503) - macro: remove
arg
macro (#1581) - delete Snowpack plugin (#1532)
- Migration Guide
- Full changelog: v3.17.2...v4.0.0
- vite: externalize macro imports (#1466) (1719430)
- vite-plugin: change default export to named export (#1465) (15510c1), closes #1450
- vite-plugin: ship in dual package format for compatibility with Vite (#1450) (e3a2b39)
- chain extract on watched file changes (#1435) (5dd50d3)
- param name for
missing
insetupI18nProps
(#1411) (6459f02) - cli: fix version command (#1413) (8bc212d)
- compile: remove verbose output when using flow with template (#1388) (31316f9)
- conf: lazy load cosmiconfig's TypeScriptLoader (#1403) (617a333)
- Named components not working in Trans in @lingui/react (#1402) (bf7f655)
- build: undeclared dependencies (#1391) (f390ca4)
- conf: proper typescript cosmiconfig loader (#1386) (8da122d)
- macro: JS macros don't strip non-essential props in production (#1389) (0ff55d6)
- implement @lingui/vite-plugin (#1306) (db5d3c3)
- macro: throw useful error message if macro used without a plugin (#1355) (7d55904)
- build: explicitly expose api/extractors (#1349) (59b6c97)
- build: Revert typescript update (#1362) (3f0e61e)
- cli: incorrect main entry in package.json (#1351) (cd430f3)
- core: sub entry export for react-native (#1350) (c178ce3)
- cli: {locale} and {name} replace only once in catalog path (#1342) (9e2d7d2)
- cli: catalogsMergePath doesn't merge catalogs (#1341) (12ad0df)
- Dynamic versioning of internal packages (#1332) (a1ff393)
- macro: Extraction outputting empty objects (#1331) (261265f)
- Local development not working on Windows (ad9b735)
- types:
<Trans>
can have ani18n
props (#1308) (de01f8d) lingui extract
should fail with a non-zero exit code when there are extraction failures (#1299) (c863322)- allow extract to work with i18n._ calls not created from macro (#1309) (90be171)
- add null undefined check (016ff0e)
- allow lingui compile to compile without plural (#1280) (be265ef)
- extract-template async race issue (#1279) (a69ed8f)
- Make pseudolocal use the message AST instead of the key (#1293) (7c85cb7)
- Pass formatter to pluralization function (#1294) (33af3ba)
- remove Node v10, add node v16, fix the fsPromises error (9739e4f)
- Try to add a trailing newline if the file had one (#1260) (da25b94)
- use the 3.9 Python version in the 'deploy-docs' workflow (83d76f3)
- Reduce @lingui/macro CPU and memory usage (#1298) (c993d9e)
- Support GetText template files support during compile (#1296) (5e43810)
- Switch to cosmiconfig-typescript-loader #1247 (118d183)
- Add extra package.json under
/esm
(#1258) (80cd337) - Fix error read properties of undefined (#1239) (8dd2398)
- JSX attribute parsing issue when using html entities (#1234) (98e9332)
- @lingui/react compatible with React 18 (2a235ba)
- JSX attribute parsing issue when using double quotes (#1226) (27a7ded)
- specify children for react v18 types (#1230) (ee69736)
- localeData interpolation broken (457735b)
- add lingui core to macro peer dependencies (#1187) (daaa773)
- cloud service
import()
on case-sensitive filesystems (#1174) (5feb120) - i18n.activate should load instantly new messages (#1182) (f8f47a2)
- remove the obsolete
defineMessages
function from the typings. (#1179) (19b032f) - pin cli-table to 0.3.6 (#1172) (b659b18)
- cli: extract with --overwrite should fallback to key (#1166) (e5e9d59)
- Allow pseudoLocalize to work in @lingui/loader (#1165) (356c224)
- don't push pseudoLocale to translation.io provider (#1161) (5d2186b)
- stripping origin if line numbers already strippped (#1143) (82a3265)
- cli: make extract cmd asynchronous execution (#1170) (f99d8b1)
- add the ability to extract concatenated comments (#1152) (0e553cf)
- msgctxt support (#1094) (8ee42cb)
- #1137: configPath is passed through babel-plugin-extract-messages (#1140) (8921156), closes #1137
- Add missing babel properties to config validation (#1135) (6b2d662)
- 'compile --watch' not watching for correct file based on format (#1088) (ab68c06)
- add extract-template for po-gettext format (#1089) (ea00f55)
- country-coded language breaks plurals with po-gettext (#1131) (6b60b8a)
- extractors CLI validation and accept require and require.resolve (#1126) (c50a06e)
- fallbackLocales to false causing unexpected behaviour (#1123) (60e3952)
- fix testing suite #1098 (1144cc7)
- keys with leading number was generating bad object keys (#1127) (8bb2983)
- no files being found when catalogs.include has more than one entry (#1108) (04efd85)
- sideEffects to false for shrinking bundle size (#1129) (57cd2e5)
- unicode chars were removed from .po files when extracting (#1125) (d688329)
- wrong detect whether a translation is plural (#1119) (48b6644)
- Add debounce option to compile and extract CLI (#1101) (a13334c)
- Cloud service providers & Translation.io (#1107) (cbc87b5)
- add string return type to i18n._ (#1081) (68d32d6)
- remoteLoader pure functional on browser env (#1085) (85856ac)
- remoteLoader should return an object instead of export (d461695)
- po-gettext format issues with CLI (#1073) (a529aca)
- reduce size of ESM packages (#1066) (9990eba)
- use correct case for PO file header MIME-Version (#1074) (f31afc5)
- ESM dev entrypoint was causing unexpected behaviors (#1059) (2b8d70b)
- lineNumbers false was removing the entire origin (#1060) (2d25f2c)
- unicode char was not extracting correctly (3653f6f)
- improve compile log error if bad syntax on the string (9b2705f)
- respect unicode chars in t macro (#1032) (7597621)
- typescript loader config (#1029) (93afb72)
- undefined interpolation on t macro (#1030) (194f9b3)
- fallback locales default not overwritten (78e4576)
- selectOrdinal pseudolocalize insensitive (16acafe)
- lingui extract ignores custom directories as args #998 (f426881)
- webpack 5 issue with jest @lingui/loader #999 (9e68a8d)
- @lingui/cli type error when catalog is missing (#988) (8c44af2)
- macro components should omit key prop #994 (f2a4da0)
- Report correct number of missing messages in strict mode (#992) (128f3e2)
- use pkgUp.sync to localize package.json (#985) (18d985d)
- --watch mode for extract and compile (#974) (a4f90ee)
- ship universal modules with ESM (#979) (6cd5fe0)
- @lingui/macro types for global environments (#973) (92a5ce7)
- runtimeConfigModule config validation (#972) (5656c95)
- @lingui/loader: accept webpack 5.x as a peer dependency (#971) (b9683cc)
- @lingui/conf lodash.get dependency (#950) (f7b59ab)
- Select /> pseudolocalization (#961) (f1e1a25)
- I18nProvider defaultComponent typing (#953) (6b08dd3)
- message when translations are missing (#964) (14f24f2)
- NODE_ENV=production crashes lingui extract #952 (f368b35)
- obsolete flag disable when using extract [files] (#967) (0ea63e9)
- React macros fixes (#958) (353c537)
- wrong typing of Trans macro component prop (#960) (57482c0)
- docs: documentation-typos (#955) (f73cb8c)
- added return type to i18n._ (#922) (249c486)
- compilerBabelOptions warning with jest-validate (#938) (087ec1f)
- Last scaped brackets were not unscaped (db2f768)
- Use LINGUI_CONFIG env as fallback for extract (#932) (ce71a8b)
- detect-locale: ESM import not published (#926) (4ad90d4)
- prevent adding undefined msgid to messages (#915) (3afacec)
- Lingui compiles to typescript files (#942) (10bce7d)
- Support lingui config in multiple formats (#941) (8631111)
- accept pseudolocalization in SelectOrdinal (#903) (d4c24bf)
- formatters exceptions throw error (#889) (d6b774c)
- macro underscore type (#884) (5cade19)
- plural pseudolocalization with offset (#887) (3d54b4d)
- scaped literals double backslash formatting (#898) (fc8c628)
- select prop types (#890) (672fb1f)
- add support for runtimeConfigModule w/ Trans (#895) (23b06b5)
- config accepts compilerBabelOptions (#906) (38d01ef)
- extract messages from specific files (#881) (82dea5f)
- Implement gettext plurals for PO files (#677) (415b90e)
- export TransRenderProps from @lingui/react (#877) (3db9d6b)
- omit i18n prop in withI18n typescript interface (#879) (5927d42)
- fallbackLocales overriden if parent found (a53e12f)
- locale not present in catalogs warn (6f598e8)
- parse template strings in t and defineMessage macros (#862) (024a7e6)
- absolute rootDir on Windows (#853) (f4eabf9)
- MessageDescriptor values type (#848) (9712d94)
- t macro as function not extracting (#846) (d819bfc)
- accept catalog paths without ending slash (#812) (5d39586)
- add type for t macro as function (#821) (7f09c2d)
- cache (c57be58)
- ensure render of I18nProvider in async scenarios (#839) (cd2816a)
- fix exit code on compile --strict errors (#825) (69a80e2)
- improved performance of formatters (#818) (22667ad)
- mandatory ext on @lingui/loader (#831) (8979aaf)
- show error when plurals aren't loaded (#824) (296b6a1)
- accept t as function (c0c08ba)
- add cli option to extract only a specific locale (#816) (49f45b2)
- enable pseudolocalization from pseudolocale folder (#836) (f1e0078)
- lookup lingui command suggestions in package.json (#823) (d58dc09)
- use fallback locales from cldr (#820) (2d9e124)
- Revert "chore: improved commit-lint" (75fcf65)
- Handle multiple paths in catalogs.include (#803).
- Minor fixes in @lingui/macro and @lingui/react types
- Fix catalog include paths on Windows (#802).
- Fix type of Trans component (#801).
- Accept React 17 as a peer dependency (#789).
- Allow null overrides for render and component props (#799). Thanks to Declan Haigh
- Fix import of typescript package (#611). Thanks to Anton Korzunov
- Fix flow types of withI18n (#605). Thanks to Kamil Tunkiewicz
- Add optional sort by origin/filename (#563). Thanks to Kenneth Skovhus
- Lazily split messages by value tags (#593). Thanks to Danny Sellers
- Optional line numbers for lingui format (#587). Thanks to Martti Roitto
- Moved typescript dependency to peer (#589). Thanks to Daniel K.
- Compile strict skips pseudo locale (#584). Thanks to Daniel Chabr
- Loader: Fix type error when no loader config is provided
- Macro:
babel-plugin-macros
are peer dependency and must be installed manually - CLI: Don't warn about conflicting default message if it's empty (#502). Thanks to Filip Žmuk.
- Conf: Pass config path to getConfig explicitly instead reading it from process.argv (#509). Thanks to Brandon Croft.
- Conf: Allow loading specific configuration file using --config argument (#501). Thanks to Brandon Croft.
- Macro: Fix escaped backticks in template string (#477). Thanks to Saxon Landers.
- Conf: Allow
extends
androotMode
babel config options (#454). Thanks to Adam Thomas. - React: Fix flow typing with Flow 0.92 (#448). Thanks to Florian Rival.
- Export
@lingui/core/dev
subpackage. - CLI: Log original info with Babel compatibility info (#401). Thanks to Sam Gluck.
- CLI: Allow pseudolocales which don't start with a known language (#411). Thanks to Eric Plumb.
- CLI: Made pseudolocales to take into account variable names (#419). Thanks to Cornel Stefanache.
- CLI: Fix edge case bug in plural pseudolocalization (#428). Thanks to Eric Plumb.
- CLI: Fix yarn detection with nps (#441). Thanks to MU AOHUA.
- CLI: show more accurate follow-up commands (e.g. show
use (yarn compile) ...
instead ofuse (lingui compile) ...
when CLI is invoked usingyarn extract
) - CLI: add missing export (regression introduced by #381)
- CLI: remove "macros" from the list of babel plugins (#360). Thanks to Jérôme Steunou.
- Macro: fix ICU message for nested selects (#365). Thanks to Maxim Zemskov.
- CLI: allow leading space in i18n description comments (#366). Thanks to Maxim Zemskov.
- Disable Google Clojure Compiler rewritePolyfills behavior (#374). Thanks to Ivan Khilko.
- Show hint for missing babel-core package (#381).
- Fix message extracting when Trans component is missing (#389).
- New package
@lingui/macro
published (#318). Big thanks to Matt Labrum for initial implementation. - Pseudolocalization (#309). Thanks to Martin Cerny.
- Extract description of messages (#197).
- Add
i18n.date
andi18n.number
methods (#299). @lingui/cli
- Remove opencollective dependency- Configuration - add
extractBabelOptions
(#287). Thanks to Daniel K.. lingui extract
- add--namespace
option andcompileNamespace
config (#295). Thanks to An Nguyen.- Update peer-dependency on babel-core (#286).
- Output multiple origins on separate line in PO format (#290).
- Keep headers in PO format (#294). Thanks to Daniel K..
lingui extract
- set default BABEL_ENV (required byreact-app
preset) (#300).- Fix
@lingui/loader
compatibility with Webpack 4 (#297). - Fix
I18n
render prop component to not unmount children component between renders (#302). - Disable eslint for compiled catalogs (#279). Thanks to Benoît Grélard.
- Add
I18n
render prop component (#282) - Handle message compile errors in development (#283)
lingui init
- add missing command (#270)lingui extract
- fix path separator on Windows (#262)lingui extract
- fix extracting from typescript files (#260)- New message catalog format: Gettext PO file (#256)
- New
lingui init
command which detects project type and install all required packages (#253) - Allow customize messages for missing translations (#255)
lingui extract
detectscreate-react-app
projects and extracts messages usingrect-app
babel presetlingui add-locale
accepts any valid BCP-47 locale (#182)- Flow types are correctly exported for all packages (#250)
- Add support for locales (aka cultures) (#170). Thanks to Cristi Ingineru.
- Allow React elements to be used as message variables (#183)
- Support both Babel 6.x and 7.x (#171, #232, #238)
withI18n
hoists statics of wrapped component (#166)Date
andi18n.date
accepts date as a string (#155)lingui extract
shows progress (#180)lingui extract
throws an error when encountering different defaults for the same message (#200)lingui compile
shows useful error when message has syntax errors (#191)- Fix internal catalog names to avoid collisions. Internal catalogs are named
<original_filename>.json
, eg:App.js.json
(#244) - React Native Tutorial (#243). Thanks to Vojtech Novak.
- Add draft of Testing Guide
- Add section with external resources
- Several fixes by Vincent Ricard (#242)
- Load jsLingui configuration from separate file (#209). Thanks to Vincent Ricard.
- Add --overwrite
option which forces overwrite of translations in minimal
format
forsourceLocale
from source code. (#199) - Order messages in catalogs alphabetically by message ID (#230). Thanks to David Reeß.
- Add TypeScript extractor (#228). Thanks to Jeow Li Huan.
- Pass extra Babel options to extractor (#226). Thanks to Jan Willem Henckel.
- Mark all messages in file as obsolete when file is completely removed (#235)
- Support locales with hyphens in cli compile (#231). Thanks to Leonardo Dino.
- Extract with format minimal does not set defaults (#222)
- Use generated message as a default one in sourceLocale catalog (#212)
4.0.0 (2023-04-xx)
3.17.2 (2023-02-24)
3.17.1 (2023-02-07)
3.17.0 (2023-02-01)
3.16.1 (2023-01-24)
3.16.0 (2023-01-18)
3.15.0 (2022-11-07)
3.14.0 (2022-06-22)
3.13.3 (2022-04-24)
3.13.2 (2022-01-24)
3.13.1 (2022-01-21)
3.13.0 (2021-11-26)
3.12.1 (2021-09-28)
3.12.0 (2021-09-28)
3.11.1 (2021-09-07)
3.11.0 (2021-09-07)
3.10.4 (2021-06-16)
3.10.3 (2021-06-14)
3.10.2 (2021-06-08)
3.10.1 (2021-06-08)
3.10.0 (2021-06-08)
3.9.0 (2021-05-18)
3.8.10 (2021-04-19)
3.8.9 (2021-04-09)
3.8.8 (2021-04-09)
3.8.7 (2021-04-09)
3.8.6 (2021-04-08)
3.8.5 (2021-04-08)
3.8.4 (2021-04-08)
3.8.3 (2021-04-05)
3.8.2 (2021-03-31)
Note: Version bump only for package js-lingui-workspaces
3.8.1 (2021-03-23)
3.8.0 (2021-03-23)
3.7.2 (2021-03-14)
3.7.1 (2021-03-07)
3.7.0 (2021-03-04)
3.6.0 (2021-02-23)
3.5.1 (2021-02-09)
3.5.0 (2021-02-02)
3.4.0 (2021-01-13)
3.3.0 (2020-12-08)
3.2.3 (2020-11-22)
3.2.2 (2020-11-20)
3.2.0 (2020-11-12)
3.1.0 (2020-11-10)
3.0.3 (2020-11-01)
3.0.2 (2020-11-01)
3.0.1 (2020-11-01)
3.0.0 (2020-11-01)
See migration guide for a full changelog.
2.9.1 (2020-01-18)
2.9.0 (2019-12-02)
2.8.3 (2019-05-22)
2.8.2 (2019-05-22)
2.8.0 (2019-05-17)
2.7.4 (2019-02-19)
2.7.3 (2019-01-28)
2.7.2 (2018-11-14)
2.7.1 (2018-11-12)
2.7.0 (2018-09-10)
🔥 Babel Macros 🎣 are finally released! After few weeks of fiddling with API, i18n macros are finally out without a breaking release. This is the first part of RFC-001, final form be delivered in next release.
Important: Macros are completely optional and Babel plugins will work until v3. It's not mandatory to migrate to macro, but recommended.
2.6.1 (2018-09-03)
2.6.0 (2018-08-31)
2.5.0 (2018-08-24)
2.4.2 (2018-08-19)
2.4.1 (2018-08-10)
2.4.0 (2018-08-09)
Better support for custom file formats and initial support for Create React App.
2.3.0 (2018-07-23)
Long-awaited backlog grooming.
2.2.0 (2018-07-04)
Release dedicated to command line interface.