Github Action
How to use Locadex as a Github Action
Overview
Locadex can be configured as a Github Action.
This is useful for continuous i18n of your project.
Every time this workflow triggers, Locadex will automatically internationalize any changes you've made to your project and create a pull request with the changes.
Example
Here is an example of a Github Action workflow that uses Locadex.
name: Run Locadex
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
locadex:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run Locadex
uses: generaltranslation/locadex@v0
with:
api_key: ${{ secrets.ANTHROPIC_API_KEY }}
gt_api_key: ${{ secrets.GT_API_KEY }}
gt_project_id: ${{ secrets.GT_PROJECT_ID }}
Feel free to customize the workflow to your needs. If you are using Typescript, configure your action to build your project before running Locadex.
The Github Action assumes you have already ran npx locadex start
in your project or have manually configured your project to use gt-next
.
Arguments
Prop | Type | Default |
---|---|---|
format_cmd?? | string | - |
no_translate?? | boolean | false |
pr_body?? | string | Multi-line default PR body |
pr_title?? | string | Locadex: Continuous i18n for ${{ github.ref_name }} |
pr_branch?? | string | locadex/${{ github.ref_name }} |
version?? | string | latest |
app_directory?? | string | - |
github_token?? | string | ${{ github.token }} |
extensions?? | string | - |
match_files?? | string | - |
debug?? | boolean | false |
verbose?? | boolean | false |
no_telemetry?? | boolean | false |
max_concurrent?? | string | - |
batch_size?? | string | - |
gt_project_id?? | string | - |
gt_api_key?? | string | - |
api_key? | string | - |
How is this guide?