Giter VIP home page Giter VIP logo

get_copy's Introduction

get_copy script

Turns a Google spreadsheet of translation keys and string values into a JSON file, which can be used with tools like ngx-translate, react-i18next, or vue-i18n.

Installation

npm install --dev @ayogohealth/get_copy

Usage

Usage: get_copy [OPTIONS] [SPREADSHEET_ID]

Options:
  -h, --help                  Print this help message and exit

  -v, --verbose               Print warnings to the console for debugging

  -o, --output=FILE           Destination file path (default: stdout)

  -c, --value-column=COL      Title of spreadsheet column to use for the
                              translation values (default: "value")

  -k, --key-column=COL        Title of spreadsheet column to use for the
                              translation key name (default: "key")

      --no-auth-cache         Disables caching of authentication tokens to file

      --header                Header to include at the top of the output file

Examples

Using this example spreadsheet:

npx get_copy -o src/locales/en.json 1L9x1ocxy6VwNEPsrWiTri4wGYN9FQUymRg1p267r9R4

npx get_copy -o src/locales/fr.json -c "Value-FR" 1L9x1ocxy6VwNEPsrWiTri4wGYN9FQUymRg1p267r9R4

The contents of src/locales/en.json would be:

{
  "app_name": "Hello",
  "main": {
    "footer": "Goodbye",
    "greeting": "Hello {name}!"
  }
}

The contents of src/locales/fr.json would be:

{
  "app_name": "Bonjour",
  "main": {
    "footer": "Au revoir",
    "greeting": "Bonjour {name}!"
  }
}

Contributing

Contributions of bug reports, feature requests, and pull requests are greatly appreciated!

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Licence

Released under the MIT Licence.

Copyright ยฉ 2022 โ€“ 2023 Ayogo Health Inc.

get_copy's People

Contributors

dpogue avatar isuda avatar dependabot[bot] avatar

Watchers

 avatar  avatar

get_copy's Issues

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.