Socket
Socket
Sign inDemoInstall

@connectedcars/react-i18n

Package Overview
Dependencies
Maintainers
4
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@connectedcars/react-i18n

Translations!


Version published
Weekly downloads
99
decreased by-8.33%
Maintainers
4
Weekly downloads
 
Created
Source

@connectedcars/react-i18n

Work in progress.

Todo

  • fuzzy translations
  • improve documentation

Installation

npm install @connectedcars/react-i18n

Usage

See the example project located in the example folder. In particular how the context is setup.

Then a translator can be picked up from the context.

const {t} = this.context

Where t returns a translated string.

Translate a simple piece of text:

t('This text should be translated')

Translate text containing a variable:

t('This {word} is in a translated sentence.', { word: 'Variable'})

Import and Export

First you need to set up the import and export scripts in your package.json

...

"scripts": {
  "import": "i18n-import",
  "export": "i18n-export",
}

...

Then you can run the following commands:

  • npm run export creates a POT file with the extracted translations in ./locales/template.pot
  • npm run import creates a json file containing your all your translations in ./src/translations.json

CI

To get output for CI, add the following script:

  "ci-translation": "i18n-translation-status"

Keywords

FAQs

Package last updated on 19 Jul 2018

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