Giter VIP home page Giter VIP logo

mksong76 / i18n-jsons-to-xlsx-converter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ofcyln/i18n-json-to-xlsx-converter

0.0 0.0 0.0 1.02 MB

i18n JSON to XLSX Converter is a CLI tool runs in a terminal, and helps you to convert a JSON file(s) to EXCEL sheet(s) including keys column defined as nested with dot notation, and the values column for those keys. Also, the CLI tool converts an EXCEL sheet to JSON file(s) by considering its values columns as individual files.

Home Page: https://www.npmjs.com/package/i18n-json-to-xlsx-converter

License: MIT License

JavaScript 31.94% TypeScript 67.27% Shell 0.79%

i18n-jsons-to-xlsx-converter's Introduction


npm GitHub code size in bytes GitHub contributors npm GitHub last commit npms.io (final)

i18n-jsons-to-xlsx-converter CLI

About

i18n JSONs to XLSX Converter is a CLI tool runs in a terminal, and helps you to convert a JSON file(s) to EXCEL sheet(s) including keys column defined as nested with dot notation, and the values column for those keys. Also, the CLI tool converts an EXCEL sheet to JSON file(s) by considering its values columns as individual files.

Installation

Install i18n JSONs to XLSX Converter with npm

npm install i18n-jsons-to-xlsx-converter

Usage/Examples

If you have installed i18n JSONs to XLSX Converter you can use it with the command

i18n-jsons-to-xlsx-converter 'file path of the JSON or XLSX file'

If you haven't installed i18n JSON to XLSX Converter you can use it with the command

${I18N_JSONS_TO_XLSX_CONVERTER}/convert 'file path of the JSON or XLSX file'

Assume that you have it in the directory indicated by the environment variable I18N_JSONS_TO_XLSX_CONVERTER

i18n JSONs to XLSX Converter examines and understands your XLSX files if it has multiple language value columns, then it creates one or multiple JSON files from that translation columns provided.


If you want to convert multiple JSON files at once, use each file paths provided

i18n-jsons-to-xlsx-converter 'filePathOne.json' 'filePathTwo.json'

If you have group in files, then use a list in common.

i18n-jsons-to-xlsx-converter my_service/lang/common_{en,ko,ja}.json

It would generate my_service/lang/common_translation.xlsx including columns including upper cased file names. (eg. COMMON_EN, COMMON_KO, COMMON_JA) JSON files should have same keys, so if they has different key sets, then don't use those files in a command.

Details

i18n JSONs to XLSX Converter created for helping developers for generating an EXCEL file from their JSON file which is used for i18n translations. Also, developers can create one, or many JSON files from an EXCEL file for their project, as well.

Features

  • It can convert multiple i18n JSON file to an EXCEL sheet
  • It can convert an EXCEL sheet to JSON file(s) easily
  • It runs in a terminal
  • Well tested, and documented

Reason behind converting a JSON file to an XLSX sheet

A multilingual application, needs translation files in the project to support multiple languages. Hence, developers need language files in JSON file format, and these JSON files need to have translation values for each key.

Assume that we have a JSON file name as en.json, and it has a content as

    {
      "nestedObject": {
        "nameOfTheArea": {
          "title": "Title",
          "subTitle": "Subtitle",
          "context": "Context"
        }
      }
    }

Since different teams are handling the translations, and they can't work on the JSON files because they are not specialized on the app development, most of them can work on an EXCEL sheet easily.

i18n JSONs to XLSX Converter CLI tool helps developers to provide an EXCEL sheet ready to include translations for the other teams. It can be filled as an EXCEL file with one, or many translation columns they want to provide, and when the translation value implementation is finished, developers can get back the sheet, and convert the EXCEL sheet into JSON format again, easily.

If the provided EXCEL sheet has only one translation value column, the output JSON file will be only one, and it will have the column title as file name. In this case it'll be en.json

If the translation team fill out the values in the EXCEL sheet for only one language column for example EN, in this case the sheet needs to be in the format of

Key EN
nestedObject.nameOfTheArea.title Title
nestedObject.nameOfTheArea.title Subtitle
nestedObject.nameOfTheArea.title Context

If the provided EXCEL sheet has multiple translation value columns, the output JSON files will be multiple, and they will have the column titles as file names. In this case they'll be en.json, nl.json, de.json,

If the translation team fill out the values in the EXCEL sheet for multiple language column for example EN, NL, DE, in this case the sheet needs to be in the format of

Key EN NL DE
nestedObject.nameOfTheArea.title Title Titel Titel
nestedObject.nameOfTheArea.title Subtitle Ondertitel Untertitel
nestedObject.nameOfTheArea.title Context Context Kontext

i18n JSON to XLSX Converter will remove the manual labor for developers to create JSON file(s) from an EXCEL sheet, also will help developers to create one or more EXCEL sheet(s) from a JSON file(s) for the translation teams, easily.

Author

@mksong76

For support, email [email protected]

License

MIT

i18n-jsons-to-xlsx-converter's People

Contributors

mksong76 avatar ofcyln avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.