<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <id>https://lingui.dev/blog</id>
    <title>Lingui Blog</title>
    <updated>2024-11-28T00:00:00.000Z</updated>
    <generator>https://github.com/jpmonette/feed</generator>
    <link rel="alternate" href="https://lingui.dev/blog"/>
    <subtitle>Lingui Blog</subtitle>
    <icon>https://lingui.dev/img/favicon.ico</icon>
    <entry>
        <title type="html"><![CDATA[Announcing Lingui 5.0]]></title>
        <id>https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0</id>
        <link href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0"/>
        <updated>2024-11-28T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Today we are pleased to announce the release of Lingui 5.0!]]></summary>
        <content type="html"><![CDATA[<p>Today we are pleased to announce the release of Lingui 5.0! <!-- -->🚀</p>
<p>This release is a <strong>major milestone</strong> for the project and includes a number of new features, improvements and bug fixes. In this post, we'll highlight some of the major changes in this release.</p>
<p>In line with the principles of <a href="https://semver.org/" target="_blank" rel="noopener noreferrer">Semantic Versioning</a>, this release contains <strong>breaking changes</strong> that we have thoroughly documented in the <a href="https://lingui.dev/releases/migration-5">v5 upgrade guide</a>.</p>
<p><img decoding="async" loading="lazy" alt="social-card image" src="https://lingui.dev/assets/images/social-card-17b04e559dc6f0c341c089b616416ed1.png" width="1200" height="630" class="img_ev3q"></p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-is-lingui">What is Lingui?<a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#what-is-lingui" class="hash-link" aria-label="Direct link to What is Lingui?" title="Direct link to What is Lingui?">​</a></h2>
<p>Lingui is a powerful and flexible <strong>internationalization</strong> (i18n) and <strong>localization</strong> (l10n) library for JavaScript projects. It supports React (including RSC and React Native), Vanilla JS, Node.js, Vue.js and frameworks such as Next.js, Remix, and Svelte.</p>
<p>It provides a set of tools and APIs that make it easy for developers to create multilingual applications.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="table-of-contents">Table of Contents<a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#table-of-contents" class="hash-link" aria-label="Direct link to Table of Contents" title="Direct link to Table of Contents">​</a></h2>
<ul>
<li><a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#progress-highlights">Progress Highlights</a>
<ul>
<li><a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#react-server-components-rsc-support">React Server Components (RSC) Support</a></li>
<li><a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#eslint-plugin">ESLint Plugin</a></li>
<li><a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#metro-transformer">Metro Transformer</a></li>
</ul>
</li>
<li><a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#whats-new-in-5.0">What's New in 5.0?</a>
<ul>
<li><a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#react-and-js-macros-were-split-to-separate-packages">React and JS Macros Were Split to Separate Packages</a></li>
<li><a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#whitespace-handling-changes">Whitespace Handling Changes</a></li>
<li><a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#new-uselingui-macro">New <code>useLingui</code> Macro</a></li>
<li><a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#standalone-babel-plugin-lingui-macro">Standalone <code>babel-plugin-lingui-macro</code></a></li>
<li><a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#print-placeholder-values-for-better-translation-context">Print Placeholder Values for Better Translation Context</a></li>
<li><a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#other-features">Other Features</a></li>
<li><a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#documentation-updates">Documentation Updates</a></li>
</ul>
</li>
<li><a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#conclusion">Conclusion</a></li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="progress-highlights">Progress Highlights<a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#progress-highlights" class="hash-link" aria-label="Direct link to Progress Highlights" title="Direct link to Progress Highlights">​</a></h2>
<p>Lingui has gone through a significant number of changes and milestones since the last major release.</p>
<p>Before we dive into the new features and improvements in 5.0, let's take a look at the growth of the project since the <a href="https://lingui.dev/blog/2023/04/26/announcing-lingui-4.0">4.0 release</a> in April 2023.</p>
<p>The project has seen a significant increase in popularity since the last major release. The number of GitHub stars has increased by 28%, and the number of downloads per month has more than doubled for the <code>@lingui/core</code> and <code>@lingui/react</code> packages. The SWC and Vite plugins are also gaining a lot of traction.</p>
<!-- -->
<p>(<em>The download numbers are based on the <a href="https://npm-stat.com/" target="_blank" rel="noopener noreferrer">npm-stat.com</a> data</em>)</p>
<p>The journey from <a href="https://lingui.dev/blog/2023/04/26/announcing-lingui-4.0">Lingui 4.0</a> includes <strong>25 version updates</strong> (minor and patch), more than <strong>100 closed issues</strong>, and more than <strong>150 merged pull requests</strong>.</p>
<p>Let's now take a quick look at some of the major features and improvements that have been released between 4.0 and 5.0.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="react-server-components-rsc-support">React Server Components (RSC) Support<a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#react-server-components-rsc-support" class="hash-link" aria-label="Direct link to React Server Components (RSC) Support" title="Direct link to React Server Components (RSC) Support">​</a></h3>
<p>Lingui comes with out-of-the-box support for <a href="https://react.dev/reference/rsc/server-components" target="_blank" rel="noopener noreferrer">React Server Components</a> (RSC). This allows you to render translations on the server and client using the same components.</p>
<p>With Lingui, the experience of localizing React is the same in client and server components: <code>Trans</code> and <code>useLingui</code> can be used identically in both worlds, even though internally there are two implementations.</p>
<div class="theme-admonition theme-admonition-tip admonition_xJq3 alert alert--success"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>tip</div><div class="admonitionContent_BuS1"><p>Lingui is fully compatible with the recently released <a href="https://nextjs.org/blog/next-15" target="_blank" rel="noopener noreferrer">Next.js 15</a> with the Turbopack Dev bundler.</p></div></div>
<p>📖 Read more in the <a href="https://lingui.dev/tutorials/react-rsc">Lingui with React Server Components</a> tutorial.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="eslint-plugin">ESLint Plugin<a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#eslint-plugin" class="hash-link" aria-label="Direct link to ESLint Plugin" title="Direct link to ESLint Plugin">​</a></h3>
<p>The new <a href="https://lingui.dev/ref/eslint-plugin">ESLint Plugin</a> is gaining popularity among developers. It helps catch common usage errors and enforce best practices when working with Lingui.</p>
<p>It's fully compatible with the latest ESLint versions and supports both the new ESLint Flat configuration (<code>eslint.config.js</code>) and the legacy configuration <code>.eslintrc</code> format. There is also a set of recommended rules that you can use to get started quickly.</p>
<p>📖 See the <a href="https://github.com/lingui/eslint-plugin" target="_blank" rel="noopener noreferrer">Official repository</a> for more details.</p>
<p>Released in September 2023, the plugin now has over 100k downloads per month.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="metro-transformer">Metro Transformer<a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#metro-transformer" class="hash-link" aria-label="Direct link to Metro Transformer" title="Direct link to Metro Transformer">​</a></h3>
<p>Just recently, we released a new <a href="https://lingui.dev/ref/metro-transformer">Metro Transformer</a> for React Native projects. It allows you to <code>import</code> <code>.po</code> files directly, instead of running <code>lingui compile</code> and <code>import</code>ing the resulting JavaScript (or TypeScript) files.</p>
<p>This is a great addition to the Lingui ecosystem and simplifies the workflow for React Native developers.</p>
<p>📖 See the <a href="https://lingui.dev/ref/metro-transformer"><code>@lingui/metro-transformer</code></a> reference for more details.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="whats-new-in-5.0">What's New in 5.0?<a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#whats-new-in-5.0" class="hash-link" aria-label="Direct link to What's New in 5.0?" title="Direct link to What's New in 5.0?">​</a></h2>
<p>Lingui 5.0 includes over 50 merged pull requests, bringing new features, improvements, bug fixes, and documentation updates. Here are some of the key highlights of this release.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="react-and-js-macros-were-split-to-separate-packages">React and JS Macros Were Split to Separate Packages<a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#react-and-js-macros-were-split-to-separate-packages" class="hash-link" aria-label="Direct link to React and JS Macros Were Split to Separate Packages" title="Direct link to React and JS Macros Were Split to Separate Packages">​</a></h3>
<p>In Lingui 5.0, we split the React and JS macros into separate packages to make it easier to use Lingui in any JavaScript project.</p>
<p>The main motivation behind this change was to reduce the package size for projects that don't use React and to prepare for future improvements, especially the Vue.js integration.</p>
<p>The <code>@lingui/macro</code> package has been split into two separate entry points from the existing packages:</p>
<ul>
<li><code>@lingui/react/macro</code> - for React (JSX) macros.</li>
<li><code>@lingui/core/macro</code> - for Core (JS) macros.</li>
</ul>
<p>This allows developers to use Lingui macros in any JavaScript project without having to download the entire React package.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="whitespace-handling-changes">Whitespace Handling Changes<a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#whitespace-handling-changes" class="hash-link" aria-label="Direct link to Whitespace Handling Changes" title="Direct link to Whitespace Handling Changes">​</a></h3>
<p>Whitespace handling has been improved to provide greater consistency and meet developer expectations. Previously, Lingui's regex-based whitespace normalization in JSX macros sometimes produced unexpected results. With Lingui 5.0, Lingui now uses <strong>JSX-specific whitespace rules</strong>, producing predictable, clean output for React (JSX) macros.</p>
<p>For JS macros, whitespace normalization has been <strong>completely removed</strong> based on developer feedback, leaving whitespace intact in expressions - ideal for text that requires special formatting, such as markdown.</p>
<p>This change is breaking, meaning that some auto-generated message IDs may change. This could cause translations to lose their connection to the original message ID. To address this, you can use the translation memory capabilities of your translation management system (TMS) to restore translations for the updated message IDs.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="new-uselingui-macro">New <code>useLingui</code> Macro<a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#new-uselingui-macro" class="hash-link" aria-label="Direct link to new-uselingui-macro" title="Direct link to new-uselingui-macro">​</a></h3>
<p>In Lingui 5, we introduced a new <a href="https://lingui.dev/ref/macro#uselingui"><code>useLingui</code></a> macro that makes it easier to work with non-JSX messages within React components.</p>
<p>Take the following code snippet as an example:</p>
<div class="language-jsx codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-jsx codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token keyword module" style="color:#00009f">import</span><span class="token plain"> </span><span class="token imports punctuation" style="color:#393A34">{</span><span class="token imports"> t</span><span class="token imports punctuation" style="color:#393A34">,</span><span class="token imports"> msg </span><span class="token imports punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token keyword module" style="color:#00009f">from</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"@lingui/macro"</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword module" style="color:#00009f">import</span><span class="token plain"> </span><span class="token imports punctuation" style="color:#393A34">{</span><span class="token imports"> useLingui </span><span class="token imports punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token keyword module" style="color:#00009f">from</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"@lingui/react"</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">function</span><span class="token plain"> </span><span class="token function maybe-class-name" style="color:#d73a49">MyComponent</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> i18n</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> _ </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">useLingui</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> a </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">t</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">i18n</span><span class="token punctuation" style="color:#393A34">)</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token template-string string" style="color:#e3116c">Text</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token comment" style="color:#999988;font-style:italic">// or</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> b </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">_</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">msg</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token template-string string" style="color:#e3116c">Second Text</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<p>With the new <code>useLingui</code> macro, you can simplify this code to:</p>
<div class="language-jsx codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-jsx codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token keyword module" style="color:#00009f">import</span><span class="token plain"> </span><span class="token imports punctuation" style="color:#393A34">{</span><span class="token imports"> useLingui </span><span class="token imports punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token keyword module" style="color:#00009f">from</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"@lingui/react/macro"</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">function</span><span class="token plain"> </span><span class="token function maybe-class-name" style="color:#d73a49">MyComponent</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> t </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">useLingui</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> a </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> t</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token template-string string" style="color:#e3116c">Text</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> b </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> t</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token template-string string" style="color:#e3116c">Second Text</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<p>Under the hood, the <code>useLingui</code> macro is transpiled to the runtime <a href="https://lingui.dev/ref/react#uselingui"><code>useLingui</code></a> hook.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="standalone-babel-plugin-lingui-macro">Standalone <code>babel-plugin-lingui-macro</code><a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#standalone-babel-plugin-lingui-macro" class="hash-link" aria-label="Direct link to standalone-babel-plugin-lingui-macro" title="Direct link to standalone-babel-plugin-lingui-macro">​</a></h3>
<p>There are now two ways to use Lingui macros with Babel in your project. You can choose between the <code>babel-macro-plugin</code> and the standalone <code>@lingui/babel-plugin-lingui-macro</code>.</p>
<p>The new plugin offers faster transpiling and additional configuration options.</p>
<p>We recommend replacing <code>babel-macro-plugin</code> with <code>@lingui/babel-plugin-lingui-macro</code> if you have direct access to your Babel configuration and don't use any other macros in your project.</p>
<div class="language-diff codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockTitle_Ktv7">.babelrc</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-diff codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">{</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token unchanged prefix unchanged"> </span><span class="token unchanged line"> "plugins": [</span><br></span><span class="token-line" style="color:#393A34"><span class="token unchanged line"></span><span class="token deleted-sign deleted prefix deleted" style="color:#d73a49">-</span><span class="token deleted-sign deleted line" style="color:#d73a49">    "macros"</span><br></span><span class="token-line" style="color:#393A34"><span class="token deleted-sign deleted line" style="color:#d73a49"></span><span class="token inserted-sign inserted prefix inserted" style="color:#36acaa">+</span><span class="token inserted-sign inserted line" style="color:#36acaa">    "@lingui/babel-plugin-lingui-macro"</span><br></span><span class="token-line" style="color:#393A34"><span class="token inserted-sign inserted line" style="color:#36acaa"></span><span class="token unchanged prefix unchanged"> </span><span class="token unchanged line"> ]</span><br></span><span class="token-line" style="color:#393A34"><span class="token unchanged line"></span><span class="token plain">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="print-placeholder-values-for-better-translation-context">Print Placeholder Values for Better Translation Context<a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#print-placeholder-values-for-better-translation-context" class="hash-link" aria-label="Direct link to Print Placeholder Values for Better Translation Context" title="Direct link to Print Placeholder Values for Better Translation Context">​</a></h3>
<p>Context is critical for translators (and AI) to provide accurate translations. This release introduces a new feature that prints placeholder values in PO comments.</p>
<p>If the message contains unnamed placeholders such as <code>{0}</code>, Lingui will print the name of the placeholder variable in the PO comments, giving translators and AI more context about what the placeholder is about.</p>
<p>Consider the following example:</p>
<div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">t</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token template-string string" style="color:#e3116c">Hello </span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:#393A34">${</span><span class="token template-string interpolation">user</span><span class="token template-string interpolation punctuation" style="color:#393A34">.</span><span class="token template-string interpolation property-access">name</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:#393A34">}</span><span class="token template-string string" style="color:#e3116c"> </span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:#393A34">${</span><span class="token template-string interpolation">value</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:#393A34">}</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<p>With the new feature enabled, the message in the PO file will include the placeholder values in the comments:</p>
<div class="language-diff codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockTitle_Ktv7">en.po</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-diff codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token inserted-sign inserted prefix inserted" style="color:#36acaa">+</span><span class="token inserted-sign inserted line" style="color:#36acaa"> #. placeholder {0}: user.name</span><br></span><span class="token-line" style="color:#393A34"><span class="token inserted-sign inserted line" style="color:#36acaa"></span><span class="token plain">msgid "Hello {0} {value}"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<p>This gives the translators more context about the placeholders, which definitely helps in providing accurate translations.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="other-features">Other Features<a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#other-features" class="hash-link" aria-label="Direct link to Other Features" title="Direct link to Other Features">​</a></h3>
<h4 class="anchor anchorWithStickyNavbar_LWe7" id="configurable-message-stripping-via-babel-options">Configurable Message Stripping via Babel Options<a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#configurable-message-stripping-via-babel-options" class="hash-link" aria-label="Direct link to Configurable Message Stripping via Babel Options" title="Direct link to Configurable Message Stripping via Babel Options">​</a></h4>
<p>By default, Lingui strips messages and comments from the production bundle to reduce the bundle size.</p>
<p>It's now possible to configure this feature by setting the <code>stripMessageField</code> option in the Babel configuration:</p>
<div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockTitle_Ktv7">babel.config.js</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">module</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access">exports</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">plugins</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token string" style="color:#e3116c">"macros"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line theme-code-block-highlighted-line" style="color:#393A34"><span class="token plain">      </span><span class="token literal-property property" style="color:#36acaa">lingui</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line theme-code-block-highlighted-line" style="color:#393A34"><span class="token plain">        </span><span class="token literal-property property" style="color:#36acaa">stripMessageField</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean" style="color:#36acaa">true</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line theme-code-block-highlighted-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">]</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<p>Setting <code>stripMessageField</code> to <code>true</code> will strip messages and comments from both development and production bundles. Alternatively, set it to <code>false</code> to keep the original messages in both environments.</p>
<p>This helps to align the development and production environments and catch potential issues early in the development process.</p>
<h4 class="anchor anchorWithStickyNavbar_LWe7" id="support-decoratorautoaccessors-decorator">Support <code>decoratorAutoAccessors</code> Decorator<a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#support-decoratorautoaccessors-decorator" class="hash-link" aria-label="Direct link to support-decoratorautoaccessors-decorator" title="Direct link to support-decoratorautoaccessors-decorator">​</a></h4>
<p>Decorators are a proposal for extending JavaScript classes that has been widely adopted by developers in transpiler environments, with widespread interest in standardization.</p>
<p>By default, Lingui supports Typescript, Flow, and JavaScript (Stage 3) syntax. The Decorators proposal is already at Stage 3, and Lingui now supports the <code>decoratorAutoAccessors</code> decorator in the Babel plugin.</p>
<p>📖 Read more about the supported syntax in the <a href="https://lingui.dev/guides/custom-extractor">Custom Extractor</a> reference.</p>
<h4 class="anchor anchorWithStickyNavbar_LWe7" id="dependency-tree-extractor-improvements">Dependency Tree Extractor Improvements<a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#dependency-tree-extractor-improvements" class="hash-link" aria-label="Direct link to Dependency Tree Extractor Improvements" title="Direct link to Dependency Tree Extractor Improvements">​</a></h4>
<p>The <a href="https://lingui.dev/guides/message-extraction#dependency-tree-crawling">Dependency Tree Extractor</a> has been improved to provide better performance and more accurate results.</p>
<ul>
<li>Use the newer esbuild version and refactor the codebase to apply the Lingui macro to each file as an esbuild plugin.</li>
<li>Change the way how the external dependencies are excluded from the extraction process.</li>
<li>Use the TSX loader instead of JSX.</li>
<li>Improved Tree Shaking support.</li>
</ul>
<p>This feature is still in the experimental stage, but we are working to make it more stable and reliable.</p>
<h4 class="anchor anchorWithStickyNavbar_LWe7" id="multiple-locales-support-in-lingui-extract">Multiple Locales Support in <code>lingui extract</code><a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#multiple-locales-support-in-lingui-extract" class="hash-link" aria-label="Direct link to multiple-locales-support-in-lingui-extract" title="Direct link to multiple-locales-support-in-lingui-extract">​</a></h4>
<p>Now you can <a href="https://lingui.dev/ref/cli#extract"><code>extract</code></a> messages for multiple locales in a single command.</p>
<div class="language-sh codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-sh codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">lingui extract </span><span class="token parameter variable" style="color:#36acaa">--locale</span><span class="token plain"> de </span><span class="token parameter variable" style="color:#36acaa">--locale</span><span class="token plain"> fr</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<h4 class="anchor anchorWithStickyNavbar_LWe7" id="quality-of-life-update-for-windows-users">Quality of Life Update for Windows Users<a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#quality-of-life-update-for-windows-users" class="hash-link" aria-label="Direct link to Quality of Life Update for Windows Users" title="Direct link to Quality of Life Update for Windows Users">​</a></h4>
<p>All Lingui CLI commands now work without problems on Windows, as well as the Webpack Loader and the Vite plugin. We've fixed all known bugs and improved the overall experience for Windows users.</p>
<h4 class="anchor anchorWithStickyNavbar_LWe7" id="new-defineconfig-method">New <code>defineConfig</code> Method<a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#new-defineconfig-method" class="hash-link" aria-label="Direct link to new-defineconfig-method" title="Direct link to new-defineconfig-method">​</a></h4>
<p>We've introduced a new <code>defineConfig</code> method that allows you to define configuration options for the Lingui CLI in a more flexible and convenient way:</p>
<div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockTitle_Ktv7">lingui.config.{js,ts}</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><span class="token-line theme-code-block-highlighted-line" style="color:#393A34"><span class="token keyword module" style="color:#00009f">import</span><span class="token plain"> </span><span class="token imports punctuation" style="color:#393A34">{</span><span class="token imports"> defineConfig </span><span class="token imports punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token keyword module" style="color:#00009f">from</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"@lingui/cli"</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line theme-code-block-highlighted-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword module" style="color:#00009f">export</span><span class="token plain"> </span><span class="token keyword module" style="color:#00009f">default</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">defineConfig</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">sourceLocale</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"en"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">locales</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token string" style="color:#e3116c">"cs"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"en"</span><span class="token punctuation" style="color:#393A34">]</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token literal-property property" style="color:#36acaa">catalogs</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token literal-property property" style="color:#36acaa">path</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"&lt;rootDir&gt;/src/locales/{locale}/messages"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token literal-property property" style="color:#36acaa">include</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token string" style="color:#e3116c">"src"</span><span class="token punctuation" style="color:#393A34">]</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">]</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<p>This method provides a more structured and type-safe way to define configuration options for the Lingui CLI, and it's quite common in modern JavaScript tools.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="documentation-updates">Documentation Updates<a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#documentation-updates" class="hash-link" aria-label="Direct link to Documentation Updates" title="Direct link to Documentation Updates">​</a></h3>
<p>In addition to the new features and improvements, we've also made significant updates to the documentation to make it more comprehensive and user-friendly:</p>
<ul>
<li>All the documentation pages have been reviewed, improved and updated to reflect the latest changes in Lingui 5.0.</li>
<li>The structure of the documentation has been reorganized to make it easier to navigate and find the information you need.</li>
<li>The installation instructions have been dramatically improved to provide a simpler and clearer process for getting started with Lingui.</li>
<li>The Tutorials section is now more detailed and clearer to help you quickly get up and running with Lingui for a specific use case.</li>
<li>Outdated and duplicate content has been removed to reduce confusion.</li>
<li>And many other small improvements and updates to make the documentation more helpful and informative.</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="conclusion">Conclusion<a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#conclusion" class="hash-link" aria-label="Direct link to Conclusion" title="Direct link to Conclusion">​</a></h2>
<p>Lingui 5.0 is a significant milestone for the project, bringing a number of new features, improvements, and bug fixes. We hope you enjoy using Lingui 5.0 and look forward to hearing your feedback!</p>
<p>This release wouldn't have been possible without the help of our amazing <a href="https://lingui.dev/community">community</a>. Thank you to everyone who contributed to this release!</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="links">Links<a href="https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0#links" class="hash-link" aria-label="Direct link to Links" title="Direct link to Links">​</a></h2>
<ul>
<li><a href="https://lingui.dev/releases/migration-5">Migration Guide</a></li>
<li><a href="https://github.com/lingui/js-lingui/releases/tag/v5.0.0" target="_blank" rel="noopener noreferrer">Full Changelog</a></li>
</ul>]]></content>
        <author>
            <name>Andrii Bodnar</name>
        </author>
        <category label="release" term="release"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Simplify React Native i18n with the New Metro Transformer]]></title>
        <id>https://lingui.dev/blog/2024/11/20/metro-transformer</id>
        <link href="https://lingui.dev/blog/2024/11/20/metro-transformer"/>
        <updated>2024-11-20T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[social-card image]]></summary>
        <content type="html"><![CDATA[<p><img decoding="async" loading="lazy" alt="social-card image" src="https://lingui.dev/assets/images/social-card-41b96684b2f262e6bb5ff954ed04575c.png" width="2400" height="1260" class="img_ev3q"></p>
<p>The new <code>@lingui/metro-transformer</code> package brings a more streamlined way to consume translations from <code>.po</code> files in Expo and React Native.</p>
<p>It can be used in apps across all platforms supported by React Native (Android, iOS, web and more!) - the only pre-requisite is that you use <a href="https://metrobundler.dev/" target="_blank" rel="noopener noreferrer">Metro bundler</a> to bundle your app.</p>
<p>Previously, React Native developers would need to follow the two-step process of extracting translations into a <code>.po</code> file (with <code>lingui extract</code>), and then compiling translated po files into JS/TS files (with <code>lingui compile</code>) for production.</p>
<p>Good news! By setting up the <code>metro-transformer</code>, you now don't need to perform the second step - it's performed for you during bundling!</p>
<div class="theme-admonition theme-admonition-tip admonition_xJq3 alert alert--success"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>Example</div><div class="admonitionContent_BuS1"><p>Check out the <a href="https://github.com/lingui/js-lingui/tree/main/examples/react-native" target="_blank" rel="noopener noreferrer">React Native example app</a> which uses the transformer.</p></div></div>
<p>The <code>@lingui/metro-transformer</code> package is available as of version 4.12.0. Please let us know if you encounter any issues!</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="getting-started">Getting Started<a href="https://lingui.dev/blog/2024/11/20/metro-transformer#getting-started" class="hash-link" aria-label="Direct link to Getting Started" title="Direct link to Getting Started">​</a></h2>
<p>The <strong>TL;DR</strong> is: install <code>@lingui/metro-transformer</code>, update <code>metro.config.js</code> and you're ready to go!</p>
<p>For more details - see the official <a href="https://lingui.dev/ref/metro-transformer" target="_blank" rel="noopener noreferrer">docs</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="exciting-future-for-lingui">Exciting Future for Lingui<a href="https://lingui.dev/blog/2024/11/20/metro-transformer#exciting-future-for-lingui" class="hash-link" aria-label="Direct link to Exciting Future for Lingui" title="Direct link to Exciting Future for Lingui">​</a></h2>
<p>In case you missed it, Lingui now offers a truly universal support for React — you can use the same syntax for React on the web, React Native, and even in React Server Components (RSC), making it a consistent solution across platforms and environments.</p>
<p>Additionally, keep an eye on Lingui v5 which is packed with new features and bug fixes, and a stable release is just behind the corner. In fact, you can already try v5 with a pre-release version - see the <a href="https://github.com/lingui/js-lingui/releases" target="_blank" rel="noopener noreferrer">latest releases on GitHub</a>!</p>
<p>As always, thank you to the community for trusting Lingui!</p>]]></content>
        <author>
            <name>Vojtech Novak</name>
        </author>
        <category label="news" term="news"/>
        <category label="features" term="features"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Lingui hits 4k Stars on GitHub ⭐]]></title>
        <id>https://lingui.dev/blog/2023/12/12/4k-stars</id>
        <link href="https://lingui.dev/blog/2023/12/12/4k-stars"/>
        <updated>2023-12-12T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[social-card image]]></summary>
        <content type="html"><![CDATA[<p><img decoding="async" loading="lazy" alt="social-card image" src="https://lingui.dev/assets/images/social-card-a03d60363f410cb55758d54e23fd34b8.png" width="1200" height="630" class="img_ev3q"></p>
<p>We're thrilled to announce that the <a href="https://github.com/lingui/js-lingui" target="_blank" rel="noopener noreferrer">Lingui repository</a> has reached an important milestone - <strong>4,000</strong>&nbsp;stars! This achievement is a testament to the growing popularity of Lingui as a powerful and flexible internationalization solution for global products.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="advantages">Lingui has been gaining traction in the JS community due to its several key advantages<a href="https://lingui.dev/blog/2023/12/12/4k-stars#advantages" class="hash-link" aria-label="Direct link to Lingui has been gaining traction in the JS community due to its several key advantages" title="Direct link to Lingui has been gaining traction in the JS community due to its several key advantages">​</a></h3>
<ul>
<li>
<p><strong>Universal</strong> - use it everywhere: Vanilla JS, React, Vue.js, Next.js, Node.js, etc.</p>
</li>
<li>
<p><strong>Full rich-text support</strong> - use React components within localized messages without restriction. Writing rich-text messages is as easy as writing JSX.</p>
</li>
<li>
<p><strong>Powerful tooling</strong> - manage the entire intl workflow with the <a href="https://lingui.dev/ref/cli" target="_blank" rel="noopener noreferrer">Lingui CLI</a>. It extracts messages from source code, validates messages coming from translators, and many more. Use the <a href="https://lingui.dev/ref/eslint-plugin" target="_blank" rel="noopener noreferrer">ESLint plugin</a> to find common Lingui usage errors in your code. In addition, for Vite users, we have the <a href="https://lingui.dev/ref/vite-plugin" target="_blank" rel="noopener noreferrer">Vite plugin</a> which compiles Lingui catalogs on the fly and provides additional configuration needed for Vite.</p>
</li>
<li>
<p><strong>Customization</strong> - integrate Lingui with your existing workflow. It supports both message keys and auto-generated messages. Translations can be stored in a <a href="https://lingui.dev/ref/catalog-formats" target="_blank" rel="noopener noreferrer">variety of file formats</a> including PO, JSON, and CSV. For more advanced usage, there is a possibility to create a <a href="https://lingui.dev/guides/custom-extractor" target="_blank" rel="noopener noreferrer">Custom Extractor</a> or <a href="https://lingui.dev/guides/custom-formatter" target="_blank" rel="noopener noreferrer">Custom Formatter</a> for your project.</p>
</li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="use-cases">Here are some of the ways that Lingui is being used by companies around the world<a href="https://lingui.dev/blog/2023/12/12/4k-stars#use-cases" class="hash-link" aria-label="Direct link to Here are some of the ways that Lingui is being used by companies around the world" title="Direct link to Here are some of the ways that Lingui is being used by companies around the world">​</a></h3>
<ul>
<li><a href="https://github.com/ansible/awx" target="_blank" rel="noopener noreferrer">Ansible</a> - an open source community project sponsored by Red Hat, it's the simplest way to automate IT.</li>
<li><a href="https://github.com/MetaMask/snaps-directory" target="_blank" rel="noopener noreferrer">Metamask</a> - a crypto wallet &amp; gateway to blockchain apps.</li>
<li><a href="https://github.com/Uniswap/interface" target="_blank" rel="noopener noreferrer">Uniswap</a> - an open source interfaces for the Uniswap protocol.</li>
</ul>
<p>These are just a few examples of the many companies that use Lingui to power their internationalization efforts. We're confident that Lingui will continue to grow in popularity as more and more companies recognize its value.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="thanks">Thanks to the community<a href="https://lingui.dev/blog/2023/12/12/4k-stars#thanks" class="hash-link" aria-label="Direct link to Thanks to the community" title="Direct link to Thanks to the community">​</a></h3>
<p>This milestone wouldn't have happened without all of you, so we want to thank the awesome community for being with Lingui all the way along. Join the <a href="https://lingui.dev/misc/community" target="_blank" rel="noopener noreferrer">Lingui community</a> and help us make Lingui even better!</p>]]></content>
        <author>
            <name>Andrii Bodnar</name>
        </author>
        <category label="news" term="news"/>
        <category label="community" term="community"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Announcing Lingui 4.0]]></title>
        <id>https://lingui.dev/blog/2023/04/26/announcing-lingui-4.0</id>
        <link href="https://lingui.dev/blog/2023/04/26/announcing-lingui-4.0"/>
        <updated>2023-04-26T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Today we are happy to finally announce Lingui 4.0! 🥳️]]></summary>
        <content type="html"><![CDATA[<p>Today we are happy to finally announce Lingui 4.0! 🥳️</p>
<hr>
<p><img decoding="async" loading="lazy" alt="social-card image" src="https://lingui.dev/assets/images/social-card-4f677a99672310a84d577074820b1d0c.png" width="1200" height="630" class="img_ev3q"></p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-is-lingui-exactly">What is Lingui exactly?<a href="https://lingui.dev/blog/2023/04/26/announcing-lingui-4.0#what-is-lingui-exactly" class="hash-link" aria-label="Direct link to What is Lingui exactly?" title="Direct link to What is Lingui exactly?">​</a></h2>
<p>Lingui is a powerful and flexible <strong>internationalization</strong> (i18n) and <strong>localization</strong> (l10n) library for JavaScript projects, including React, Vue.js, Node.js, Next.js, Angular, and more. It provides a set of tools and APIs that make it easy for developers to create multilingual applications.</p>
<p>One of the key benefits of Lingui is that it simplifies the process of managing translations by providing a centralized way to store and manage translation files.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="key-features">Key features<a href="https://lingui.dev/blog/2023/04/26/announcing-lingui-4.0#key-features" class="hash-link" aria-label="Direct link to Key features" title="Direct link to Key features">​</a></h3>
<ul>
<li><strong>Clean and readable</strong> - keep your code clean and readable, while the library uses the battle-tested and powerful ICU MessageFormat under the hood.</li>
<li><strong>Universal</strong> - use it everywhere: Vanilla JS, React, Vue.js, Next.js, Node.js, etc.</li>
<li><strong>Full rich-text support</strong> - use React components within localized messages without restriction. Writing rich-text messages is as easy as writing JSX.</li>
<li><strong>Powerful tooling</strong> - manage the entire intl workflow with <a href="https://lingui.dev/tutorials/cli" target="_blank" rel="noopener noreferrer">Lingui CLI</a>. It extracts messages from source code, validates messages coming from translators, and verifies that all messages are translated before shipping to production.</li>
<li><strong>Unopinionated</strong> - integrate Lingui with your existing workflow. It supports both message keys and auto-generated messages. Translations can be stored in a <a href="https://lingui.dev/ref/catalog-formats" target="_blank" rel="noopener noreferrer">variety of file formats</a> including PO, JSON, and CSV.</li>
<li><strong>Lightweight and optimized</strong> - core library is only <a href="https://bundlephobia.com/result?p=@lingui/core" target="_blank" rel="noopener noreferrer">1.5 kB gzipped</a>, React components are additional <a href="https://bundlephobia.com/result?p=@lingui/react" target="_blank" rel="noopener noreferrer">1.3 kB gzipped</a>.</li>
<li><a href="https://lingui.dev/misc/community" target="_blank" rel="noopener noreferrer">Active community</a>.</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="whats-new-in-40">What's new in 4.0?<a href="https://lingui.dev/blog/2023/04/26/announcing-lingui-4.0#whats-new-in-40" class="hash-link" aria-label="Direct link to What's new in 4.0?" title="Direct link to What's new in 4.0?">​</a></h2>
<p>This version is packed with tons of new features, improvements and fixes that will make internationalizing your JavaScript projects much easier!</p>
<p>The codebase has also been significantly refactored and updated. As a result, Lingui has become much more stable, lightweight, reliable, and less fragile.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="extractors">Extractors<a href="https://lingui.dev/blog/2023/04/26/announcing-lingui-4.0#extractors" class="hash-link" aria-label="Direct link to Extractors" title="Direct link to Extractors">​</a></h3>
<p>The big change in v4.0 is in the extractor internals. It is now less fragile and doesn't depend on host project settings. Also, the extractor now supports TypeScript out of the box.</p>
<h4 class="anchor anchorWithStickyNavbar_LWe7" id="hash-based-message-ids--context">Hash-based message IDs + Context<a href="https://lingui.dev/blog/2023/04/26/announcing-lingui-4.0#hash-based-message-ids--context" class="hash-link" aria-label="Direct link to Hash-based message IDs + Context" title="Direct link to Hash-based message IDs + Context">​</a></h4>
<p>The previous implementation had a flaw: there is an original message in the bundle at least 2 times + 1 translation.</p>
<p>For the line "Hello world", it will exist in the source as an ID in the i18n call, then as a key in the message catalog, and then as the translation itself. Strings can be very long, not just a few words, so this may add more kB to the bundle.</p>
<p>A much better option is to generate a "stable" ID based on the <code>msg</code> + <code>context</code> as a fixed length hash.</p>
<p>We've also added the ability to specify a <strong>context</strong> for the message. For more details, see the <a href="https://lingui.dev/tutorials/react-patterns#providing-a-context-for-a-message" target="_blank" rel="noopener noreferrer">Providing a context for a message</a>.</p>
<p>The context feature affects the message ID generation and adds the <code>msgctxt</code> parameter in case of the PO catalog format extraction.</p>
<h4 class="anchor anchorWithStickyNavbar_LWe7" id="custom-extractors">Custom Extractors<a href="https://lingui.dev/blog/2023/04/26/announcing-lingui-4.0#custom-extractors" class="hash-link" aria-label="Direct link to Custom Extractors" title="Direct link to Custom Extractors">​</a></h4>
<p>The extractor refactoring has allowed the creation of <strong>Custom Extractors</strong>. If your project does not work well with Lingui's extractor, you can easily write your own extractor implementation. This might be the case if you are using some experimental features (stage0 - stage2) or frameworks with custom syntax like Vue.js or Svelte. See the <a href="https://lingui.dev/guides/custom-extractor" target="_blank" rel="noopener noreferrer">Custom Extractor</a> guide for more details.</p>
<div class="theme-admonition theme-admonition-tip admonition_xJq3 alert alert--success"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>tip</div><div class="admonitionContent_BuS1"><p>Thanks to this feature, we have implemented a <a href="https://lingui.dev/tutorials/extractor-vue" target="_blank" rel="noopener noreferrer">Vue.js Extractor</a> that is already successfully integrated into Vue.js projects!</p></div></div>
<h4 class="anchor anchorWithStickyNavbar_LWe7" id="flow-syntax-support">Flow Syntax support<a href="https://lingui.dev/blog/2023/04/26/announcing-lingui-4.0#flow-syntax-support" class="hash-link" aria-label="Direct link to Flow Syntax support" title="Direct link to Flow Syntax support">​</a></h4>
<p>Lingui supports <a href="https://flow.org/" target="_blank" rel="noopener noreferrer">Flow</a> by default. If your project uses Flow, you need to explicitly <a href="https://lingui.dev/guides/flow" target="_blank" rel="noopener noreferrer">enable support</a> in the extractor.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="custom-formatters">Custom Formatters<a href="https://lingui.dev/blog/2023/04/26/announcing-lingui-4.0#custom-formatters" class="hash-link" aria-label="Direct link to Custom Formatters" title="Direct link to Custom Formatters">​</a></h3>
<p>If your project requires a special format or handling logic, you can write your own format implementation.</p>
<p>Formatter is a simple object with 2 main functions <code>parse</code> and <code>serialize</code>, which should take Lingui catalog and serialize it to string and vice versa.</p>
<p>You don't need to create a separate package for formatter, you can write it directly in <code>lingui.config.{ts,js}</code>.</p>
<p>The built-in Lingui formatters have been extracted into a separate packages:</p>
<ul>
<li><a href="https://www.npmjs.com/package/@lingui/format-po" target="_blank" rel="noopener noreferrer">@lingui/format-po</a> (enabled by default)</li>
<li><a href="https://www.npmjs.com/package/@lingui/format-po-gettext" target="_blank" rel="noopener noreferrer">@lingui/format-po-gettext</a></li>
<li><a href="https://www.npmjs.com/package/@lingui/format-json" target="_blank" rel="noopener noreferrer">@lingui/format-json</a></li>
<li><a href="https://www.npmjs.com/package/@lingui/format-csv" target="_blank" rel="noopener noreferrer">@lingui/format-csv</a></li>
</ul>
<p>See the <a href="https://lingui.dev/guides/custom-formatter" target="_blank" rel="noopener noreferrer">Custom Formatter</a> guide for more details.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="experimental-dependency-tree-crawling">Experimental dependency tree crawling<a href="https://lingui.dev/blog/2023/04/26/announcing-lingui-4.0#experimental-dependency-tree-crawling" class="hash-link" aria-label="Direct link to Experimental dependency tree crawling" title="Direct link to Experimental dependency tree crawling">​</a></h3>
<p>While the standard glob-based extraction process is effective for most projects, multipage (MPA) frameworks such as NextJS pose a problem because the glob-based approach creates a catalog consisting of all messages from all pages.</p>
<p>This means that the entire catalog must be loaded for each page/navigation, which results in loading messages that are not used on that page.</p>
<p>To address this issue, a new experimental extractor was introduced in version 4. This extractor uses the dependency tree of files, rather than just a glob pattern, to crawl imports and discover files more accurately.</p>
<p>By doing so, it creates a more optimized catalog that only contains the messages needed for each page.</p>
<p>The catalogs would still contain duplicate messages for common components, but it would be much better than the current approach.</p>
<p><img decoding="async" loading="lazy" alt="Scheme of discovering by dependencies" src="https://lingui.dev/assets/images/extractor-deps-scheme-a1918925811db3a4184d2a616a262e8f.svg" width="2027" height="1871" class="img_ev3q"></p>
<div class="theme-admonition theme-admonition-tip admonition_xJq3 alert alert--success"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>tip</div><div class="admonitionContent_BuS1"><p>See the <a href="https://lingui.dev/guides/message-extraction" target="_blank" rel="noopener noreferrer">Message Extraction</a> guide to learn more about how message extraction works.</p></div></div>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="improved-react-support">Improved React support<a href="https://lingui.dev/blog/2023/04/26/announcing-lingui-4.0#improved-react-support" class="hash-link" aria-label="Direct link to Improved React support" title="Direct link to Improved React support">​</a></h3>
<p>Lingui v4.0 includes a bunch of improvements to its React support, making it even easier for developers to implement internationalization and localization in their React applications. Visit the <a href="https://lingui.dev/tutorials/react" target="_blank" rel="noopener noreferrer">Internationalization of React apps</a> and <a href="https://lingui.dev/tutorials/react-patterns" target="_blank" rel="noopener noreferrer">Common i18n patterns in React</a> tutorials to learn the most common patterns for internationalizing React applications.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="plugins">Plugins<a href="https://lingui.dev/blog/2023/04/26/announcing-lingui-4.0#plugins" class="hash-link" aria-label="Direct link to Plugins" title="Direct link to Plugins">​</a></h3>
<p>During the development of Lingui v4.0, we have created two new plugins to improve the integration of Lingui with other tools and frameworks. These plugins are the <a href="https://lingui.dev/ref/swc-plugin" target="_blank" rel="noopener noreferrer">SWC Plugin</a> and the <a href="https://lingui.dev/ref/vite-plugin" target="_blank" rel="noopener noreferrer">Vite Plugin</a>.</p>
<p>Both of these plugins are designed to make it easier for developers to use Lingui with other modern tools and frameworks. We are excited to see how developers will use these plugins to improve their localization workflows and make their applications more accessible to a global audience.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="more-examples">More examples<a href="https://lingui.dev/blog/2023/04/26/announcing-lingui-4.0#more-examples" class="hash-link" aria-label="Direct link to More examples" title="Direct link to More examples">​</a></h3>
<p>As part of Lingui v4.0, we've also created new example projects that show how Lingui can be integrated into different types of applications. These projects demonstrate best practices for integrating Lingui with popular frameworks and libraries, including <a href="https://github.com/lingui/js-lingui/tree/main/examples/nextjs-babel" target="_blank" rel="noopener noreferrer">nextjs-babel</a>, <a href="https://github.com/lingui/js-lingui/tree/main/examples/nextjs-swc" target="_blank" rel="noopener noreferrer">nextjs-swc</a>, <a href="https://github.com/lingui/js-lingui/tree/main/examples/vite-project-react-babel" target="_blank" rel="noopener noreferrer">vite-project-react-babel</a>, <a href="https://github.com/lingui/swc-plugin/tree/main/examples/nextjs-13" target="_blank" rel="noopener noreferrer">nextjs-13</a> as well as the existing ones <a href="https://github.com/lingui/js-lingui/tree/main/examples/create-react-app" target="_blank" rel="noopener noreferrer">create-react-app</a> and <a href="https://github.com/lingui/js-lingui/tree/main/examples/js" target="_blank" rel="noopener noreferrer">js</a> were updated.</p>
<p>These example projects are a great resource for developers who are new to Lingui and want to see how it can be used in practice. They provide a clear starting point for building a multilingual application, and can help developers avoid common pitfalls and obstacles. We hope that these examples will inspire developers to try Lingui in their own projects and make their applications accessible to a wider audience.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="other-features">Other features<a href="https://lingui.dev/blog/2023/04/26/announcing-lingui-4.0#other-features" class="hash-link" aria-label="Direct link to Other features" title="Direct link to Other features">​</a></h2>
<p>Lingui v4 comes with a long list of useful features:</p>
<ul>
<li>extractor: support TS experimental decorators</li>
<li>macro: support tagged templates in <code>defineMessage</code> + short alias</li>
<li>macro: allow passing any expression as custom i18n instance</li>
<li>macro: support JSX macro inside conditional expressions</li>
<li>macro: support renamed identifiers in macro</li>
<li>core (Experimental): new core API for Node/JS usage without macros</li>
<li>core: support extracting from all forms of <code>i18n._</code> / <code>i18n.t</code> calls</li>
<li>extractor: respect sourcemaps</li>
</ul>
<p>Visit the <a href="https://github.com/lingui/js-lingui/releases/tag/v4.0.0" target="_blank" rel="noopener noreferrer">Release notes</a> to see all the updates.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="credits">Credits<a href="https://lingui.dev/blog/2023/04/26/announcing-lingui-4.0#credits" class="hash-link" aria-label="Direct link to Credits" title="Direct link to Credits">​</a></h2>
<p>We would like to say thanks to all the <a href="https://github.com/lingui/js-lingui/graphs/contributors" target="_blank" rel="noopener noreferrer">contributors</a> who made this release possible. It represents the hard work and dedication of a global community of developers who have contributed their time, expertise, and support.</p>
<p>We are also grateful to the entire community who provided valuable feedback, bug reports, and feature requests. Your contributions have helped shape and make Lingui better.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="see-more">See more<a href="https://lingui.dev/blog/2023/04/26/announcing-lingui-4.0#see-more" class="hash-link" aria-label="Direct link to See more" title="Direct link to See more">​</a></h2>
<ul>
<li><a href="https://lingui.dev/releases/migration-4" target="_blank" rel="noopener noreferrer">Migration guide from 3.x to 4.x</a></li>
<li><a href="https://github.com/lingui/js-lingui/releases/tag/v4.0.0" target="_blank" rel="noopener noreferrer">Lingui 4.0 full changelog</a></li>
</ul>]]></content>
        <author>
            <name>Andrii Bodnar</name>
        </author>
        <category label="release" term="release"/>
    </entry>
</feed>