From 36b8d09c7fc89c0eb03eb957b06ebd24e385890e Mon Sep 17 00:00:00 2001 From: papeh Date: Mon, 9 Oct 2023 04:57:38 -0500 Subject: [PATCH] Fix L10n Source Extraction (#1290) * Download the existing Palaso.en.xlf and merge into it (preserves l10n of strings w/o i18n) * Update to the latest ExtractXliff * Update documentation --- .github/workflows/l10n-source.yml | 10 +++++++--- l10n/README.md | 10 +++++++--- l10n/crowdin.yml | 6 ------ l10n/l10n.proj | 4 ++-- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/l10n-source.yml b/.github/workflows/l10n-source.yml index 8ac2288a3..f9ad8502d 100644 --- a/.github/workflows/l10n-source.yml +++ b/.github/workflows/l10n-source.yml @@ -38,14 +38,18 @@ jobs: - name: Restore packages run: msbuild l10n/l10n.proj /t:restore /p:Configuration=Release /p:Platform="Any CPU" + - name: Install Crowdin cli + run: npm i -g @crowdin/cli + + - name: Download Palaso.en.xlf source file # new strings will be merged into the existing file + working-directory: ./l10n + run: crowdin download sources -T ${{ secrets.CROWDIN_PAT }} -i ${{ secrets.CROWDIN_PROJECT_ID }} + - name: Update l10n strings env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true # So gitversion can set environment vars during the build run: msbuild l10n/l10n.proj /t:UpdateCrowdin /p:Configuration=Release /p:Platform="Any CPU" - - name: Install Crowdin cli - run: npm i -g @crowdin/cli - - name: Upload Palaso.en.xlf source file working-directory: ./l10n run: crowdin upload sources -T ${{ secrets.CROWDIN_PAT }} -i ${{ secrets.CROWDIN_PROJECT_ID }} diff --git a/l10n/README.md b/l10n/README.md index 8ccc37610..ad6e7efef 100644 --- a/l10n/README.md +++ b/l10n/README.md @@ -8,13 +8,17 @@ ### Updating Crowdin with source string changes (automatic) On each commit to `master`, a GitHub Action runs to -- Extract all internationalized strings from all libpalaso projects to `../DistFiles/Palaso.en.xlf` +- Download the current `Palaso.en.xlf` from Crowdin. + (L10NSharp.ExtractXliff version 7.0.0-beta0011 fails to extract all strings, as not all are internationalized. + Merging into the existing file is easier than fixing 128 uninternationalized strings.) +- Extract all internationalized strings from all libpalaso projects to `Palaso.en.xlf` - Upload Palaso.en.xlf to [Crowdin](https://crowdin.com/project/sil-common-libraries) See `../.github/workflows/l10n-source.yml` -It can also be run manually as follows: +It can also be run manually as follows (requires the [Crowdin CLI](https://crowdin.github.io/crowdin-cli/)): ``` +crowdin download sources -i CROWDIN_PROJECT_ID -T CROWDIN_ACCESS_TOKEN msbuild l10n.proj /t:UpdateCrowdin crowdin upload sources -i CROWDIN_PROJECT_ID -T CROWDIN_ACCESS_TOKEN ``` @@ -24,7 +28,7 @@ crowdin upload sources -i CROWDIN_PROJECT_ID -T CROWDIN_ACCESS_TOKEN This process is run by a github action whenever a version tag is pushed and manually as needed (See `../.github/workflows/l10n-packaging.yml`) -It can also be run manually on a developer machine as follows: +It can also be run manually as follows (requires the [Crowdin CLI](https://crowdin.github.io/crowdin-cli/)): ``` crowdin download --all -i CROWDIN_PROJECT_ID -T CROWDIN_ACCESS_TOKEN msbuild l10n.proj /t:PackageL10ns diff --git a/l10n/crowdin.yml b/l10n/crowdin.yml index 09ee7c1dd..340e78e33 100644 --- a/l10n/crowdin.yml +++ b/l10n/crowdin.yml @@ -1,12 +1,6 @@ -# -# Your crowdin's credentials -# base_path : "." preserve_hierarchy: true -# -# Files configuration -# files: [ { "source" : "Palaso.en.xlf", diff --git a/l10n/l10n.proj b/l10n/l10n.proj index 77543ba7e..dd3be9108 100644 --- a/l10n/l10n.proj +++ b/l10n/l10n.proj @@ -2,7 +2,7 @@ - netstandard2.0 + netframework4.8 SIL.libpalaso.l10ns $(GitVersion_NuGetVersion) Jason Naylor @@ -15,7 +15,7 @@ All - +