mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-10-05 16:46:35 -05:00
Translations: restore key coverage and fix XML validation
Add English fallbacks for 12 missing keys in 41 language files. Report all missing keys and XML errors before failing validation. Run four regression tests in CI. All tests and 43 XML files pass.
This commit is contained in:
44 files changed
+617
-7
No files matched your search
@@ -116,18 +116,16 @@ for file in "${FILES_TO_PROCESS[@]}"; do
|
||||
# 1. Validate XML using fxparser
|
||||
log_detail "Validating XML structure..."
|
||||
# Capture stdout and stderr, get exit code
|
||||
FXPARSER_OUTPUT=$(fxparser -V "$file" 2>&1)
|
||||
FXPARSER_EXIT_CODE=$?
|
||||
|
||||
if [ "$FXPARSER_EXIT_CODE" -ne 0 ]; then
|
||||
if FXPARSER_OUTPUT=$(fxparser -V "$file" 2>&1); then
|
||||
log_detail_success "XML structure is valid."
|
||||
else
|
||||
FXPARSER_EXIT_CODE=$?
|
||||
CURRENT_FILE_PASSES=false
|
||||
FAIL_FLAG=true
|
||||
log_detail_error "XML Validation Failed for $file (fxparser exit code: $FXPARSER_EXIT_CODE):"
|
||||
while IFS= read -r line; do
|
||||
log_detail_error " $line"
|
||||
done <<< "$FXPARSER_OUTPUT"
|
||||
else
|
||||
log_detail_success "XML structure is valid."
|
||||
fi
|
||||
|
||||
# 2. Check for invalid backslash escape sequences
|
||||
@@ -165,7 +163,7 @@ for file in "${FILES_TO_PROCESS[@]}"; do
|
||||
log_detail_error "Key '$key_entry' (from $COMMON_FILE) not found in $file"
|
||||
CURRENT_FILE_PASSES=false
|
||||
FAIL_FLAG=true
|
||||
((KEYS_MISSING_IN_CURRENT_FILE++))
|
||||
KEYS_MISSING_IN_CURRENT_FILE=$((KEYS_MISSING_IN_CURRENT_FILE + 1))
|
||||
fi
|
||||
done
|
||||
if [ "$KEYS_MISSING_IN_CURRENT_FILE" -eq 0 ]; then
|
||||
|
||||
@@ -7,12 +7,14 @@ on:
|
||||
- 'Translations/*'
|
||||
- 'src/Common/Language.xml'
|
||||
- '.github/workflows/xmlvalidate.*'
|
||||
- 'Tests/test_xmlvalidate.py'
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
paths:
|
||||
- 'Translations/*'
|
||||
- 'src/Common/Language.xml'
|
||||
- '.github/workflows/xmlvalidate.*'
|
||||
- 'Tests/test_xmlvalidate.py'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
@@ -32,5 +34,7 @@ jobs:
|
||||
node-version: 'latest'
|
||||
- name: Install fast-xml-parser
|
||||
run: npm install fast-xml-parser@4.5.2 -g
|
||||
- name: Test XML validator
|
||||
run: python3 Tests/test_xmlvalidate.py
|
||||
- name: Run XML validator script
|
||||
run: ${{ github.workspace }}/.github/workflows/xmlvalidate.sh "${{ github.workspace }}"
|
||||
Reference in new issue
Block a user