From 9d1cb589f9fd49d593310f68d3107064d9c871d3 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sat, 11 Jun 2022 00:38:27 +0800 Subject: [PATCH 1/2] Fix the CI config for upload the localization into crowdin. --- .github/workflows/crowdin.yml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index 17ee12b8e..8bf1e50bd 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -19,20 +19,28 @@ jobs: - 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 ${{github.workspace}}\crowdin + run: dotnet localisation to-resx ./osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj --output ./crowdin - synchronize-with-crowdin: - name: Upload the localization into crowdin - runs-on: ubuntu-latest - needs: [generate-localization-file] - steps: - - name: crowdin action + - name: Upload the localization into crowdin uses: crowdin/github-action@1.4.9 with: - upload_translations: true + # 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%' + # there's no translation can be uploaded in this repo. + upload_translations: false download_translations: false - source: ${{github.workspace}}\crowdin\*.resx - translation: ${{github.workspace}}\crowdin\%file_name%.%locale%.%file_extension% + # it should be like that but seems the crowdin has the problem on parsing the path. + # source: ${{github.workspace}}/crowdin/*.resx + source: crowdin/*.resx + 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//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 }} From a9a646696a435805bd92e5119298b1bfa4c828ad Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sat, 11 Jun 2022 00:51:35 +0800 Subject: [PATCH 2/2] Remove un-need params. Because should only upload the source. --- .github/workflows/crowdin.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index 8bf1e50bd..a138d2f9c 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -28,18 +28,14 @@ jobs: # 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%' - # there's no translation can be uploaded in this repo. - upload_translations: false - download_translations: false - # it should be like that but seems the crowdin has the problem on parsing the path. - # source: ${{github.workspace}}/crowdin/*.resx 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 + # This is a numeric id, not to be confused with Crowdin API v1 "project identifier" string. # See "API v2" on https://crowdin.com/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 + # 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 }}