
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
fes-locale-gen
Advanced tools
一个用于自动处理前端国际化的命令行工具,可以自动识别和替换代码中的中文文本,生成语言包,并支持 AI 翻译。
npm i -g fes-locale-gen
# 处理指定目录
fes-locale-gen -d <目录>
# 排除特定文件或目录
fes-locale-gen -d <目录> -e <排除路径>
# 支持多个排除路径
fes-locale-gen -d <目录> -e <排除路径1> -e <排除路径2>
# 处理单个文件
fes-locale-gen -f <文件路径>
# 初始化配置文件
fes-locale-gen config init
# 设置 API
fes-locale-gen config set --key <your-api-key> --url <api-url>
# 查看当前配置
fes-locale-gen config list
配置项说明:
# 翻译生成的中文文件
fes-locale-gen translate
翻译特性:
工具会在项目根目录下生成以下文件:
locales-generated/
├── zh-CN-common.js # 中文语言包
├── en-US-common.js # 英文语言包(翻译后生成)
└── errorlog-*.json # 错误日志(如果有错误)
{
"summary": {
"totalFiles": 100,
"processedFiles": 98,
"errorCount": 2,
"timestamp": "2024-01-01 10:00:00"
},
"errors": [
{
"file": "src/pages/index.vue",
"error": "错误信息",
"stack": "错误堆栈",
"time": "2024-01-01 10:00:00"
}
]
}
<!-- 转换前 -->
<template>
<div class="user-info">
<h1>用户信息</h1>
<el-button @click="save">保存</el-button>
</div>
</template>
<!-- 转换后 -->
<template>
<div class="user-info">
<h1>{{ $t('_.用户信息') }}</h1>
<el-button @click="save">{{ $t('_.保存') }}</el-button>
</div>
</template>
// locales/index.js
import enUSCommon from '../locales-generated/en-US-common';
export default {
_: enUSCommon, // 自动生成的翻译
// 其他手动添加的翻译...
};
https://github.com/szyuan/fes-locale-gen
欢迎提交 Issue 和 PR!
FAQs
一个用于自动处理前端国际化的命令行工具,可以自动识别和替换代码中的中文文本,生成语言包,并支持 AI 翻译。
The npm package fes-locale-gen receives a total of 8 weekly downloads. As such, fes-locale-gen popularity was classified as not popular.
We found that fes-locale-gen demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.