Files
wxWidgets/.github/workflows/genlangdb.yml
Ulrich Telle 57e1c9e1ee Update wxWidgets language database and improve locale matching
This commit improves the best locale match algorithm by prioritizing
closer matches and add many new tests verifying that this works as
expected.

In order to do this, new information had to be added to the language
database, which was extended with it and updated to use the latest
Unicode CLDR data and latest Windows 11 locale list.

Further, add a set of scripts for maintaining the language database up
to date and a GitHub workflow `genlangdb.yml` which can be run manually
to regenerate the wxWidgets language-related source and header files
from the underlying Windows and Unicode data. It produces 2 artifacts:

- wxLanguageDatabaseDist.zip allows to easily update the
  language-related files in the wxWidgets repository by simply copying
  all files.
- the normal workflow log and wxLanguageDatabaseLog.zip allow to check
  all temporary files of the regeneration process and to detect
  potential issues, before the language-related files are actually
  replaced by the new ones.

Finally, fix wxUILocaleImplName::GetPreferredUILanguages: Under Windows
10 and above the Windows API function ::GetUserPreferredUILanguages()
returns only the primary UI language plus US English. Additional
preferred UI languages installed by the user are ignored, so instead of
using this function read the list of user preferred languages from the
Windows registry.

Closes #24855.
2024-11-18 16:46:25 +01:00

69 lines
1.8 KiB
YAML

name: Generate wxWidgets language database
on: workflow_dispatch
jobs:
regenerate:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Enable MSVC command line
uses: ilammy/msvc-dev-cmd@v1.13.0
- name: Install utilities with Chocolatey
run: |
choco install sqlite.shell
choco install lua53
choco install python2
- name: Build utils
run: |
cd misc\languages\util
cl showlocales.c
# Test showlocales
.\showlocales >..\data\temp\win-locale-table-test.txt
- name: Generate database and language files
run: |
misc\languages\data\setupenv.ps1
cd misc\languages\data
.\getunicodefiles.ps1 46-beta2
# Do not run the following step on Windows Server 2022,
# locale data of Windows Server versions are usually outdated.
# Use Windows 11 Pro (or later) with recent updates for this step.
# .\getwindowsdata.ps1
.\gensqlfiles.ps1
.\makelangdb.ps1
- name: Replace language files and regenerate C++ source files
run: |
cd misc\languages\data
.\replacetables.ps1
cd ..\..\..
python misc\languages\genlang.py
- name: Prepare language database update artifact
run: |
misc\languages\preparedist.ps1
- name: Upload language update distribution
uses: actions/upload-artifact@v4
with:
name: wxLanguageDatabaseDist
path: |
distlang
- name: Upload temporary language data files and logs
uses: actions/upload-artifact@v4
with:
name: wxLanguageDatabaseLog
path: |
misc/languages/data
!misc/languages/data/**/*.db3
!misc/languages/data/**/*.lua
!misc/languages/data/**/*.ps1