在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):filaraujo/gulp-i18n-localize开源软件地址(OpenSource Url):https://github.com/filaraujo/gulp-i18n-localize开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-i18n-localize
Install
Usagevar gulp = require('gulp');
var i18n = require('gulp-i18n-localize');
gulp.task('default', function () {
return gulp.src('src/index.html')
.pipe(i18n({
locales: ['en-US'],
localeDir: './locales'
}))
.pipe(gulp.dest('dist'));
}); File structureCreate a localization folder For example if you wanted to add spanish translations for animals you would
create a {
"cat": "gato",
"dog": {
"name": "perro"
}
} You then could reference this by using APIi18n(options)optionsdelimetersType: Sets the delimeters to search assets files and replace with translated content.
By default, it will match
ignoreErrorsType: Sets whether to ignore errors and prevent gulp from failing. This will still log errors to gulp. localeDirType: Location of translation files. This is a required field. localesType: Locales to translate, should match schemaType: Sets the schema to be used for naming translated assets.
LicenseMIT © Filipe Araujo |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论