forked from webanizer/DoiWallet
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Description
We're experiencing issues with localizations in DoiWallet where translations are either lost or missing after changes, particularly in files like /loc/de_de.json. We need an automated solution to manage and maintain our localizations.
Proposed Solution
Implement a GitHub Action that monitors and manages localizations automatically.
Workflow Overview
- Monitor changes in base localization files (en.json and de_de.json)
- Compare all other localization files against these base files
- Automatically identify missing or obsolete translations
- Use AI translation API to generate missing translations
- Create PR with suggested updates
Technical Implementation Draft
name: Localization Sync
on:
push:
paths:
'loc/en.json'
'loc/de_de.json'
branches:
main
develop
jobs:
sync-localizations:
runs-on: ubuntu-latest
steps:
uses: actions/checkout@v3
name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
name: Install dependencies
run: npm install
name: Run localization sync
env:
AI_TRANSLATION_API_KEY: ${{ secrets.AI_TRANSLATION_API_KEY }}
run: node scripts/sync-localizations.js
```javascript
members
This issue template provides a comprehensive overview of the problem and a proposed solution with technical implementation details. It can be customized further based on specific project needs and requirements.Required Components
-
Base Script (
scripts/sync-localizations.js)async function syncLocalizations() { // 1. Load base files (en.json and de_de.json) const englishBase = require('../loc/en.json'); const germanBase = require('../loc/de_de.json'); // 2. Get all localization files const locFiles = fs.readdirSync('../loc'); // 3. For each localization file: // - Compare against base files // - Identify missing keys // - Request AI translations for missing entries // - Update files // 4. Create PR with changes if needed }
-
Translation Service Integration
- Integration with OpenAI API or similar for automated translations
- Quality assurance checks for generated translations
- Fallback mechanisms for failed translations
-
Reporting System
- Generate reports of missing translations
- List of automated translations added
- Statistics on translation coverage
Success Criteria
- No manual intervention required for basic translation updates
- All localization files maintain consistent structure
- Missing translations are automatically added
- Obsolete translations are identified and removed
- Translation quality meets minimum standards
- Clear reporting of changes made
Notes
- Need to decide on preferred AI translation service
- Consider rate limits and costs of translation API
- May need human review process for critical translations
- Consider implementing translation memory to reduce API calls
Labels
- automation
- localization
- github-actions
- enhancement
/cc @relevant-team-members
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels