generate-i18n-files

1.0.6 • Public • Published

generate-i18n-files

Installation

npm install generate-i18n-files # with npm
yarn add generate-i18n-files # with yarn

Usage

const { excelToJson, jsonToExcel } = require("generate-i18n-files");
const path = require("path");

const jsonToExcelOptions = {
    keyName: "key", // Key name column
    sourceLocale: "vi", // Source locale
    targetLocales: ["ja", "en"], // Target locales
};

jsonToExcel(
    path.resolve(__dirname, "./resources/vi.json"), // Source json file path
    path.resolve(__dirname, "./resource.xlsx"), // Excel file path
    jsonToExcelOptions
);

const excelToJsonOptions = {
    keyName: "key", // Key name column
    locales: ["ja", "en"], // Locales you want to generate
};

excelToJson(
    path.resolve(__dirname, "./resource.xlsx"), // Excel file path
    path.resolve(__dirname, "./resources"), // Directory contains json files
    excelToJsonOptions
);

Package Sidebar

Install

npm i generate-i18n-files

Weekly Downloads

2

Version

1.0.6

License

ISC

Unpacked Size

6.02 kB

Total Files

4

Last publish

Collaborators

  • midas-inc