Skip to content
Draft
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/auto-translate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Auto-Translate Questions

on:
push:
paths:
- 'src/questions/**/*.md'
branches: [ main ]
workflow_dispatch:
inputs:
language:
description: 'Specific language to translate (leave empty for all)'
required: false
default: ''

jobs:
translate:
runs-on: ubuntu-latest

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

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run translations
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
if [ -n "${{ github.event.inputs.language }}" ]; then
echo "Translating specific language: ${{ github.event.inputs.language }}"
npm run translate "${{ github.event.inputs.language }}"
else
echo "Translating all configured languages"
npm run translate:all
fi

- name: Check for changes
id: verify-changed-files
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi

- name: Commit and push changes
if: steps.verify-changed-files.outputs.changed == 'true'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add src/translations/
git commit -m "Auto-update translations [skip ci]"
git push
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,25 @@ You can read more about this project & its history [here](https://h5bp.org/Front
2. [How to Contribute](https://github.com/h5bp/Front-end-Developer-Interview-Questions/blob/master/.github/CONTRIBUTING.md)
3. [License](https://github.com/h5bp/Front-end-Developer-Interview-Questions/blob/master/LICENSE.md)

## Automated Translations

This repository now features automated translation capabilities! 🌍

When English questions are updated, translations are automatically generated using AI to keep all language versions in sync. This ensures that our international community always has access to the latest questions.

### How it works:
- English questions are maintained in separate files in [`src/questions/`](src/questions/)
- Automated translation system converts them into combined language-specific files
- Translations are generated using AI with technical accuracy and professional tone
- Available in 30+ languages and growing

### For Maintainers:
- Translations update automatically when questions change
- Manual translation workflow available: `npm run translate [language]`
- Full documentation in [`scripts/README.md`](scripts/README.md)

See our [translation documentation](scripts/README.md) for more details.


The project is currently maintained by:

Expand Down
Loading