/i18nexus-tools/i18n-upload
📤

i18n-upload

로컬 번역 파일을 Google Sheets로 업로드합니다

개요

i18n-upload는 로컬의 번역 JSON 파일들을 Google Sheets로 업로드하는 CLI 도구입니다. 팀원들과 번역 작업을 협업하기 위한 첫 단계입니다.

모든 언어 파일을 한 번에 업로드
자동으로 Sheets 포맷 생성
기존 Sheets 데이터 완전 대체

기본 사용법

설정 파일 사용

i18nexus.config.json에 Google Sheets 정보가 설정되어 있다면:

npx i18n-upload

명령줄 옵션 사용

npx i18n-upload \
  --spreadsheet-id "YOUR_SPREADSHEET_ID" \
  --credentials "./credentials.json"

명령어 옵션

--spreadsheet-id문자열

Google Sheets의 Spreadsheet ID (필수)

Sheets URL에서 확인: https://docs.google.com/spreadsheets/d/[SPREADSHEET_ID]/edit

--credentials문자열

Google Cloud 서비스 계정 인증 정보 JSON 파일 경로 (필수)

--credentials "./credentials.json"
--sheet-name문자열

업로드할 시트 이름 (기본값: "Translations")

--sheet-name "MyTranslations"
--locales-dir문자열

번역 파일 디렉토리 (기본값: "./locales")

--locales-dir "./src/translations"

업로드 프로세스

1

로컬 파일 읽기

locales 디렉토리의 모든 JSON 파일을 읽어옵니다.

2

데이터 변환

JSON 데이터를 Google Sheets 형식으로 변환합니다. 첫 행은 언어 코드, 첫 열은 번역 키가 됩니다.

3

Sheets 업데이트

Google Sheets의 기존 데이터를 지우고 새 데이터로 완전히 대체합니다.

4

완료

업로드 완료 메시지와 함께 통계를 표시합니다.

주의사항

⚠️데이터 덮어쓰기

  • i18n-upload는 Google Sheets의 기존 데이터를 완전히 삭제하고 새 데이터로 대체합니다
  • Sheets에서 직접 수정한 번역이 있다면 먼저 백업하세요
  • 일반적으로 프로젝트 초기 설정 시 한 번만 사용합니다
  • 이후에는 i18n-download를 사용하여 Sheets에서 번역을 가져옵니다

예제 출력

$ npx i18n-upload --spreadsheet-id "1abc...xyz"

📤 Uploading translations to Google Sheets...

📁 Reading local files...
   ✓ locales/ko.json (125 keys)
   ✓ locales/en.json (125 keys)

🔄 Converting to Sheets format...
   Languages: ko, en
   Total keys: 125

📊 Updating Google Sheets...
   Spreadsheet: "i18n Translations"
   Sheet: "Translations"
   ✓ Cleared existing data
   ✓ Uploaded 126 rows (including header)

✅ Upload complete!
   🔗 View: https://docs.google.com/spreadsheets/d/1abc...xyz

모범 사례

초기 설정에만 사용

프로젝트 시작 시 한 번만 업로드하고, 이후에는 Sheets에서 번역 작업을 진행하세요.

업로드 전 확인

로컬 번역 파일이 최신 상태인지 확인 후 업로드하세요.

팀원과 공유

업로드 후 Sheets URL을 팀원들과 공유하여 함께 번역 작업을 시작하세요.

다음 단계

Firebase 연결 확인 중...
i18n-upload - i18nexus Tools Documentation