Giter Site home page Giter Site logo

zarkenciel / parse-jhi-translate Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 9 KB

Avoid the manual writing of your jhipster translations files. Make an npm command from this node script, it will parse your code, search for the "parse-jhi-translate" directives, extracts keys/values and store them in json files.

JavaScript 100.00%

parse-jhi-translate's Introduction

parse-jhi-translate

Avoid the manual writing of your jhipster translations files. Make an npm command from this node script, it will parse your code, search for the "jhiTranslate" directives, extracts keys/values and store them in json files.

set up

  • Put the parse-jhi-translate anywhere you want in your project, like a /scripts folder.
  • Edit your package.json file, add in the 'script section' : "parse-jhi-translate": "node scripts/parse-jhi-translate.js" (use the location you did put the script in).
  • Execute 'npm run parse-jhi-translate', et voilà !

notes

  • If the directive is boxed or if the key is an interpolation, the directive will be ignored.
  • First part of a translation key is considered to be the name of the translation file, eg "messages.warn.lightwarn.plzretry" will be expected to be in the messages.json file.
  • If an expected translation file does not exists, it will be created.
  • If a json translation file already exists and contain a translation key, the associated value will be considered as the correct one, and reused. Meaning, the code will not have precedence over an existing translation file.
  • New translation keys will be added if the file already exists.

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.