⚡
i18nexus-tools
코드 변환부터 Google Sheets 통합까지 i18n 워크플로우를 자동화하는 강력한 CLI 도구
📦설치
전역 설치 (권장):
npm install -g i18nexus-tools또는 설치 없이 사용:
npx i18nexus-tools@latest🚀빠른 워크플로우
1
한국어 텍스트 자동 래핑
코드에 하드코딩된 한국어 문자열을 t()로 자동 감싸기
npx i18n-wrapper --pattern "app/**/*.tsx"2
번역 키 추출 및 병합
래핑된 텍스트에서 번역 파일을 생성하고 기존 번역과 병합
npx i18n-extractor -p "app/**/*.tsx" -d "./locales"3
영어 번역 추가
en.json 파일을 열어 영어 번역을 추가하세요
// locales/en.json
{
"환영합니다": "Welcome",
"시작하기": "Get Started"
}4
Google Sheets와 동기화 (선택사항)
팀 협업을 위해 번역을 Google Sheets로 업로드
npx i18n-upload --spreadsheet-id "YOUR_ID"사용 가능한 도구
🎁
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
문서 보기 →
설정 파일
모든 CLI 도구는 프로젝트 루트의 i18nexus.config.json 에서 설정을 읽습니다:
{
"languages": ["en", "ko"],
"defaultLanguage": "ko",
"localesDir": "./locales",
"sourcePattern": "app/**/*.{ts,tsx}",
"googleSheets": {
"spreadsheetId": "your-spreadsheet-id",
"credentialsPath": "./credentials.json",
"sheetName": "Translations"
}
}💡 팁: npx i18n-sheets init 를 실행하여 이 파일을 자동으로 생성하세요
주요 기능
🤖자동화
- ✓하드코딩된 문자열 자동 감지 및 래핑
- ✓자동 import 주입
- ✓공백을 유지한 스마트 키 생성
🔄동기화 및 협업
- ✓Google Sheets 통합
- ✓증분 업데이트 (안전)
- ✓전체 덮어쓰기를 위한 강제 동기화
🎯개발자 경험
- ✓설정 기반, 설정 불필요
- ✓TypeScript 지원
- ✓상세한 로깅 및 오류 메시지
📁파일 관리
- ✓간단한 파일 구조: locales/en.json, locales/ko.json
- ✓기존 번역 보존
- ✓새 키의 스마트 병합