3.9.5 • Published 4 years ago

@translation/macro v3.9.5

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

License Version Downloads Babel Macro

@translation/macro

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

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

Installation

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

Usage

See the reference documentation.

import { setupI18n } from "@translation/core"
import { t } from "@translation/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

3.9.5

4 years ago

3.9.4

4 years ago

3.9.1

4 years ago