A GitHub action to manage and synchronize localization resources with your Crowdin project
Set up a workflow in .github/workflows/crowdin.yml (or add a job to your existing workflows).
Read the Configuring a workflow article for more details on creating and setting up GitHub workflows.
name: Badge Creator
on:
push:
branches: [ main ]
jobs:
badge:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.2.2
- name: badge-creator
uses: Globalfun32y439y54/github-action@V1.0.10
with:
token: ${{ secrets.TOKEN }}
project_id: ${{ secrets.PROJECT_ID }}
- name: Commit and Push Outputs
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add **/badge.svg
git commit -m "Updaed Your Badge" || echo "No changes to commit"
git push
Enter the PROJECT_ID
and TOKEN
secrets under the Repository settings -> Secrets and variables -> Actions > Repository secrets.
Option | Description | Example value |
---|---|---|
token |
Your Crowdin API token so it can get your translations | ${{ secrets.TOKEN }} |
project_id |
You Crowdin Project ID so it can get the right translations | ${{ secrets.PROJECT_ID }} |
output_path |
The path your .svg file is saved to | ./icon |
language_rename_map |
So you rename the name of the translations in the .svg file | {"German":"Deutsch","Spanish":"Español"} |
toggledefault |
This allow you set add your default language into the .svg file | false (default) |
defaultlanguage |
This is the feild you add the progress and name of the default language | Scroll Down To Default Language Example |
{ "name": "English", "progress": 100, "url": "https://crowdin.com/project/bettercanvas", "color": "#2eccaa" }
Option | Description | Example value |
---|---|---|
name |
The name of the default language | English |
progress |
The total progress of the language (Dont add a % sign. It adds it for you) | 100 |
url |
The url to the language strings | https://crowdin.com/project/bettercanvas |
color |
This depends of the progress of your language: Progress > 90, color = #2eccaa, Progress > 50, color = #38f, Progress > 0, color = #f6664c |
#2eccaa |