Socket
Book a DemoInstallSign in
Socket

babel-plugin-tagged-translations

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-tagged-translations

A dead simple babel-plugin for translating texts in React applications

1.0.0
latest
npmnpm
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

tagged-translations

Build Status

A dead simple babel-plugin for translating texts in React applications.

Input

<Header>
  t`Hello ${name}!`
</Header>

Output

<Header>
  `Xin chào ${name} 🤣!`
</Header>

Features

  • Build time translation: build app with minimal footprint.
  • Based on ES6 tagged template literals: really helpful for readability/ maintaination/ integrations.
  • Translations are configured in a JSON file.

Usage

Via .babelrc

{
  "plugins": [
    ["tagged-translations", {
      "translation": "./translation.json",
      "tagName": "t"
    }]
  ]
}
  • translation: the location of translation json.
  • tagName: translation tag name. Default: t.

Notes

  • We don't cover 100% cases: don't support \n characters.

FAQs

Package last updated on 26 Jul 2017

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.