@zhixu/m18n
v1.0.0-beta.1
Published
国际化工具链 — i18n scanning, translation, and runtime utilities
Downloads
159
Maintainers
Readme
m18n
国际化工具链 — i18n scanning, translation, and runtime utilities.
Installation
npm install m18nUsage
Runtime API
import { t, updateLocale } from 'm18n';
t('你好');
t('欢迎 {{name}}', { name: 'World' });
updateLocale({ '你好': 'Hello' });CLI
npx m18n githook --scan # 检测新词条并自动执行全流程
npx m18n scan # 扫描代码中的 i18n 词条
npx m18n sync # 同步扫描结果到各语言文件
npx m18n start [--export] # 全流程: 扫描→同步→翻译→导出API
t(key, params?)— 翻译updateLocale(config)— 动态合并词条getRCRequest()— HTTP 请求工具setConfig(key, config)/getConfig(key)— 全局配置state/refreshView/useModel— React 状态管理装饰器
License
MIT
