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
- Commit translations regularly
- Use descriptive commit messages
- Review diffs before committing
- Tag releases with translation snapshots
- Create branches for major translation updates
âšī¸
Note
Version controlling translations enables rollbacks, team review, and change tracking - essential for production applications.
Next Steps
- CI/CD Integration - Automate exports
- Export Guide - Export documentation
- CLI Export - Export commands