https://github.com/scientanl/lokalise-tms-github-action
Scienta-Lokalise Github Action
https://github.com/scientanl/lokalise-tms-github-action
github-actions lokalise translation
Last synced: 4 months ago
JSON representation
Scienta-Lokalise Github Action
- Host: GitHub
- URL: https://github.com/scientanl/lokalise-tms-github-action
- Owner: ScientaNL
- License: mit
- Created: 2022-10-07T10:35:52.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-03T15:01:34.000Z (over 1 year ago)
- Last Synced: 2025-04-12T11:50:08.523Z (about 1 year ago)
- Topics: github-actions, lokalise, translation
- Language: TypeScript
- Homepage: https://www.scienta.nl
- Size: 4.36 MB
- Stars: 0
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lokalise TMS GitHub Action
Scienta's take on translation management, using [Lokalise](https://lokalise.com/)
## Workflow
This project contains a GitHub Action which can be used in various actions to create a Translation Management flow.
At Scienta, we use the following flow:
- On `PR create` a GitHub action checks if the PR (HEAD ref) contains new translations, compared to the TMS (Lokalise). The new translations are stored in a Github Actions Artifact and a comment is added to the PR.
- On `PR merge` the stored translations are added to the TMS and can be translated by translators.
- On `release` all keys are retrieved from the TMS and translation files are generated.
- On `workflow_dispatch` or `schedule` Remove obsolete keys or tag them to mark them as obsolete.
## Usage
Checkout the various test-workflows in the `./test-workflows` directory. This Action can be used as a GitHub Action step. You have to specify the command you want to execute.
### PR comment template
The template engine [ejs](https://www.npmjs.com/package/ejs) is used to render the PR comments. the keys variable is exposed, wich is `TranslationKey[]`. Check out the example.
## Configuration
Create a valid [configuration.ts](src%2Flib%2Fconfiguration%2Fconfiguration.ts) to have this GitHub Action work properly.
## Testing
To run this action locally, please install [Act](https://github.com/nektos/act) to `./bin/act` (Default location of install script of Act).
- Populate the `.env` file based on the `.env.template`.
- Edit the `payload` json files if needed in `./test-workflows`
- Tinker around with the `./test-workflows/.translate-actionrc.yml` run command file.
Run:
```bash
npm run build && npm run command:extract-translations
npm run build && npm run command:add-snapshot
npm run build && npm run command:create-translation-files
npm run build && npm run command:cleanup-obsolete-keys
npm run build && npm run command:tag-obsolete-keys
```