npm install vue-auto-translate
{
"translateModel": 1, // Translation mode: 1 (i18n), 2 (Dolphin format)
"strict": false, // Strict mode or not. The default value is false to extract global Chinese. If true, only Chinese in $t("). $L(") will be extracted
"filePath": "./", // Specifies the directory where you want to query translations
"targetPath": "", // Specify the output directory after successful translation, empty will be automatically queried, listed:"/src/i18n" ,'/resources/assets/js/language/language.js‘
"languageList": [ // Specifies a list of languages to be translated
"CN",
"EN",
"TC"
],
"channel": "google", // Translation channel: youdao, google
"appKey": "", // Translation channel application key, google does not need
"secretKey": "", // Translation channel application key, google does not need
"excludes": [ // Exclude directories that do not require translation
"node_modules",
"vendor",
"build",
"dist",
".git",
".vscode",
"storage",
"public",
"language",
"database",
"lang",
"i18n",
".svn"
],
"fileSuffix": [ // Specifies which suffix files to translate only
".vue",
".html",
".js",
".ts",
".php"
]
}
npm run translate //All Chinese characters in the configuration directory are automatically extracted for translate
npm run translate -- '你好' //Only a single input text is translated