diff --git a/.github/workflows/poeditor-sync.yml b/.github/workflows/poeditor-sync.yml deleted file mode 100644 index 6b6731b2d..000000000 --- a/.github/workflows/poeditor-sync.yml +++ /dev/null @@ -1,138 +0,0 @@ -name: POEditor Translation Synchronization (disabled) - -# This workflow is intentionally disabled — kept for reference only. -# The full definition is preserved commented-out below. To re-enable, -# delete the stub job and uncomment the section starting at `on:`. - -on: - workflow_dispatch: - -jobs: - disabled: - if: false - runs-on: ubuntu-latest - steps: - - run: echo "This workflow is disabled. See comments below for the original definition." - -# --------------------------------------------------------------------------- -# Original (disabled) workflow below. Do not uncomment if you don't know what you're doing. -# --------------------------------------------------------------------------- - -# on: -# # For manual triggering -# workflow_dispatch: -# inputs: -# languages: -# description: "Languages to synchronize (comma separated, e.g.: tr,en,es)" -# required: false -# default: "ar,zh-tw,cs,en,fi,fr,de,pt-br,ru,es,tr,ja,zh-cn,th" -# format: -# description: "Export format (key_value_json or json)" -# required: false -# default: "key_value_json" - -# permissions: -# contents: write -# pull-requests: write - -# jobs: -# sync-translations: -# runs-on: ubuntu-latest -# permissions: -# contents: write -# issues: write -# pull-requests: write - -# steps: -# - name: Checkout code -# uses: actions/checkout@v3 -# with: -# token: ${{ secrets.GITHUB_TOKEN }} -# fetch-depth: 0 - -# - name: Setup Node.js -# uses: actions/setup-node@v3 -# with: -# node-version: "22" - -# - name: Create package.json for scripts -# run: | -# mkdir -p .github/scripts -# cat > .github/scripts/package.json << EOF -# { -# "name": "poeditor-scripts", -# "version": "1.0.0", -# "private": true, -# "type": "module", -# "dependencies": { -# "axios": "^1.6.0", -# "fs-extra": "^11.1.1" -# } -# } -# EOF - -# - name: Install dependencies -# run: | -# cd .github/scripts -# npm install - -# - name: Download translations from POEditor -# env: -# POEDITOR_API: ${{ secrets.POEDITOR_API }} -# POEDITOR_PROJECT_ID: ${{ secrets.POEDITOR_PROJECT_ID }} -# LANGUAGES: ${{ github.event.inputs.languages || 'tr,en' }} -# EXPORT_FORMAT: ${{ github.event.inputs.format || 'key_value_json' }} -# run: | -# mkdir -p temp -# node .github/scripts/download-translations.js - -# - name: Verify translation files -# run: | -# echo "Verifying translation files..." -# for file in temp/*.json; do -# echo "Checking $file" -# if [ ! -s "$file" ]; then -# echo "Error: $file is empty or does not exist" -# exit 1 -# fi -# # Validate JSON format -# cat "$file" | jq . > /dev/null || { echo "Error: $file is not valid JSON"; exit 1; } -# done -# echo "All translation files are valid" - -# - name: Copy translations to project -# run: | -# mkdir -p client/src/locales -# cp -r temp/* client/src/locales/ -# echo "Translation files copied to client/src/locales/" - -# - name: Get current date -# id: date -# run: echo "date=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT - -# - name: Format client code -# run: | -# cd client -# npm ci -# npm run format - -# - name: Create Pull Request -# uses: peter-evans/create-pull-request@v7 -# with: -# token: ${{ secrets.GITHUB_TOKEN }} -# commit-message: "feat: translations updated from POEditor" -# title: "🌐 Updated Translations from POEditor" -# body: | -# This PR contains the latest translations from POEditor. - -# 📅 Update Date: ${{ steps.date.outputs.date }} -# 🔄 Updated Languages: ${{ github.event.inputs.languages || 'tr,en' }} - -# ⚠️ Please review the translations and approve the PR if everything looks correct. -# branch: translation-update-${{ github.run_number }} -# delete-branch: true -# base: develop -# add-paths: | -# client/src/locales/*.json -# committer: GitHub Action -# author: GitHub Action diff --git a/.github/workflows/upload-poeditor.yml b/.github/workflows/upload-poeditor.yml deleted file mode 100644 index f695c8bbc..000000000 --- a/.github/workflows/upload-poeditor.yml +++ /dev/null @@ -1,113 +0,0 @@ -name: Upload Translations to POEditor on PR Merge - -on: - pull_request: - types: [closed] - branches: - - develop - paths: - - "client/src/locales/**" - -jobs: - upload-translations: - # Only run if the PR was merged (not just closed) or manually triggered - if: github.event.pull_request.merged == true - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Fetch all history to get changed files - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: "22" - - - name: Create package.json for scripts - run: | - mkdir -p .github/scripts - cat > .github/scripts/package.json << EOF - { - "name": "poeditor-scripts", - "version": "1.0.0", - "private": true, - "type": "module", - "dependencies": { - "axios": "^1.6.0", - "fs-extra": "^11.1.1", - "form-data": "^4.0.0" - } - } - EOF - - - name: Install dependencies - run: | - cd .github/scripts - npm install - - - name: Get changed locale files - id: changed-files - if: github.event_name == 'pull_request' - run: | - # Get base and head commits - BASE_SHA=${{ github.event.pull_request.base.sha }} - HEAD_SHA=${{ github.event.pull_request.head.sha }} - - echo "Base SHA: $BASE_SHA" - echo "Head SHA: $HEAD_SHA" - - # Get list of changed files in client/src/locales directory - CHANGED_FILES=$(git diff --name-only $BASE_SHA..$HEAD_SHA -- 'client/src/locales/*.json' || git ls-files 'client/src/locales/*.json') - - if [ -z "$CHANGED_FILES" ]; then - echo "No changes detected in locale files" - echo "CHANGED_FILES=" >> $GITHUB_ENV - else - echo "Changed files:" - echo "$CHANGED_FILES" - echo "CHANGED_FILES<> $GITHUB_ENV - echo "$CHANGED_FILES" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - fi - - - name: Upload changed translations to POEditor - if: env.CHANGED_FILES != '' - env: - POEDITOR_API: ${{ secrets.POEDITOR_API }} - POEDITOR_PROJECT_ID: ${{ secrets.POEDITOR_PROJECT_ID }} - run: | - # Process each changed file - for FILE in $CHANGED_FILES; do - if [[ -f "$FILE" ]]; then - # Extract language code from filename (e.g., client/src/locales/en.json -> en) - FILENAME=$(basename "$FILE") - - # Special case: map gb.json to en language code - if [ "$FILENAME" == "gb.json" ]; then - LANG="en" - echo "Found gb.json, mapping to language code 'en'" - else - LANG=$(basename "$FILE" .json) - fi - - echo "Processing $FILE for language $LANG" - - # Upload to POEditor - LANGUAGE=$LANG FILE_PATH=$FILE node .github/scripts/upload-translations.js - fi - done - - - name: Notify on success - if: success() && env.CHANGED_FILES != '' - run: | - echo "Successfully uploaded translation files to POEditor." - if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then - echo "Manual trigger comment: ${{ github.event.inputs.comment }}" - fi - - - name: Notify on no changes - if: env.CHANGED_FILES == '' - run: | - echo "No translation files were found to upload."