Files
wxWidgets/misc/scripts/spellcheck
T
Ulrich TelleandVadim Zeitlin 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

33 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
CODESPELL=${CODESPELL-codespell}
# Make sure we run codespell from the top wx directory.
cd `dirname "$0"`/../..
if ! command -v $CODESPELL > /dev/null; then
echo "ERROR: codespell not available." >&2
exit 127
fi
$CODESPELL \
-I misc/suppressions/codespell-words \
-x misc/suppressions/codespell-lines \
-S 'build/cmake/modules/cotire.cmake,docs/changes*.txt,*.png,*.ico,*.bmp,*.cur,docs/doxygen/images,docs/doxygen/mainpages/copyright.h,docs/doxygen/doxygen-awesome-css,include/wx/private/lang_*.h' \
README.md docs include interface
rc=$?
if [ $rc != 0 ]; then
cat <<EOF
=================================== ERROR ===================================
Spell check failed, please correct the spelling mistakes at the locations
listed above. If any of the reported mistakes are false positives, please add
the lines provoking them to misc/suppressions/codespell-lines file or, if
there are many occurrences of the same word, add this word to codespell-words
file in the same directory.
EOF
>& 2
exit $rc
fi