Home/i18nexus-tools Documentation
โšก

i18nexus-tools

Powerful CLI tools to automate your i18n workflow - from code transformation to Google Sheets integration

๐Ÿ“ฆInstallation

Install globally (recommended):

npm install -g i18nexus-tools

Or use without installing:

npx i18nexus-tools@latest

๐Ÿš€Quick Workflow

1

Auto-wrap Korean text

Automatically wrap hardcoded Korean strings in code with t()

npx i18n-wrapper --pattern "app/**/*.tsx"
2

Translation Key Extraction and Merging

Generate translation files from wrapped text and merge with existing translations

npx i18n-extractor -p "app/**/*.tsx" -d "./locales"
3

Add English Translation

Open the en.json file and add English translations

// locales/en.json
{
  "ํ™˜์˜ํ•ฉ๋‹ˆ๋‹ค": "Welcome",
  "์‹œ์ž‘ํ•˜๊ธฐ": "Get Started"
}
4

Sync with Google Sheets (Optional)

Upload translations to Google Sheets for team collaboration

npx i18n-upload --spreadsheet-id "YOUR_ID"

Available Tools

Configuration File

All CLI tools read from i18nexus.config.json in your project root:

{
  "languages": ["en", "ko"],
  "defaultLanguage": "ko",
  "localesDir": "./locales",
  "sourcePattern": "app/**/*.{ts,tsx}",
  "googleSheets": {
    "spreadsheetId": "your-spreadsheet-id",
    "credentialsPath": "./credentials.json",
    "sheetName": "Translations"
  }
}

๐Ÿ’ก Tip: npx i18n-sheets init to automatically create this file

Key Features

๐Ÿค–Automation

  • โœ“Auto-detect and wrap hardcoded strings
  • โœ“Automatic import injection
  • โœ“Smart key generation with spacing preserved

๐Ÿ”„Sync & Collaboration

  • โœ“Google Sheets integration
  • โœ“Incremental updates (safe)
  • โœ“Force sync for full overwrites

๐ŸŽฏDeveloper Experience

  • โœ“Config-based, zero setup needed
  • โœ“TypeScript support
  • โœ“Detailed logging and error messages

๐Ÿ“File Management

  • โœ“Simple file structure: locales/en.json, locales/ko.json
  • โœ“Preserve existing translations
  • โœ“Smart merging of new keys