Get Started

Version Control Integration

Track translation changes in version control, automate commits, and review translation updates with your team.

Git Workflow

Basic Workflow

langctl export my-app --all-languages -o ./locales

git diff locales/

git add locales/*.json
git commit -m "Update translations"

git push
.gitignore
.langctlrc

.env
💡
Tip

Commit translation files to git for version tracking, rollback capability, and team visibility. Store API keys in CI/CD secrets, not in .langctlrc.

#!/bin/bash
langctl export my-app --all-languages -o ./locales

git add locales/*.json

echo "✓ Translations exported and staged"
name: Update Translations

on:
schedule:
  - cron: '0 2 * * *'  # Daily at 2 AM

jobs:
update:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v3

    - name: Export Translations
      env:
        LANGCTL_API_KEY: ${{ secrets.LANGCTL_API_KEY }}
      run: |
        npm install -g @langctl/cli
        langctl export my-app --all-languages -o ./locales

    - name: Commit Changes
      run: |
        git config user.name "LangCTL Bot"
        git config user.email "[email protected]"
        git add locales/*.json
        git diff --quiet && git diff --staged --quiet || git commit -m "Update translations [skip ci]"
        git push

Pull Request Reviews

Translation PR Template

.github/PULL_REQUEST_TEMPLATE/translation_update.md
## Translation Update

### Changes
- Updated Spanish translations (24 keys)
- Added French translations (12 keys)
- Fixed typos in English (3 keys)

### Checklist
- [ ] All keys have translations
- [ ] Parameters are preserved
- [ ] Tested in staging environment
- [ ] Reviewed by native speaker (if available)

### Export Command
\`\`\`bash
langctl export my-app --all-languages -o ./locales
\`\`\`

Best Practices

  1. Commit translations regularly
  2. Use descriptive commit messages
  3. Review diffs before committing
  4. Tag releases with translation snapshots
  5. Create branches for major translation updates
â„šī¸
Note

Version controlling translations enables rollbacks, team review, and change tracking - essential for production applications.

Next Steps