This is a supporting tools for PFS Localization Project
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.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>
example.jsp
<div class="list-group-item">
<div class="row">
<div class="col-sm-4"><label><fmt:message key="entity.type.details.should.this.entity.type.be.navigable" /></label></div>
<div class="col-sm-8"><%=entityType.isNavigable()%></div>
</div>
</div>
result.properties
entity.type.details.should.this.entity.type.be.navigable = Should this Entity Type be navigable?:
result_zh.properties
entity.type.details.should.this.entity.type.be.navigable = 该实体类型是否可导航?:
Command is built by using yargs.
node index.js <commands> [args]
Commands:
scan [src] Run tool to scan directory/file
translate [text] Translate a english text to specify language
(default is zh)
Options:
--version Show version number [boolean]
--dist, -d Exported file destination directory [default: "./dist"]
--target, -t Target language for translation [default: "zh"]
--help Show help [boolean]
For more information, see https://github.com/phamvanthang310/PFS-tools
- Build:
npm run build
. Built src is stored in/lib
directory. - Copy
/lib
and index.js file to server. - run
node index.js <cmd> [args]