GithubHelp home page GithubHelp logo

pfs-tools's Introduction

PFS TOOLS

This is a supporting tools for PFS Localization Project

Build props from from jsp file

The properties of hard-coded text will be generated under format: file.name = hard.coded.text (separated by . word by word).

Property files are exported under /dist directory. File name format: {filename}_{target}.properties).

  • filename: is the same as scanned jsp file.
  • target: is the language tag which used in google API translator.

Example:

Input

EntityTypeDetails.jsp:

<div class="list-group-item">
    <div class="row">
        <div class="col-sm-4"><label>Should this Entity Type be navigable?:</label></div>
        <div class="col-sm-8"><%=entityType.isNavigable()%></div>
    </div>
</div>

Output

EntityTypeDetails.jsp

<div class="list-group-item">
    <div class="row">
        <div class="col-sm-4"><label><fmt:message key="entityTypeDetails.text.shouldThisEntityTypeBeNavigable" /></label></div>
        <div class="col-sm-8"><%=entityType.isNavigable()%></div>
    </div>
</div>

result.properties

entityTypeDetails.text.shouldThisEntityTypeBeNavigable = Should this Entity Type be navigable?:

result_zh.properties

entityTypeDetails.text.shouldThisEntityTypeBeNavigable = 该实体类型是否可导航?:

Command:

Command is built by using yargs.

node index.js <commands> [args]

Commands:
  index.js scan [src]              Run tool to scan directory/file
  index.js translate [text]        Translate a english text to specify language
                                   (default is zh)
  index.js export [path1] [path2]  export to .csv file

Options:
  --version        Show version number                                 [boolean]
  --dist, -d       Exported file destination directory       [default: "./dist"]
  --target, -t     Target language for translation               [default: "zh"]
  --overwrite, -o  overwrite file if exist                      [default: false]
  --export, --exp  export to .csv file                          [default: false]
  --basename, -n   set basename of properties file
                                                [default: "ApplicationMessages"]
  --help           Show help                                           [boolean]

For more information, see https://github.com/phamvanthang310/PFS-tools

Production deployment

  1. Build: npm run build. Built src is stored in /lib directory.
  2. Copy /lib and index.js file to server.
  3. run node index.js <cmd> [args]

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.