diff --git a/.github/MAINTENANCE.md b/.github/MAINTENANCE.md index 5e953c659..728d41251 100644 --- a/.github/MAINTENANCE.md +++ b/.github/MAINTENANCE.md @@ -256,6 +256,39 @@ These workflows can be triggered manually or on a schedule to: - Run tests - Create pull requests with updates +### Crowdin Translation Sync + +InvoicePlane v2 includes a GitHub Actions workflow for automated translation management: + +- **Crowdin Sync Workflow** - `.github/workflows/crowdin-sync.yml` + +This workflow can be triggered manually with three action types: + +1. **upload-sources** - Upload source translation files to Crowdin +2. **download-translations** - Download translated files from Crowdin (default) +3. **sync-bidirectional** - Upload sources and download translations + +The workflow runs automatically on a weekly schedule (Sundays at 2:00 AM UTC) to download new translations and create pull requests. + +**Required Secrets:** + +To configure GitHub secrets for the Crowdin workflow: + +1. Go to your repository on GitHub +2. Navigate to **Settings** → **Secrets and variables** → **Actions** +3. Click **New repository secret** +4. Add the following secrets: + - `CROWDIN_PROJECT_ID` - Your Crowdin project ID + - `CROWDIN_PERSONAL_TOKEN` - Your Crowdin personal access token + +Direct URL format: `https://github.com/OWNER/REPO/settings/secrets/actions` + +**Manual Trigger:** +```bash +# Go to Actions tab → Crowdin Translation Sync → Run workflow +# Select desired action type +``` + See: `.github/workflows/` directory for workflow details. --- diff --git a/.github/THEMES.md b/.github/THEMES.md index eceff8a57..fd99a373e 100644 --- a/.github/THEMES.md +++ b/.github/THEMES.md @@ -42,7 +42,7 @@ Based on the popular Nord color palette, this theme features cool, arctic-inspir - Warning: #ebcb8b (yellow) - Success: #a3be8c (green) -**Best For:** Developers who love the Nord color scheme, or anyone preferring a cool, calming interface +**Best For:** Developers who prefer the Nord color scheme, or anyone preferring a cool, calming interface ### 4. Orange **File:** `orange.css` diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 28f3bd84b..3ea0dd808 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -152,6 +152,32 @@ Tests Docker Compose configuration. Provides a quick setup for development environments. +### 9. Crowdin Translation Sync (`crowdin-sync.yml`) + +**Trigger:** +- Scheduled: Weekly on Sundays at 2:00 AM UTC +- Manual dispatch with action type selection + +**Purpose:** Automates translation synchronization with Crowdin + +**What it does:** +1. **Uploads source files** - Pushes English translation files to Crowdin +2. **Downloads translations** - Retrieves translated files from Crowdin +3. **Creates pull request** - Automated PR with translation updates + +**Action Types:** +- `upload-sources` - Upload source translation files only +- `download-translations` - Download translated files only (default) +- `sync-bidirectional` - Both upload and download + +**Required Secrets:** +- `CROWDIN_PROJECT_ID` - Your Crowdin project ID +- `CROWDIN_PERSONAL_TOKEN` - Your Crowdin personal access token + +**Required Permissions:** +- `contents: write` - For creating branches and commits +- `pull-requests: write` - For creating pull requests + ## Dependency Management ### GitHub Dependabot diff --git a/.github/workflows/crowdin-sync.yml b/.github/workflows/crowdin-sync.yml new file mode 100644 index 000000000..5d56b44fd --- /dev/null +++ b/.github/workflows/crowdin-sync.yml @@ -0,0 +1,95 @@ +name: Crowdin Translation Sync + +on: + workflow_dispatch: + inputs: + action: + description: 'Action to perform' + required: true + type: choice + options: + - upload-sources + - download-translations + - sync-bidirectional + default: 'download-translations' + schedule: + # Run weekly on Sundays at 2:00 AM UTC + - cron: '0 2 * * 0' + +permissions: + contents: write + pull-requests: write + +jobs: + crowdin-sync: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Upload sources to Crowdin + if: github.event.inputs.action == 'upload-sources' || github.event.inputs.action == 'sync-bidirectional' + uses: crowdin/github-action@v2 + with: + upload_sources: true + upload_translations: false + download_translations: false + localization_branch_name: master + config: 'crowdin.yml' + env: + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + + - name: Download translations from Crowdin + if: github.event.inputs.action == 'download-translations' || github.event.inputs.action == 'sync-bidirectional' || github.event_name == 'schedule' + uses: crowdin/github-action@v2 + with: + upload_sources: false + upload_translations: false + download_translations: true + localization_branch_name: master + create_pull_request: true + pull_request_title: 'chore(i18n): update translations from Crowdin' + pull_request_body: | + ## Translation Update + + This PR updates translations downloaded from Crowdin. + + **Triggered by:** ${{ github.event_name }} + **Action:** ${{ github.event.inputs.action || 'download-translations' }} + + ### Review Checklist + + - [ ] Review translation changes for accuracy + - [ ] Check for any formatting issues + - [ ] Verify no code is affected + - [ ] Test translations in UI if possible + + --- + + *This PR was automatically created by the Crowdin Sync workflow.* + pull_request_labels: | + i18n + translations + crowdin + automated-pr + config: 'crowdin.yml' + env: + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Workflow summary + run: | + echo "## Crowdin Sync Complete" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Action:** ${{ github.event.inputs.action || 'download-translations' }}" >> $GITHUB_STEP_SUMMARY + echo "**Triggered by:** ${{ github.event_name }}" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "### Next Steps" >> $GITHUB_STEP_SUMMARY + echo "- Review the created pull request (if any)" >> $GITHUB_STEP_SUMMARY + echo "- Verify translation changes" >> $GITHUB_STEP_SUMMARY + echo "- Merge when ready" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 40a8fc07a..4985c1882 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -444,22 +444,22 @@ jobs: echo "=========================================" | tee -a "$LOG_FILE" # Add to GitHub Actions summary - echo "## 🎉 Release Build Complete" >> $GITHUB_STEP_SUMMARY + echo "## Release Build Complete" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "**Version:** \`${{ env.NEW_TAG }}\`" >> $GITHUB_STEP_SUMMARY echo "**Type:** ${{ env.RELEASE_TYPE }}" >> $GITHUB_STEP_SUMMARY echo "**Package:** \`${{ env.RELEASE_FILE }}\`" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "### 📦 Download" >> $GITHUB_STEP_SUMMARY + echo "### Download" >> $GITHUB_STEP_SUMMARY echo "- Artifact: \`ip-${{ env.NEW_VERSION }}\`" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "### 🔐 Checksums" >> $GITHUB_STEP_SUMMARY + echo "### Checksums" >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY echo "SHA256: ${{ env.SHA256_HASH }}" >> $GITHUB_STEP_SUMMARY echo "MD5: ${{ env.MD5_HASH }}" >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "### 📝 Next Steps" >> $GITHUB_STEP_SUMMARY + echo "### Next Steps" >> $GITHUB_STEP_SUMMARY echo "1. Review the draft release in GitHub" >> $GITHUB_STEP_SUMMARY echo "2. Test the package if needed" >> $GITHUB_STEP_SUMMARY echo "3. Publish the release when ready" >> $GITHUB_STEP_SUMMARY diff --git a/.junie/guidelines.md b/.junie/guidelines.md index 3fc02b98b..c73466b35 100644 --- a/.junie/guidelines.md +++ b/.junie/guidelines.md @@ -532,7 +532,7 @@ This document should be updated as: - Best practices evolve - Performance optimizations discovered -**Last Updated:** 2025-11-13 +**Last Updated:** 2025-12-29 --- diff --git a/README.md b/README.md index ad31ba225..0798dfee9 100644 --- a/README.md +++ b/README.md @@ -195,4 +195,4 @@ Special thanks to all our [contributors](https://github.com/InvoicePlane/Invoice --- -**Made with by the InvoicePlane community** +**Developed by the InvoicePlane community**