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-toolsOr use without installing:
npx i18nexus-tools@latest๐Quick Workflow
Auto-wrap Korean text
Automatically wrap hardcoded Korean strings in code with t()
npx i18n-wrapper --pattern "app/**/*.tsx"Translation Key Extraction and Merging
Generate translation files from wrapped text and merge with existing translations
npx i18n-extractor -p "app/**/*.tsx" -d "./locales"Add English Translation
Open the en.json file and add English translations
// locales/en.json
{
"ํ์ํฉ๋๋ค": "Welcome",
"์์ํ๊ธฐ": "Get Started"
}Sync with Google Sheets (Optional)
Upload translations to Google Sheets for team collaboration
npx i18n-upload --spreadsheet-id "YOUR_ID"Available Tools
i18n-wrapper
Automatically wrap Korean/English text with t() function
i18n-extractor
Extract translation keys from your codebase
i18n-upload
Upload local translations to Google Sheets
i18n-download
Download translations from Google Sheets (incremental)
i18n-download-force
Force overwrite all translations from Google Sheets
Google Sheets Setup
Configure Google Sheets integration
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