Code Monkey home page Code Monkey logo

gtd-scripts's Introduction

gtd-scripts

Scripts for getting things done.

The translate-json node script is simple. It takes an input .json file, a comma separated list of language codes supported by Google Translate, and an optional api key.

Usage with an API Key

node translate-json fixtures/translate-json/en.json fr,et,nl YOUR_GOOGLE_API_KEY

Usage without an API Key

node translate-json fixtures/translate-json/en.json fr,et,nl

This free version will let you batch-translate a file until you start beeing rejected by Google's servers. As this script has caching enabled, it's possible to translate files incrementally. New requests will become available in 2 hours aproximately.

Future Improvements:

  • Specifying output file name and location.

gtd-scripts's People

Contributors

jezzdk avatar randhipp avatar tewen avatar urielgolab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

gtd-scripts's Issues

Error message

Hello, and thank you for your script,
but i can't make it works...

node translate-json <api-key> fixtures/translate-json/en.json fr

result:

Translating Afrikaans to fr
(node:14976) UnhandledPromiseRejectionWarning: Error: Forbidden
    at PromiseRequest.Request.callback (E:\_sandbox\translate-json\node_modules\superagent\lib\node\index.js:706:15)
    at parser (E:\_sandbox\translate-json\node_modules\superagent\lib\node\index.js:916:18)
    at Stream.res.on (E:\_sandbox\translate-json\node_modules\superagent\lib\node\parsers\json.js:19:7)
    at Stream.emit (events.js:182:13)
    at Unzip.unzip.on (E:\_sandbox\translate-json\node_modules\superagent\lib\node\unzip.js:55:12)
    at Unzip.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1098:12)
    at process.internalTickCallback (internal/process/next_tick.js:72:19)
(node:14976) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:14976) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Run on Windows 10 & node 11.2.0

Thanks!

Does it work with Node 10

(node:17040) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/tmp/fr-1544083108.json'
at Object.openSync (fs.js:436:3)
at Object.writeFileSync (fs.js:1187:35)
at sum.concat._.reduce.then (C:\Users\tibin\Desktop\Translate\gtd-scripts\translate-json:61:16)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:17040) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:17040) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

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.