# Translate Readme

> A GitHub Action to automate the translation of your README.md files

URL: https://store.crowdin.com/translate-readme
Identifier: translate-readme
Category: Development
Type: Guide
Author: Crowdin

## What does this action do?

- Upload your `README.md` file to Crowdin
- Download the translations from Crowdin to the specified place
- Manage the languages switcher in your `README.md` file

## Usage

Set up a workflow in *.github/workflows/translate-readme.yml* (or add a job to your existing workflows).

Read the [Configuring a workflow](https://help.github.com/en/articles/configuring-a-workflow) article for more details on how to create and set up custom workflows.

```yaml
# .github/workflows/translate-readme.yml
name: Translate Readme

on:
  # When you push to the `main` branch
  push:
    branches: [ main ]
  # And optionally, once every 12 hours
  schedule:
    - cron: '0 */12 * * *' # https://crontab.guru/#0_*/12_*_*_*
  # To manually run this workflow
  workflow_dispatch:

jobs:
  translate-readme:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout
      uses: actions/checkout@v3

    - name: Translate Readme
      uses: crowdin/translate-readme@v0.1.0
      env:
        CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
        CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
        # Optional. Only for Crowdin Enterprise
        CROWDIN_ORGANIZATION: ${{ secrets.CROWDIN_ORGANIZATION }}
```

For more examples, see the [Marketplace Page](https://github.com/marketplace/actions/translate-readme).

## Resources

- [Guide](https://github.com/marketplace/actions/translate-readme)
- [Source code](https://github.com/crowdin/translate-readme)
