npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

auto-i18n-updater

v1.0.3

Published

Automated i18n translation and upload library for SeaArt React Native applications

Readme

auto-i18n-updater

🚀 自动化国际化翻译工具

自动从 GitLab 下载 Excel 翻译文件,支持多语言处理、云存储上传和 Git 自动化。

✨ 核心功能

  • 📄 GitLab 集成 - 直接下载 Excel 翻译文件
  • ☁️ 云存储上传 - 可选的文件上传功能
  • 🔄 Git 自动化 - 自动创建分支和合并请求
  • 🛡️ 安全配置 - 环境变量管理敏感信息

🚀 快速开始

1. 安装

# 全局安装(推荐)
npm install -g auto-i18n-updater

# 或项目安装
npm install auto-i18n-updater

2. 初始化配置

auto-i18n init --type react-native

3. 配置环境变量

# .env 文件
GITLAB_TOKEN="your_gitlab_token"
SEAART_UPLOAD_TOKEN="your_upload_token"  # 可选

4. 运行

# 下载翻译文件
auto-i18n download

# 完整更新流程
auto-i18n fullupdate --create-mr

⚙️ 基本配置

编辑生成的 auto-i18n.config.js 文件:

export default {
  appName: 'your-app',
  
  // GitLab 配置(必需)
  gitlab: {
    repositoryUrl: 'https://gitlab.com/your-org/translations',
    filePath: 'translations.xlsx',
    branch: 'main'
  },
  
  // 应用配置
  app: {
    type: 'react-native',
    translationDir: 'src/locales'
  },
  
  // 功能开关
  features: {
    upload: true,        // 启用上传
    gitAutomation: true  // 启用 Git 操作
  },
  
  // 令牌配置
  tokens: {
    gitlab: process.env.GITLAB_TOKEN,
    seaartUpload: process.env.SEAART_UPLOAD_TOKEN
  }
}

📋 命令参考

| 命令 | 描述 | |------|------| | auto-i18n init | 初始化配置文件 | | auto-i18n download | 仅下载翻译文件 | | auto-i18n fullupdate | 完整更新流程 | | auto-i18n fileinfo | 查看文件信息 | | auto-i18n onlygit | 仅 Git 操作 |

常用选项

  • -c, --config <path> - 指定配置文件
  • --create-mr - 创建合并请求
  • --no-create-mr - 不创建合并请求

🔧 API 使用

import { AutoI18nUpdater, ConfigManager } from 'auto-i18n-updater'

// 加载配置
const config = await ConfigManager.load('./auto-i18n.config.js')
const updater = new AutoI18nUpdater(config)

// 下载翻译文件
const translations = await updater.runExcelDownload()

// 完整更新流程
const result = await updater.runFullUpdate({ createMR: true })

📁 项目结构

your-project/
├── src/locales/           # 生成的翻译文件
│   ├── en.json
│   ├── zh.json
│   └── ...
├── ios/translations/      # iOS 翻译文件
├── android/.../translations/  # Android 翻译文件
└── auto-i18n.config.js    # 配置文件

🛠️ 故障排除

常见问题

下载失败

  • 检查 GitLab Token 权限
  • 验证仓库 URL 和文件路径
  • 确认网络连接

配置错误

# 查看文件信息
auto-i18n fileinfo

# 重新初始化
auto-i18n init --type react-native

Token 获取

  1. 登录 GitLab
  2. 设置 → Access Tokens
  3. 创建新令牌(需要 read_repository 权限)

🔧 高级配置

export default {
  app: {
    type: 'react-native',
    translationDir: 'src/locales',
    nativeProjects: {
      ios: 'ios/translations',
      android: 'android/app/src/main/assets/translations'
    }
  }
}
export default {
  git: {
    baseBranch: 'dev',
    targetBranch: 'dev',
    autoMR: true,
    assignees: ['maintainer'],
    labels: ['i18n']
  }
}
# .gitlab-ci.yml
update-translations:
  script:
    - npm install -g auto-i18n-updater
    - auto-i18n fullupdate --create-mr
  only:
    - main

📦 版本信息

  • 版本: v1.0.1
  • Node.js: >= 14.0.0
  • 支持: React Native, Vue, Nuxt, React

📄 许可证

MIT License


💡 快速提示

  • 🔥 首次使用: 运行 auto-i18n init 开始
  • 📝 配置帮助: 查看生成的配置文件注释
  • 🚨 遇到问题: 运行 auto-i18n fileinfo 检查连接
  • 🤖 CI/CD: 使用 fullupdate --create-mr 自动化

如有问题,请提交 Issue 或联系开发团队。