Skip to content

Conversation

@AlliBalliBaba
Copy link
Contributor

@AlliBalliBaba AlliBalliBaba commented Jan 7, 2026

As mentioned in #2108, this PR adds a script to translate all English docs via Gemini. LLM translations are generally pretty good, I can't attest to the quality of these translations though as I don't speak any of the languages. wdyt?

@henderkes
Copy link
Contributor

Does GitHub not show the changed workflow file? It just shows the massive list of docs instead.

@AlliBalliBaba
Copy link
Contributor Author

AlliBalliBaba commented Jan 7, 2026

No workflow yet as I'm not sure when it should run. Just ran the translations.php manually to see what translations would look like (all docs with gemini-flash takes about half an hour)

@henderkes
Copy link
Contributor

Ah, I closed the docs folder and didn't see the file. Thanks, will take a look.

@henderkes
Copy link
Contributor

We'll need to add integration with super linter so that AI can automatically fix what it breaks.

@henderkes
Copy link
Contributor

henderkes commented Jan 8, 2026

Can we simply exclude the docs/<lang> folders from the linter? Perhaps that would be simpler.

Edit: probably a question for @dunglas

@AlliBalliBaba
Copy link
Contributor Author

I added a translate.yaml workflow, not sure though how to actually test new workflows.

@henderkes
Copy link
Contributor

As it's manually triggered, we can't trigger it before it's merged into the default branch (main) iirc.

  push:
    branches:
      - main
    paths:
      - 'docs/*'

Should be this though, so it's automatically opened after docs change.

@AlliBalliBaba
Copy link
Contributor Author

AlliBalliBaba commented Jan 10, 2026

Makes sense, I adjusted the workflow to only trigger on changed english *.md files. Still not sure how to test it manually. I can also remove the docs changes themselves to make this PR slimmer.

@henderkes
Copy link
Contributor

Yeah should remove the doc changes. I think we can experiment with it more once the workflow file is merged into main.

uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
- name: run translation script
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe could we use gemini-cli or copilot-cli directly, and make it running the linter and fixing the issues?

Copy link
Contributor Author

@AlliBalliBaba AlliBalliBaba Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script doesn't need to be PHP, can also be bash. You'll usually get more consistent results if input and output of the LLM are minimized though. Prompting the cli directly makes this too unpredictable and noisy IMO, but we can try as an experiment if you want.

GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
run: |
php ./docs/translate.php "${{ steps.md_files.outputs.files }}"
- name: Run Linter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should run prettier -w . before running the linter, it will fix formatting issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want to use prettier instead of the superlinter to fix formatting issues?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super-linter Prettier does use prettier under the hood.
I'm not sure if super-linter can run it in write mode. If it does, why not use it then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants