Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/localization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Lingo.Dev AI Localization

on:
push:
branches: [ main, master ]
paths:
- 'packages/ui/src/i18n/locales/**'
- 'packages/extension/public/_locales/**'
- '**.md'
- 'docs/**'
pull_request:
branches: [ main, master ]
paths:
- 'packages/ui/src/i18n/locales/**'
- 'packages/extension/public/_locales/**'
- '**.md'
- 'docs/**'
workflow_dispatch: # Allow manual triggering

jobs:
lingo-localization:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full history for better localization context

- name: Lingo.Dev AI Localization
uses: lingodotdev/lingo.dev@0.99.4
with:
# Required: Lingo.dev API key (set in repository secrets)
api-key: ${{ secrets.LINGODOTDEV_API_KEY }}

# Optional: Version of Lingo.dev CLI to use
version: "latest"

# Optional: Create pull request for translation updates
pull-request: true

# Optional: Custom commit message
commit-message: "🌐 Update translations via Lingo.Dev AI"

# Optional: Custom pull request title
pull-request-title: "🌐 Automated AI Translation Updates"

# Optional: Working directory (useful for monorepos)
working-directory: "."

# Optional: Process own commits (avoid infinite loops)
process-own-commits: false

# Optional: Enable parallel processing for faster execution
parallel: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50 changes: 50 additions & 0 deletions LOCALIZATION_SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Lingo.Dev AI Localization Setup Summary

## ✅ Files Created/Modified

### 1. GitHub Workflow
- **Created**: `.github/workflows/localization.yml`
- **Purpose**: Automated AI-powered localization workflow
- **Triggers**: Push/PR to main/master, manual dispatch

### 2. Configuration File
- **Created**: `lingo.config.json`
- **Purpose**: Lingo.Dev configuration for translation behavior
- **Features**: Source language (zh-CN), target languages, file patterns

### 3. Documentation
- **Created**: `docs/localization.md`
- **Purpose**: Comprehensive guide for the localization setup
- **Contents**: Configuration, workflow, best practices

## 🚀 What's Now Enabled

1. **Automatic Translation**: AI translates your English content to Chinese and other languages
2. **Smart Context**: Understanding of your Vue.js i18n structure and Chrome extension locales
3. **Pull Request Workflow**: Creates PRs for review before merging translations
4. **Multiple Formats**: Handles TypeScript, JSON, and Markdown files
5. **Manual Control**: Can trigger localization manually via GitHub Actions

## 🎯 Target Languages Configured

- �� Chinese (zh-CN) - Auto-generated
- 🇯🇵 Japanese (ja-JP)
- 🇰🇷 Korean (ko-KR)
- 🇪🇸 Spanish (es-ES)
- 🇫🇷 French (fr-FR)
- 🇩🇪 German (de-DE)

## 📂 Files Being Localized

- `packages/ui/src/i18n/locales/**/*.ts` - Vue.js i18n files
- `packages/extension/public/_locales/**/*.json` - Chrome extension
- `README*.md` & `docs/**/*.md` - Documentation

## 🔄 Next Steps

1. **Commit & Push**: These files to trigger the first localization run
2. **Review PRs**: Check AI-generated translations for accuracy
3. **Merge**: Approved translations to enable multi-language support
4. **Test**: Verify translations work in your application

The setup is complete and ready to use! 🎉
Loading
Loading