Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
gulp-i18n-xlsx-resolve
Advanced tools
将翻译文档(xls/xlsx)转为json或ini的gulp插件;
npm install gulp-i18n-xlsx-resolve --save-dev
language.xlsx
:
key | English | CHINE_NEW | CHINE_OLD | bak |
---|---|---|---|---|
name | languages | 多语言 | 多語言 | 项目名称 |
menu.new | New | 创建 | 創建 | 创建图标title |
gulpfile.js
:
var gulp = require('gulp');
var concat = require('gulp-concat');
var i18n = require('../');
gulp.task('i18n',function(){
var files = gulp.src("./language.xlsx");
var langMap = {
'chine_new':"zh-cn"
,'chine_old':"zh-hk"
,'english':"en"
};
//生成json
files.pipe(i18n({
'type':'json' // 输出为 'ini' or 'json' 默认 'json'
,'keyColumnName':"key" //引用列的名称 默认为 'key'
,'langMap': langMap //语言映射
,'passColumns':['bak'] //不输出的列
//,'sheets': ['sheet1'] //默认处理文件中的所有表,sheets参数 可以指定要处理的表
//,'concat':'concatfilename' //合并语言包,的包名,不设置则不合并
//,'nosplit': false //设为true时,不拆开key字段,直接以key字段值做为键名,ini无影响 , 默认false
}))
.pipe(gulp.dest('./language'))
//生成ini
files.pipe(i18n({
'type':"ini" //输出为ini格式文件
,'passColumns':['bak']
,'langMap':langMap
}))
.pipe(concat("langs.ini"))
.pipe(gulp.dest('./language'))
})
Run gulp i18n
// ./language/en.json
{"name":"languages","menu":{"new":"New"}}
// ./language/zh-cn.json
{"name":"多语言","menu":{"new":"创建"}}
// ./language/zh-cn.json
{"name":"多語言","menu":{"new":"創建"}}
// ./language/langs.ini
[en]
name=languages
menu.new=New
[zh-cn]
name=多语言
menu.new=创建
[zh-hk]
name=多語言
menu.new=創建
FAQs
Generation language pack from Excel(xls,xlsx)
The npm package gulp-i18n-xlsx-resolve receives a total of 0 weekly downloads. As such, gulp-i18n-xlsx-resolve popularity was classified as not popular.
We found that gulp-i18n-xlsx-resolve demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.