You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add Vertex AI Chinese translation support (#42)
* feat: add Chinese translation via Vertex AI
Implement complete Chinese localization for KickWatch:
**Database Schema:**
- Add `name_zh`, `blurb_zh`, `creator_name_zh` to Campaign model
- Add `name_zh` to Category model
**Vertex AI Translation Service:**
- New TranslatorService using Vertex AI Gemini 2.0 Flash
- Batch translation (10 campaigns per API call) to optimize costs
- Uses GCP startup credits from rescience-lab-465304 project
- Automatic translation during nightly crawl and backfill
**Category Localization:**
- All 14 root categories with Chinese names
- 12 subcategories with Chinese names
**Configuration:**
- Add VERTEX_AI_PROJECT_ID and VERTEX_AI_LOCATION env vars
- Service account credentials via GOOGLE_SERVICE_ACCOUNT_JSON
- AWS Secrets Manager integration ready
**Infrastructure:**
- GCP Project: rescience-lab-465304
- Service Account: kickwatch-translator@rescience-lab-465304.iam.gserviceaccount.com
- AWS Secrets: kickwatch-dev/google-service-account, kickwatch-dev/vertex-ai-config
**Technical Details:**
- Translator gracefully degrades if not configured (no blocking)
- Continues crawl even if translation fails
- Temperature=0.3 for consistent translations
- 500ms delay between batches to avoid rate limits
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* feat(ios): add Chinese content display support
Update iOS app to display translated Chinese content:
**CampaignDTO & CategoryDTO:**
- Add `name_zh`, `blurb_zh`, `creator_name_zh` fields
- Add computed properties `displayName`, `displayBlurb`, `displayCreatorName`
- Automatically fallback to English if Chinese translation unavailable
**Views Updated:**
- CampaignRowView: Use displayName/displayCreatorName
- CampaignDetailView: Use displayName/displayBlurb/displayCreatorName
- DiscoverView: Use displayName for categories
- WatchlistView: Updated DTO initialization
**User Experience:**
- Chinese content shows first when available
- Seamless fallback to English
- No code changes needed when backend adds translations
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* ci: add Vertex AI environment variables to ECS deployment
Add Vertex AI configuration to GitHub Actions workflow:
- VERTEX_AI_PROJECT_ID=rescience-lab-465304
- VERTEX_AI_LOCATION=us-central1
- GOOGLE_SERVICE_ACCOUNT_JSON from AWS Secrets Manager
This enables automatic Chinese translation during nightly crawls.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* fix: resolve Codex review findings for Chinese translation
Fixes 3 issues identified in PR #42 code review:
1. MockAPIClient.swift: Add missing Chinese fields (name_zh, blurb_zh,
creator_name_zh) to CampaignDTO test factory
2. APIClient.swift: Handle empty string fallback in computed properties.
Backend emits empty strings for untranslated fields, so nil-coalescing
alone is insufficient. Check for both nil AND empty string.
3. cron.go: Include name_zh in syncCategories() upsert columns so existing
category rows get Chinese names on deployment
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
0 commit comments