New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

webpack-translate

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-translate

[中文](https://github.com/aiyuekuang/webpack-translate/blob/master/README.md) | [EN](https://github.com/aiyuekuang/webpack-translate/blob/master/README.en.md)

latest
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

webpack-translate

中文 | EN

安装:

npm install webpack-translate
or
yarn add webpack-translate

使用:

//webpack.config.js
//webpack配置中的plugins属性
import Translate from "webpack-translate";


plugins: [
            new Translate({
                translateTypes:["en", "ko", "ja","gd"],
                suffix:"js",
                path:path.resolve(__dirname,"./src/components/locales"),
                source:path.resolve(__dirname,"./src/components/locales/zh_CN.js")
            }),
           //其他wenpack插件
        ]

文档:

api类型默认值说明
translateTypesarray[string]["en"]需翻译的目标语言简写,查询简写地址
suffixstring"js"输出的语言文件的后缀名
pathstring'./src/components/locales/'输出的语言文件相对项目根目录的地址
sourcestring'../src/components/locales/zh_CN.js'需作为源语言进行翻译的文件
outputFileNamearray[string][]输出文件的其他名称设置,与上方translateTypes的数组一一对应即可,注意个数必须保持一致
fromstring"zh-CN"翻译源文件的语言简码

Keywords

webpack-translate

FAQs

Package last updated on 24 Sep 2021

Did you know?

Socket

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.

Install

Related posts