check locale improve (#2511)

* check locale improve

* 1

* 3
This commit is contained in:
SoftFever 2023-10-26 13:36:09 +08:00 committed by GitHub
parent b99bd94a22
commit cbca9ffb81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 1 deletions

View file

@ -21,6 +21,24 @@ jobs:
sudo apt-get update sudo apt-get update
sudo apt-get install -y gettext sudo apt-get install -y gettext
# don't call ./run_gentext.sh as most translators never sync with main branch...
- name: Check translation format - name: Check translation format
run: | run: |
./run_gettext.sh echo $PWD
pot_file="./localization/i18n/OrcaSlicer.pot"
for dir in ./localization/i18n/*/
do
dir=${dir%*/} # remove the trailing "/"
lang=${dir##*/} # extract the language identifier
if [ -f "$dir/OrcaSlicer_${lang}.po" ]; then
mkdir -p ./resources/i18n/${lang}/
msgfmt --check-format -o ./resources/i18n/${lang}/OrcaSlicer.mo $dir/OrcaSlicer_${lang}.po
# Check the exit status of the msgfmt command
if [ $? -ne 0 ]; then
echo "Error encountered with msgfmt command for language ${lang}."
exit 1 # Exit the script with an error status
fi
fi
done