Skip to content

Commit

Permalink
Update Localization Documentation (#1285)
Browse files Browse the repository at this point in the history
* Update GitHub Actions Actions

Update Checkout, SetUp-DotNET, and SetUp-MSBuild actions to the latest tagged commits. Previous versions of Checkout and SetUp-MSBuild had the following warning in the build log:

The `set-output` command is deprecated and will be disabled soon.
Please upgrade to using Environment Files. For more information see:
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

* Give GitHub Actions Jobs meaningful names

* Update localization documentation

** Point to loc doc from the main README
** Say that GHActions are now run
  • Loading branch information
papeh authored Oct 4, 2023
1 parent 2643a61 commit 7c86f54
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/l10n-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ concurrency:

jobs:

build:
package-l10n:
strategy:
fail-fast: false
runs-on: windows-2019

steps:
- name: Checkout
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0

# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@51f68377c181a79065c61bd492bd49be4575c439
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0
with:
dotnet-version: 5.0.x

# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe (Windows OS)
uses: microsoft/setup-msbuild@ab534842b4bdf384b8aaf93765dc6f721d9f5fab
uses: microsoft/setup-msbuild@1ff57057b5cfdc39105cd07a01d78e9b0ea0c14c # v1.3.1
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true # So the PATH can be set by this step

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/l10n-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@ concurrency:

jobs:

build:
extract-and-upload-strings:
strategy:
fail-fast: false
runs-on: windows-2019

steps:
- name: Checkout
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0

# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@51f68377c181a79065c61bd492bd49be4575c439
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0
with:
dotnet-version: 5.0.x

# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe (Windows OS)
uses: microsoft/setup-msbuild@ab534842b4bdf384b8aaf93765dc6f721d9f5fab
uses: microsoft/setup-msbuild@1ff57057b5cfdc39105cd07a01d78e9b0ea0c14c # v1.3.1
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true # So the PATH can be set by this step

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ Further instructions at https://github.com/sillsdev/libpalaso/wiki/Developing-wi

- Send a pull request (<https://help.github.com/articles/using-pull-requests>). Specify destination branch if not `master`.

### Localization

Palaso is localized with [L10NSharp](https://github.com/sillsdev/l10nsharp). Palaso-specific documentation is under `l10n/README.md`.

## API Policy

The palaso library follows semantic versioning. For APIs this means:
Expand Down
16 changes: 8 additions & 8 deletions l10n/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@

### Using localizations in a project

Do the following:

1. Add a Nuget dependency on libpalaso.l10ns to the project where you initialize the L10nSharp `LocalizationManager`
2. Add a build step to copy the Palaso.%langcode%.xlf files to the correct folder in your project

### Updating Crowdin with source string changes - UPLOAD TO CROWDIN NOT YET ENABLED

All the strings that are internationalized in all of the libpalaso projects are uploaded to Crowdin in Palaso.en.xlf
### Updating Crowdin with source string changes (automatic)

A Github action runs when commits are merged into master which uses the L10nSharp tool ExtractXliff to get any updates to the source strings resulting in a new Palaso.en.xlf file.
On each commit to `master`, a GitHub Action runs to
- Extract all internationalized strings from all libpalaso projects to `../DistFiles/Palaso.en.xlf`
- Upload Palaso.en.xlf to [Crowdin](https://crowdin.com/project/sil-common-libraries)

Then the Crowdin cli is used to update that file in Crowdin based on the crowdin.yml file.
See `../.github/workflows/l10n-source.yml`

It can also be run manually as follows:
```
msbuild l10n.proj /t:UpdateCrowdin
crowdin upload sources -i CROWDIN_PROJECT_ID -T CROWDIN_ACCESS_TOKEN
```

### Building Nuget package with the latest translations
### Building a NuGet package with the latest translations

This process is run manually from a github action whenever a package with updated translations is needed
(See `../.github/workflows/l10n-packaging.yml`)

It can also be run manually on a developer machine as follows:
```
Expand Down

0 comments on commit 7c86f54

Please sign in to comment.