diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 75431d65..92632add 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -100,6 +100,10 @@ jobs: path: output/*nupkg if-no-files-found: warn + # + # All the following are used only when building an installer after a merge + # + # --skip-duplicate allows retrying a workflow that failed with a partial push, skipping already published packages and publishing the rest. - name: Publish NuGet packages to nuget.org run: | @@ -111,7 +115,6 @@ jobs: if: github.event_name != 'pull_request' continue-on-error: true - # All the following are used only when building an installer after a merge - name: Build Msi if: github.event_name != 'pull_request' id: build_msi diff --git a/.github/workflows/localizations.yml b/.github/workflows/localizations.yml deleted file mode 100644 index ef857d89..00000000 --- a/.github/workflows/localizations.yml +++ /dev/null @@ -1,81 +0,0 @@ -# Fetch and provide localizations -# -# Copyright (c) 2021 SIL International. MIT License. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -name: Localizations - -on: -# This build should probably only run when requested to update to update the -# localizations, rather than as a result of new code. - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Setup .NET - uses: actions/setup-dotnet@v1 - with: - # As of 2021-12, dotnet 2.1, not 3.1, is still needed for overcrowdin. - dotnet-version: 2.1.x - - name: Download crowdin localizations - env: - CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }} - run: | - set -xueo pipefail - make fetch_l10ns - mkdir -p artifacts - mv -v l10n/FieldWorksL10ns.zip artifacts/ - - name: Determine build version - run: | - set -xueo pipefail - git fetch --unshallow - # A later enhancement could make use of gitversion. - BUILD_VERSION="$(git describe)" - # It's a bit misleading to name the tag after where we are in the - # repository, because the crowdin l10ns fetched are generated from - # possibly a different commit. - TAG_NAME="l10n-${BUILD_VERSION}" - - # Set BRANCH_NAME to the branch targetted by a PR, if this is a PR, or to - # the name of the current branch, if this is not a PR. eg 'refs/heads/develop'. - BRANCH_NAME=${{github.base_ref}} - [[ -n ${BRANCH_NAME} ]] || BRANCH_NAME=${{github.ref}} - - echo >> "${GITHUB_ENV}" "BUILD_VERSION=${BUILD_VERSION}" - echo >> "${GITHUB_ENV}" "TAG_NAME=${TAG_NAME}" - echo >> "${GITHUB_ENV}" "BRANCH_NAME=${BRANCH_NAME}" - - name: Publish artifacts as Github release - uses: ncipollo/release-action@v1.8.6 - with: - artifacts: "artifacts/*" - prerelease: false - # Branch to build from - commit: "${{ env.BRANCH_NAME }}" - # Name of new tag to be created - tag: "${{ env.TAG_NAME }}" - allowUpdates: true - artifactErrorsFailBuild: true - # Name of release - name: "${{env.TAG_NAME}}-${{env.BRANCH_NAME}}" - body: "Crowdin localizations" - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 7e98e4a6..ca893eeb 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,4 @@ GitVersionTaskAssemblyInfo.g.cs Mercurial/ MercurialExtensions/ build/FLExBridge.files +/l10n/FlexBridge.en.xlf diff --git a/l10n/README.md b/l10n/README.md index 98ba2528..063bf521 100644 --- a/l10n/README.md +++ b/l10n/README.md @@ -1,9 +1,13 @@ -## FlexBridge - -### Updating Crowdin with source string changes - NOT YET IMPLEMENTED +## FLEx Bridge Localization The few FlexBridge strings that exist are in the FieldWorks crowdin project (https://crowdin.com/project/fieldworks) +### Updating Crowdin with source string changes + +#### Using ExtractXliff - NOT YET IMPLEMENTED + +**This cannot yet be implemented because ExtractXliff and FLEx Bridge have incompatible bitnesses** + The L10nSharp tool ExtractXliff is run on the project to get any updates to the source strings resulting in a new FlexBridge.en.xlf file. Overcrowdin is used to upload this file to Crowdin. @@ -13,23 +17,33 @@ This process is run automatically by a GitHub action if the commit comment menti It can also be run manually as follows: ``` dotnet tool install -g overcrowdin -set CROWDIN_FIELDWORKS_KEY=TheApiKeyForTheFieldWorksProject +set CROWDIN_API_KEY=TheApiKeyForTheFieldWorksProject msbuild l10n.proj /t:UpdateCrowdin ``` +#### Using the XLF generated when running FLEx Bridge + +Run FLEx Bridge, then: +``` +dotnet tool install -g overcrowdin +set CROWDIN_API_KEY=TheApiKeyForTheFieldWorksProject +copy %LocalAppData%\SIL\FlexBridge\localizations\FlexBridge.en.xlf . +overcrowdin updatefiles +``` + ### Update with latest localizations (Run before building an installer, or to test) Nuget packages for libpalso and chorus are used to get their localized xliff files. Overcrowdin is used to download the latest translation data for FlexBridge from the FieldWorks project. -The resulting files are copied to the DistFiles/localizations folder +The resulting files are copied to the DistFiles/localizations folder. -This process is run by the Installer build on TeamCity +This process is run by the Installer build on GitHub Actions. It can also be run manually as follows: ``` dotnet tool install -g overcrowdin -set CROWDIN_FIELDWORKS_KEY=TheApiKeyForTheFieldWorksProject +set CROWDIN_API_KEY=TheApiKeyForTheFieldWorksProject msbuild l10n.proj /t:restore msbuild l10n.proj /t:GetLatestL10ns ``` \ No newline at end of file diff --git a/l10n/crowdin.json b/l10n/crowdin.json index f44d31d5..ed25608a 100644 --- a/l10n/crowdin.json +++ b/l10n/crowdin.json @@ -2,11 +2,11 @@ "project_identifier": "fieldworks", "api_key_env": "CROWDIN_API_KEY", "base_path": ".", - "branch": "FieldWorks-9.1", + "branch": "FLEx-Bridge", "files": [ { "source": "FlexBridge.en.xlf", - "translation": "/%locale%/FlexBridge/FlexBridge.%locale%.xlf", + "translation": "/%locale%/FlexBridge.%locale%.xlf", } ] } \ No newline at end of file