Socket
Socket
Sign inDemoInstall

@lingui/babel-plugin-extract-messages

Package Overview
Dependencies
Maintainers
3
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lingui/babel-plugin-extract-messages

Babel plugin for collecting messages from source code for internationalization


Version published
Weekly downloads
158K
decreased by-11.5%
Maintainers
3
Weekly downloads
 
Created

What is @lingui/babel-plugin-extract-messages?

@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.

What are @lingui/babel-plugin-extract-messages's main functionalities?

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"
          }
        ]
      }
    ]
  ]
}
```

Other packages similar to @lingui/babel-plugin-extract-messages

Keywords

FAQs

Package last updated on 14 Apr 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc