![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@lingui/babel-plugin-extract-messages
Advanced tools
Babel plugin for collecting messages from source code for internationalization
@lingui/babel-plugin-extract-messages is a Babel plugin designed to extract messages from your code for internationalization (i18n) purposes. It works in conjunction with the LinguiJS framework to help developers manage and translate text in their applications.
Extracting Messages
This feature allows you to extract messages from your codebase into a specified directory. The configuration specifies the directory where the extracted messages will be stored and whether to extract messages from `formatMessage` calls.
```json
{
"presets": ["@babel/preset-env", "@babel/preset-react"],
"plugins": [
[
"@lingui/babel-plugin-extract-messages",
{
"localeDir": "./locales/",
"extractFromFormatMessageCall": true
}
]
]
}
```
Custom Message Extraction
This feature allows you to define custom formatters for message extraction. The configuration includes a custom formatter with a specific name and pattern, enabling more flexible message extraction.
```json
{
"presets": ["@babel/preset-env", "@babel/preset-react"],
"plugins": [
[
"@lingui/babel-plugin-extract-messages",
{
"localeDir": "./locales/",
"extractFromFormatMessageCall": true,
"customFormatters": [
{
"name": "customFormatter",
"pattern": "customPattern"
}
]
}
]
]
}
```
babel-plugin-react-intl is a Babel plugin for extracting messages from React components that use the react-intl library. It is similar to @lingui/babel-plugin-extract-messages but is specifically designed for use with react-intl, making it a good choice for projects already using that library.
i18next-extract-gettext is a tool for extracting translation keys from JavaScript and TypeScript codebases that use the i18next library. It provides similar functionality to @lingui/babel-plugin-extract-messages but is tailored for use with i18next, offering a different approach to internationalization.
Babel plugin which extracts messages for translation from source files
@lingui/babel-plugin-extract-messages
is part of LinguiJS. See the documentation for all information, tutorials and examples.
npm install --save-dev @lingui/babel-plugin-extract-messages
# yarn add --dev @lingui/babel-plugin-extract-messages
.babelrc
(Recommended).babelrc
{
"plugins": ["@lingui/babel-plugin-extract-messages"]
}
babel --plugins @lingui/babel-plugin-extract-messages script.js
require("@babel/core").transform("code", {
plugins: ["@lingui/babel-plugin-extract-messages"]
})
5.2.0 (2025-01-31)
FAQs
Babel plugin for collecting messages from source code for internationalization
The npm package @lingui/babel-plugin-extract-messages receives a total of 0 weekly downloads. As such, @lingui/babel-plugin-extract-messages popularity was classified as not popular.
We found that @lingui/babel-plugin-extract-messages 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.