Saltar al contenido principal

Installation

Requirements

  • Node.js 20.11+ (native ESM)
  • A translation API key (see below)

Install

npm install --save-dev i18n-rosetta

Get an API Key

Rosetta needs a translation backend. Pick one:

ProviderEnvironment VariableBest For
OpenRouter (recommended)OPENROUTER_API_KEYContent-heavy projects, Markdown, 200+ models
Google TranslateGOOGLE_TRANSLATE_API_KEYHigh-volume key-value pairs (130+ languages)

OpenRouter provides a unified API for 200+ LLM models. Free tier available.

# Sign up at https://openrouter.ai, then:
export OPENROUTER_API_KEY=sk-or-v1-...

Or add to .env.local:

OPENROUTER_API_KEY=sk-or-v1-your-key-here

Best for: content-heavy projects, Markdown translation, and projects needing content-aware shielding (code blocks, shortcodes, interpolation variables).

Verify Installation

npx i18n-rosetta --help

You should see the list of available commands. You're ready for the Quick Start.