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

crossfire-i18n

v1.0.0

Published

AI-powered JSON i18n translation tool with CrossFire Translation - use multiple source languages for higher accuracy

Downloads

5

Readme

CrossFire i18n

A CLI tool for automatically translating JSON-based i18n files using AI, featuring CrossFire Translation - a revolutionary approach that uses multiple source languages simultaneously for higher translation accuracy.

✨ Key Features

🎯 CrossFire Translation

Use multiple source languages simultaneously to achieve unprecedented translation accuracy. By cross-referencing translations from different languages, AI can better understand context, cultural nuances, and technical terminology.

Traditional Translation:

English → AI → Japanese

CrossFire Translation:

English + Chinese → AI → Japanese (Higher accuracy!)

🚀 Other Features

  • ✅ Batch translation with progress bars
  • ✅ Smart incremental updates (only translate changed content)
  • ✅ Support for OpenAI API and compatible services (Qwen/DashScope)
  • ✅ Proxy support
  • ✅ Nested JSON structure support
  • ✅ Translation status tracking

📦 Installation

npm install -g crossfire-i18n

Or use locally in your project:

npm install --save-dev crossfire-i18n

🔧 Configuration

1. User Configuration (~/.i18n-update.json)

Create a global configuration file with your API credentials:

For OpenAI:

{
    "openaiApiKey": "sk-xxx",
    "openaiUrl": "https://api.openai.com/v1",
    "openaiModel": "gpt-3.5-turbo-1106"
}

For Alibaba Cloud DashScope (Qwen):

{
    "openaiApiKey": "sk-xxx",
    "openaiUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
    "openaiModel": "qwen-turbo"
}

Available Qwen Models:

  • qwen-turbo - Fast and cost-effective
  • qwen-plus - Better performance
  • qwen-max - Best quality

2. Project Configuration (i18n-update.config.js)

Create a configuration file in your project root:

Standard Mode (Single Source Language)

export default {
    sourcePath: 'src/i18n',      // Path to i18n files
    sourceLocale: 'en',           // Source language
    locales: ['zh', 'ja', 'es']   // Target languages
}

🔥 CrossFire Mode (Multiple Source Languages)

export default {
    sourcePath: 'src/i18n',
    sourceLocale: ['en', 'zh'],   // Multiple source languages!
    locales: ['ja', 'es', 'fr']
}

🎮 Usage

Navigate to your project directory and run:

crossfire-i18n

Standard Mode Output:

Translating... zh
████████████████████████████████████████ 100% | 20/20
Translating... ja
████████████████████████████████████████ 100% | 20/20

CrossFire Mode Output:

Translating... ja (CrossFire mode)
████████████████████████████████████████ 100% | 20/20
Translating... es (CrossFire mode)
████████████████████████████████████████ 100% | 20/20

📂 Project Structure

your-project/
├── i18n-update.config.js       # Project configuration
├── i18n-update.status.json     # Translation status (auto-generated)
└── src/i18n/
    ├── en.json                 # Source language
    ├── zh.json                 # Generated translation
    ├── ja.json                 # Generated translation
    └── ...

💡 CrossFire Translation Examples

Example 1: Technical Terms

When translating to Japanese:

  • English: "Session timeout"
  • Chinese: "会话超时"
  • Result: AI understands it's about user sessions, not general timeout

Example 2: Cultural Nuances

When translating to Spanish:

  • English: "Welcome back!"
  • Chinese: "欢迎回来!"
  • Result: Captures both formal greeting and friendly exclamation

Example 3: Ambiguous Words

When translating "Profile":

  • English: "Profile" (could mean user profile, company profile, etc.)
  • Chinese: "用户资料" (clearly indicates user profile)
  • Result: Eliminates ambiguity for accurate translation

🎯 When to Use CrossFire Translation

Use CrossFire Translation when:

  • ✅ You need maximum translation accuracy
  • ✅ Your content has technical terminology
  • ✅ Context and cultural nuances are important
  • ✅ You already have high-quality translations in multiple languages
  • ✅ You're translating between languages with different linguistic structures

📝 Supported i18n Formats

CrossFire i18n works with any JSON-based i18n format. Your JSON files should follow this structure:

{
    "app": {
        "title": "Welcome to Our Application",
        "subtitle": "The best way to manage your tasks"
    },
    "user": {
        "login": "Login",
        "logout": "Logout",
        "profile": "User Profile"
    },
    "action": {
        "save": "Save",
        "cancel": "Cancel",
        "delete": "Delete"
    }
}

The tool will:

  1. Flatten the nested structure (e.g., app.title, user.login)
  2. Translate each value
  3. Reconstruct the nested structure in target language files

Compatible with:

  • Vue i18n
  • React i18next
  • Angular i18n
  • Any framework using JSON-based i18n files

🔄 Incremental Translation

CrossFire i18n intelligently tracks translation status:

  • First run: Translates all content
  • Subsequent runs: Only translates new or changed content
  • Status tracking: Stores in i18n-update.status.json

Example status tracking:

{
    "app.title": {
        "value": "Welcome to Our Application",
        "locales": {
            "zh": true,
            "ja": true,
            "es": true
        }
    }
}

🌐 Proxy Support

Set the https_proxy environment variable for proxy support:

export https_proxy=http://your-proxy:port
crossfire-i18n

🧪 Examples

Check out the example projects:

📋 Configuration Options

Project Config (i18n-update.config.js)

| Option | Type | Default | Description | |--------|------|---------|-------------| | sourcePath | string | 'src/i18n' | Path to i18n files | | sourceLocale | string | string[] | 'en' | Source language(s) | | locales | string[] | [] | Target languages |

User Config (~/.i18n-update.json)

| Option | Type | Required | Description | |--------|------|----------|-------------| | openaiApiKey | string | Yes | API key for OpenAI or compatible service | | openaiUrl | string | No | Custom API endpoint | | openaiModel | string | No | Model name (default: gpt-3.5-turbo-1106) |

🚀 Advanced Usage

Custom API Endpoint

If you're using a self-hosted or alternative OpenAI-compatible API:

{
    "openaiApiKey": "your-key",
    "openaiUrl": "https://your-api.example.com/v1",
    "openaiModel": "your-model-name"
}

Environment Variables

# Use proxy
export https_proxy=http://proxy:8080

# Run translation
crossfire-i18n

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

MIT

🎉 Why CrossFire i18n?

Traditional translation tools use a single source language, which can lead to:

  • ❌ Ambiguous translations
  • ❌ Lost cultural context
  • ❌ Incorrect technical terminology

CrossFire i18n solves these problems by:

  • ✅ Cross-referencing multiple source languages
  • ✅ Leveraging AI's multilingual understanding
  • ✅ Providing context-aware, accurate translations
  • ✅ Maintaining consistency across all languages

Made with ❤️ for the global development community