
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
@lingui/swc-plugin
Advanced tools
A Rust versions of LinguiJS Macro
.swcrc
https://swc.rs/docs/configuration/swcrc
{
"$schema": "https://json.schemastore.org/swcrc",
"jsc": {
"experimental": {
"plugins": ["@lingui/swc-plugin", {
// Optional
// Unlike the JS version this option must be passed as object only.
// Docs https://lingui.js.org/ref/conf.html#std-config-runtimeConfigModule
// "runtimeModules": {
// "i18n": ["@lingui/core", "i18n"],
// "trans": ["@lingui/react", "Trans"]
// }
}]
}
}
}
Or Next JS Usage:
next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
experimental: {
swcPlugins: [
['@lingui/swc-plugin', {
// the same options as in .swcrc
}],
],
},
};
module.exports = nextConfig;
t macro cases:
t`Some string` t`Some ${variable} string` t`Some ${expression} string` t(i18n)`Some string` - custom i18n instance{name, name, count}t macro cases:
t({ message descriptor }) call with message descriptor objectt() eq: t({message: plural(...)})defineMessage
plural(count, {one: '# item', few: '# items'}) - simple stringsplural(count, {one: `${variable} # item`, few: '# items'}) - tpls with placeholdersplural(expression(), {one: `${variable} # item`, few: '# items'}) - expression as parameter{name, name, count}offset:1 and exact matches =1 {...}<Trans>
<Trans>Hello World</Trans> -> <Trans message="Hello World" /><Trans>Hello {name} and {getName()}</Trans> -> <Trans variables={name, 1: getName()} msg="Hello {name} and {1}"/><Trans>Hello <strong>World!</strong></Trans><Trans>{'Hello World'}</Trans> and <Trans>{`How much is ${expression}? ${count}`}</Trans><Plural> <SelectOrdinal> <Select>
offset:1 and exact matches =1 {...}@lingui/macroimport { i18n } from @lingui/coreruntimeConfigModule settingsimport {t as macroT} from "@lingui/macro"The project is licensed under the MIT license.
FAQs
A SWC Plugin for LinguiJS
The npm package @lingui/swc-plugin receives a total of 86,490 weekly downloads. As such, @lingui/swc-plugin popularity was classified as popular.
We found that @lingui/swc-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.