Socket
Socket
Sign inDemoInstall

@lingui/macro

Package Overview
Dependencies
39
Maintainers
1
Versions
110
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @lingui/macro

Macro for generating messages in ICU MessageFormat syntax


Version published
Weekly downloads
103K
decreased by-15.01%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

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.

New Features

Bug Fixes

  • CLI: how help for unrecognized commands (#308). Thanks to An Nguyen.
  • Fix Flow types (#306).

<a name="2.6.1"></a>

Readme

Source

License Version Downloads Babel Macro

@lingui/macro

Babel Macros which transforms tagged template literals and JSX components to ICU MessageFormat.

@lingui/macro is part of LinguiJS. See the documentation for all information, tutorials and examples.

Installation

npm install --save-dev @lingui/macro
# yarn add --dev @lingui/macro

Usage

See the reference documentation.

import { setupI18n } from '@lingui/core'
import { t } from '@lingui/macro'

const i18n = setupI18n()

const message = i18n._(t`Hello, my name is ${name} and today is ${date(now)}`)

// line above is transformed using babel-plugin-macros to this
// const message = i18n._(/*i18n*/{ id: "Hello, my name is {name} and today is {now,date}", values: { name, now }})

License

MIT

Keywords

FAQs

Last updated on 10 Sep 2018

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc