Skip to content

badge-creator

Actions
This action allows you to make a badge that shows the translation progress of your Crowdin project
V1.0.11
Latest
Star (1)

GitHub Badge Creator

A GitHub action to manage and synchronize your localization resources from your Crowdin project to an image

Usage

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.

Sample workflow

name: Badge Creator

on:
  push:
    branches: [ main ]

jobs:
  badge:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/[email protected]

      - name: badge-creator
        uses: Globalfun32y439y54/[email protected]
        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.

Supported options

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

Default Language Example

  { "name": "English", "progress": 100, "url": "https://crowdin.com/project/bettercanvas", "color": "#2eccaa" }

Supported options for default language

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

badge-creator is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

This action allows you to make a badge that shows the translation progress of your Crowdin project
V1.0.11
Latest

badge-creator is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.