Merge pull request #2253 from andy840119/translate-to-translation #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Crowdin Action | |
on: | |
push: | |
branches: [ master ] | |
paths: | |
- 'osu.Game.Rulesets.Karaoke/Localisation/**' | |
jobs: | |
generate-localization-file: | |
name: Generate the localization file | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Install the localization tools. | |
run: dotnet tool restore | |
- name: Generate the localization file | |
run: dotnet localisation to-resx ./osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj --output ./crowdin | |
- name: Upload the localization into crowdin | |
uses: crowdin/[email protected] | |
with: | |
# upload the source to the target path of the https://github.com/karaoke-dev/karaoke-resources | |
# see the document in the https://support.crowdin.com/configuration-file/?q=dest | |
upload_sources: true | |
upload_sources_args: '--dest master/osu.Game.Rulesets.Karaoke.Resources/Localisation/%file_name%.%file_extension%' | |
source: crowdin/*.resx | |
# there's no translation can be uploaded in this repo, but we still need to give it a value. | |
translation: crowdin/%file_name%.%locale%.%file_extension% | |
# This is a numeric id, not to be confused with Crowdin API v1 "project identifier" string. | |
# See "API v2" on https://crowdin.com/project/<your-project>/settings#api | |
project_id: ${{ secrets.CROWDIN_PROJECT_ID }} | |
# A personal access token, not to be confused with Crowdin API v1 "API key". | |
# See https://crowdin.com/settings#api-key to generate a token. | |
token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | |
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} | |
- name: Send notification after upload success or failed. | |
uses: mshick/add-pr-comment@v2 | |
with: | |
if: always() | |
message: | | |
πππ New localization string has been successfully uploaded to the crowdin πππ | |
Go to https://crowdin.com/project/karaoke-dev to fill the translation. | |
message-failure: | | |
π₯π₯π₯ New localization string uploaded failed to the crowdin. π₯π₯π₯ | |
You can ignore this message or contact to the developer if you want to translate it now. |