GitHub Actions
With the github action, you can easily translate your code by just pushing your code to the repository, the github action will then translate your new keys, either create a pull request or commit your changes. This saves you a lot of time and effort while maintaining high quality translations.
Installation
To use the NeoIQ Localize GitHub Action in your repository, you'll need to:
- Set up your repository secrets with your NeoIQ Localize credentials
- Create a workflow file in your repository
Setting up Repository Secrets
Add the following secrets in your repository settings (Settings > Secrets and variables > Actions):
NEOIQ_LOCALIZE_API_KEY: Your NeoIQ Localize API keyNEOIQ_LOCALIZE_PROJECT_ID: Your NeoIQ Localize project ID
You can find these values in your NeoIQ Localize dashboard under Project Settings.
Environment Variables
The GitHub Action uses the following environment variables:
NEOIQ_LOCALIZE_API_KEY(Required): Your NeoIQ Localize API key for authenticationNEOIQ_LOCALIZE_PROJECT_ID(Required): Your NeoIQ Localize project IDGITHUB_TOKEN(Required): Automatically provided by GitHub, used for creating PRs
Example Workflow
Create a new file .github/workflows/neoiq-localize.yml in your repository with the following content:
This workflow will:
- Run on pushes to the main branch
- Run on pull requests to the main branch
- Can be triggered manually from the Actions tab
- Checkout your code and run the NeoIQ Localize translation process
- Create a pull request with any new translations (configurable)
Working Directory Option
The working-directory option allows you to specify where your translation files are located. This is particularly useful in monorepos where your translations may be in a specific package or app directory. For example:
Pull Request Option (coming soon)
The create-pull-request option controls whether the action creates a pull request with the changes or commits them directly to the branch:
When set to true, the action will:
- Create a new branch with the changes
- Create a pull request for review
- Add appropriate labels and description
When set to false (default), the action will:
- Commit the changes directly to the current branch
- Push the changes without creating a pull request
Using with Vercel
If you're using Vercel for deployments, you can combine this GitHub Action with our Vercel build validation to ensure your translations are always synchronized before deployment. This prevents deployments with missing or outdated translations.
How is this guide?
Last updated on