Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

16 changes: 0 additions & 16 deletions .github/PULL_REQUEST_TEMPLATE/community_contributed_toolkit.md

This file was deleted.

298 changes: 298 additions & 0 deletions .github/workflows/translate-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,298 @@
name: 📖 Translate Documentation

on:
workflow_dispatch:
inputs:
target_locale:
description: "Target locale to translate"
required: false
default: "all"
type: choice
options:
- "all"
- "es"
- "pt-BR"

force_translate:
description: "Force translate all files (ignore cache)"
required: false
default: false
type: boolean

cleanup_deleted:
description: "Delete translated files when English originals are removed"
required: false
default: true
type: boolean

dry_run:
description: "Dry run (don't write files or update cache)"
required: false
default: false
type: boolean

single_file:
description: "Single file to translate (relative to app/en, e.g. 'home/page.mdx')"
required: false
default: ""
type: string

concurrency:
description: "Number of files to translate in parallel (1-10)"
required: false
default: 3
type: number

jobs:
translate:
runs-on: ubuntu-latest

steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: 📦 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"

- name: 📥 Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: 📚 Install dependencies
run: pnpm install --frozen-lockfile

- name: 🧹 Clean up deleted files
if: inputs.cleanup_deleted
run: |
echo "🔍 Checking for deleted English files..."
pnpm dlx tsx scripts/i18n-sync/index.ts --cleanup
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

- name: 🌍 Run translation
run: |
echo "🚀 Starting translation process..."

# Build the command with dynamic inputs
CMD="pnpm dlx tsx scripts/i18n-sync/index.ts"

# Add target locale if not 'all'
if [ "${{ inputs.target_locale }}" != "all" ]; then
CMD="$CMD --locale ${{ inputs.target_locale }}"
fi

# Add force flag if enabled
if [ "${{ inputs.force_translate }}" = "true" ]; then
CMD="$CMD --force"
fi

# Add dry-run flag if enabled
if [ "${{ inputs.dry_run }}" = "true" ]; then
CMD="$CMD --dry-run"
fi

# Add single file if specified
if [ -n "${{ inputs.single_file }}" ]; then
CMD="$CMD --file '${{ inputs.single_file }}'"
fi

# Add concurrency
CMD="$CMD --concurrency ${{ inputs.concurrency }}"

echo "💻 Executing: $CMD"
eval $CMD
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_MODEL: ${{ secrets.OPENAI_MODEL || 'gpt-4o-mini' }}

- name: 📊 Check translation status
id: check_changes
run: |
if git diff --quiet && git diff --cached --quiet; then
echo "No changes detected"
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "Changes detected"
echo "has_changes=true" >> $GITHUB_OUTPUT

# Count changed files
CHANGED_FILES=$(git diff --name-only | wc -l)
STAGED_FILES=$(git diff --cached --name-only | wc -l)
TOTAL_CHANGES=$((CHANGED_FILES + STAGED_FILES))

echo "changed_files=$TOTAL_CHANGES" >> $GITHUB_OUTPUT

# Get list of changed locales
CHANGED_LOCALES=$(git diff --name-only | grep -E '^app/(es|pt-BR)/' | cut -d'/' -f2 | sort -u | tr '\n' ',' | sed 's/,$//')
if [ -z "$CHANGED_LOCALES" ]; then
CHANGED_LOCALES=$(git diff --cached --name-only | grep -E '^app/(es|pt-BR)/' | cut -d'/' -f2 | sort -u | tr '\n' ',' | sed 's/,$//')
fi
echo "changed_locales=$CHANGED_LOCALES" >> $GITHUB_OUTPUT
fi

- name: 🏷️ Generate branch name
if: steps.check_changes.outputs.has_changes == 'true'
id: branch_name
run: |
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
if [ "${{ inputs.target_locale }}" != "all" ]; then
BRANCH_NAME="translations/${{ inputs.target_locale }}-$TIMESTAMP"
else
BRANCH_NAME="translations/all-locales-$TIMESTAMP"
fi
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT

- name: 🌿 Create and switch to new branch
if: steps.check_changes.outputs.has_changes == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b ${{ steps.branch_name.outputs.branch_name }}

- name: 📝 Commit changes
if: steps.check_changes.outputs.has_changes == 'true'
run: |
git add .

# Create detailed commit message
COMMIT_MSG="🌍 Update translations"

if [ "${{ inputs.target_locale }}" != "all" ]; then
COMMIT_MSG="$COMMIT_MSG for ${{ inputs.target_locale }}"
fi

COMMIT_MSG="$COMMIT_MSG (${{ steps.check_changes.outputs.changed_files }} files)"

if [ "${{ inputs.force_translate }}" = "true" ]; then
COMMIT_MSG="$COMMIT_MSG [forced]"
fi

if [ "${{ inputs.cleanup_deleted }}" = "true" ]; then
COMMIT_MSG="$COMMIT_MSG [with cleanup]"
fi

if [ "${{ inputs.dry_run }}" = "true" ]; then
COMMIT_MSG="$COMMIT_MSG [dry-run]"
fi

# Add configuration details to commit body
COMMIT_BODY="Translation Configuration:
- Target Locale: ${{ inputs.target_locale }}
- Force Translate: ${{ inputs.force_translate }}
- Cleanup Deleted: ${{ inputs.cleanup_deleted }}
- Dry Run: ${{ inputs.dry_run }}
- Single File: ${{ inputs.single_file || 'none' }}
- Concurrency: ${{ inputs.concurrency }}
- Changed Locales: ${{ steps.check_changes.outputs.changed_locales }}

Generated by GitHub Actions workflow"

git commit -m "$COMMIT_MSG" -m "$COMMIT_BODY"

- name: 📤 Push branch
if: steps.check_changes.outputs.has_changes == 'true'
run: |
git push origin ${{ steps.branch_name.outputs.branch_name }}

- name: 🔧 Create Pull Request
if: steps.check_changes.outputs.has_changes == 'true'
uses: actions/github-script@v7
with:
script: |
const { data: pr } = await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: `🌍 Translation Update: ${{ inputs.target_locale }} (${{ steps.check_changes.outputs.changed_files }} files)`,
head: '${{ steps.branch_name.outputs.branch_name }}',
base: 'main',
body: `## 📖 Automated Translation Update

This PR contains automated translations generated by the GitHub Actions workflow.

### 📊 Translation Summary
- **Target Locale**: ${{ inputs.target_locale }}
- **Files Changed**: ${{ steps.check_changes.outputs.changed_files }}
- **Locales Updated**: ${{ steps.check_changes.outputs.changed_locales }}

### ⚙️ Configuration Used
- **Force Translate**: ${{ inputs.force_translate }}
- **Cleanup Deleted Files**: ${{ inputs.cleanup_deleted }}
- **Dry Run**: ${{ inputs.dry_run }}
- **Single File**: ${{ inputs.single_file || 'None (all files)' }}
- **Concurrency**: ${{ inputs.concurrency }}
- **Model**: gpt-4o-mini

### 🔍 Review Guidelines
Please review the translations for:
- [ ] Accuracy and context preservation
- [ ] Proper handling of technical terms
- [ ] UI/Dashboard elements remain in English
- [ ] Code blocks and inline code unchanged
- [ ] Markdown formatting preserved
- [ ] Brand names (Arcade, Arcade Engine, Control Plane) kept in English

### 🚀 Auto-generated
This PR was automatically created by the \`translate-docs.yml\` GitHub Action.

**Triggered by**: @${{ github.actor }}
**Workflow Run**: [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})`,
draft: false
});

// Add labels
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
labels: ['🌍 translation', '🤖 automated', 'documentation']
});

// Add specific locale label if not 'all'
if ('${{ inputs.target_locale }}' !== 'all') {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
labels: [`locale:${{ inputs.target_locale }}`]
});
}

console.log(`Created PR #${pr.number}: ${pr.html_url}`);

- name: 📄 Summary
if: always()
run: |
echo "## 🌍 Translation Workflow Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

if [ "${{ steps.check_changes.outputs.has_changes }}" = "true" ]; then
echo "✅ **Translation completed successfully!**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Files changed**: ${{ steps.check_changes.outputs.changed_files }}" >> $GITHUB_STEP_SUMMARY
echo "- **Target locale**: ${{ inputs.target_locale }}" >> $GITHUB_STEP_SUMMARY
echo "- **Branch created**: \`${{ steps.branch_name.outputs.branch_name }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Changed locales**: ${{ steps.check_changes.outputs.changed_locales }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "A Pull Request has been created for review." >> $GITHUB_STEP_SUMMARY
else
echo "ℹ️ **No changes detected**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "All translations are up to date. No PR was created." >> $GITHUB_STEP_SUMMARY
fi

echo "" >> $GITHUB_STEP_SUMMARY
echo "### Configuration Used" >> $GITHUB_STEP_SUMMARY
echo "- Target Locale: ${{ inputs.target_locale }}" >> $GITHUB_STEP_SUMMARY
echo "- Force Translate: ${{ inputs.force_translate }}" >> $GITHUB_STEP_SUMMARY
echo "- Cleanup Deleted: ${{ inputs.cleanup_deleted }}" >> $GITHUB_STEP_SUMMARY
echo "- Dry Run: ${{ inputs.dry_run }}" >> $GITHUB_STEP_SUMMARY
echo "- Single File: ${{ inputs.single_file || 'None' }}" >> $GITHUB_STEP_SUMMARY
echo "- Concurrency: ${{ inputs.concurrency }}" >> $GITHUB_STEP_SUMMARY
echo "- Model: gpt-4o-mini" >> $GITHUB_STEP_SUMMARY
13 changes: 7 additions & 6 deletions .i18n-cache/hashes.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"es": {
"_meta.ts": "bfff435958824a340b2f6f78af9edaa62bab68b2e0db4c7980c37fb29a170a1f",
"page.mdx": "9489dd67ec525393d4cb3864edb26db843f20c57544b812b8b98637706cea666"
"_metadata": {
"version": "1.0.0",
"created": "2025-09-30T08:04:53.155Z",
"updated": "2025-09-30T14:53:21.378Z"
},
"pt-BR": {
"_meta.ts": "bfff435958824a340b2f6f78af9edaa62bab68b2e0db4c7980c37fb29a170a1f",
"page.mdx": "9489dd67ec525393d4cb3864edb26db843f20c57544b812b8b98637706cea666"
"data": {
"es": {},
"pt-BR": {}
}
}
2 changes: 1 addition & 1 deletion AUTHORING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ These are the guidelines for writing documentation for Arcade, to help keep the

- **Arcade**: Always refer to the product as "Arcade" in both titles and body text. Do not abbreviate or shorten the product name. Do not append "AI" to the product name.
- **Engine**: Refer to "the Arcade Engine" when the deployment option is irrelevant. Otherwise, refer to "the Arcade Cloud Engine" or "a self-hosted Arcade Engine."
- **Toolkits**: Toolkits are collections of tools, either built by Arcade or a third party developer. For toolkits built by Arcade, refer to "the Arcade [Toolkit name] toolkit." For example, "the Arcade GitHub toolkit."
- **MCP Servers**: MCP-Servers are collections of tools, either built by Arcade or a third party developer. For MCP Servers built by Arcade, refer to "the Arcade [Toolkit name] toolkit." For example, "the Arcade GitHub toolkit."
20 changes: 20 additions & 0 deletions _dictionaries/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,24 @@ export default {
poweredBy: "Powered by",
editPage: "Edit this page on GitHub →",
by: "by",
banner: {
aiTranslation:
"🤖 This translation is in progress and was generated by AI. If you find something incorrect or want to help improve it, please",
contributeLink: "contribute on GitHub",
thanks: "Thank you for your help!",
},
notFoundPage: {
title: "Page not found",
description: "This page doesn't exist or may have moved.",
notAvailablePrefix: "Not available in",
tryEnglish: "Try English version",
translationHint: "This page may not be translated yet.",
viewOriginalEnglish: "View the original in English",
goHome: "Go to homepage",
goBack: "Go back",
needHelp: "Need help? Try these popular pages:",
quickstart: "Quickstart",
toolkits: "Toolkits",
createToolkit: "Create a toolkit",
},
};
Loading