Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@goodrequest/convert-translations-i18next

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@goodrequest/convert-translations-i18next

This scripts are converting JSON files which is generated by [ i18next ](https://www.npmjs.com/package/i18next) to CSV file and also back from CSV to JSON files.

  • 1.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

JSON to CSV converter script for i18next translations

This scripts are converting JSON files which is generated by i18next to CSV file and also back from CSV to JSON files.

Implementation

First you need to install the module as dev dependency into you project.

npm install --save-dev @goodrequest/convert-translations-i18next

Example of script to convert from json to csv

npx convert-json-to-csv @goodrequest/convert-translations-i18next

Example of script to convert back from csv to json

npx convert-csv-to-json @goodrequest/convert-translations-i18next

This is what a config file looks like

{
        // csv delimiter which is used in CSV file, default value is ';'
	"csvDelimiter": ";",
	// path for csv file, default value is "/public/translations.csv"
	"filePathForGeneratedCSV": "/public/translations.csv",
	// the languages which you want to convert, default value is all files which scripts founds
	"supportedLanguages":["cz", "sk", "en"],
	// the json files which you want to convert, default value is all files which scripts founds
	"includeFiles": ["loc", "paths"],
	// path for json files which is generated by i18next scanner, default value is "/public/locales"
	"pathToDirectoryForLocales": "/public/locales"
}

Default config

{
  "csvDelimiter": ";",
  "filePathForGeneratedCSV": "/public/translations.csv",
  "pathToDirectoryForLocales": "/public/locales"
}

You can also use your own config file. First option is to add config file i18JsonToCsv.config.json in to root folder. Second option is to pass path to your config file using process environment CONFIG_PATH.

npx cross-env CONFIG_PATH=/scripts/configs/myConfig.json convert-csv-to-json GoodRequest/i18nextJsonToCsv

FAQs

Package last updated on 08 Feb 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