https://github.com/starship/crowdin-pretranslate-action
https://github.com/starship/crowdin-pretranslate-action
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/starship/crowdin-pretranslate-action
- Owner: starship
- License: isc
- Created: 2022-05-11T16:28:49.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-18T04:19:16.000Z (over 3 years ago)
- Last Synced: 2024-04-14T08:32:02.530Z (over 1 year ago)
- Language: TypeScript
- Size: 340 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Crowdin Pretranslate Action
This is a very simple action which triggers a [Crowdin Pre-Translate](https://support.crowdin.com/enterprise/pre-translation/)
against all files/languages in a project using [Translation Memory](https://support.crowdin.com/enterprise/translation-memory/).
It is primarily intended for use with the Crowdin project for [starship](https://crowdin.com/project/starship-prompt),
though with some tweaks, it could be used for several other use cases (PRs are welcome!).## Example Usage
Place the following in `.github/workflows/pretranslate.yml`:
```yaml
# Run pre-translate with translation memory, all files/langs, at midnight daily.
name: Crowdin Updates
on:
schedule:
- cron: '0 0 * * *'jobs:
trigger_crowdin_tm:
name: Crowdin Translation Memory Trigger
runs-on: ubuntu-latest
steps:
- uses: starship/crowdin-pretranslate-action@main
with:
project_id:
api_key: ${{ secrets.CROWDIN_API_KEY }}
```You will need to place your project ID in the arguments, and upload a
[secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets)
containing your Crowdin API key.### Local Development
You should never need to run the code locally, as it depends on GitHub Actions
libraries which are only meaningful in the GitHub Actions environment. However,
if you want to develop the action, you should run the following commands after
checkout:```
npm install
npm run all
```This will compile the action. Note that `dist/index.js` is the file which users
will run to execute this action, so that file needs to be updated in a commit
if the action is to be changed! (There is an action on this repo that will
block any PRs where this doesn't happen).