Skip to content

Commit 8d4ce84

Browse files
committed
impreove github
1 parent 9203a4c commit 8d4ce84

File tree

1 file changed

+54
-10
lines changed

1 file changed

+54
-10
lines changed

.github/workflows/l10n.yml

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -254,30 +254,74 @@ jobs:
254254
help_output=$(cargo run --features feat_os_unix --bin coreutils -- touch --help 2>&1 || echo "Command failed")
255255
echo "Help output: $help_output"
256256
257-
# Check if the output contains French text or at least doesn't contain obvious English-only patterns
258-
# This is a basic test since we may not have French translations for all strings yet
259-
if echo "$help_output" | grep -qi "usage\|utilisation\|aide\|help"; then
260-
echo "✓ Help output appears to be working with French locale"
261-
else
262-
echo "! Help output may not be properly localized, but command executed"
257+
# Check for specific French strings from touch fr-FR.ftl
258+
french_strings_found=0
259+
if echo "$help_output" | grep -q "Mettre à jour les temps d'accès"; then
260+
echo "✓ Found French description: 'Mettre à jour les temps d'accès'"
261+
french_strings_found=$((french_strings_found + 1))
262+
fi
263+
if echo "$help_output" | grep -q "changer seulement le temps d'accès"; then
264+
echo "✓ Found French help text: 'changer seulement le temps d'accès'"
265+
french_strings_found=$((french_strings_found + 1))
266+
fi
267+
if echo "$help_output" | grep -q "FICHIER"; then
268+
echo "✓ Found French usage pattern: 'FICHIER'"
269+
french_strings_found=$((french_strings_found + 1))
263270
fi
264271
265272
echo "Testing ls --help with French locale..."
266273
ls_help=$(cargo run --features feat_os_unix --bin coreutils -- ls --help 2>&1 || echo "Command failed")
267274
echo "ls help output: $ls_help"
268275
269-
echo "Testing cat --help with French locale..."
270-
cat_help=$(cargo run --features feat_os_unix --bin coreutils -- cat --help 2>&1 || echo "Command failed")
271-
echo "cat help output: $cat_help"
276+
# Check for specific French strings from ls fr-FR.ftl
277+
if echo "$ls_help" | grep -q "Lister le contenu des répertoires"; then
278+
echo "✓ Found French ls description: 'Lister le contenu des répertoires'"
279+
french_strings_found=$((french_strings_found + 1))
280+
fi
281+
if echo "$ls_help" | grep -q "Afficher les informations d'aide"; then
282+
echo "✓ Found French ls help text: 'Afficher les informations d'aide'"
283+
french_strings_found=$((french_strings_found + 1))
284+
fi
285+
286+
echo "Testing base64 --help with French locale..."
287+
base64_help=$(cargo run --features feat_os_unix --bin coreutils -- base64 --help 2>&1 || echo "Command failed")
288+
echo "base64 help output: $base64_help"
289+
290+
# Check for specific French strings from base64 fr-FR.ftl
291+
if echo "$base64_help" | grep -q "encoder/décoder les données"; then
292+
echo "✓ Found French base64 description: 'encoder/décoder les données'"
293+
french_strings_found=$((french_strings_found + 1))
294+
fi
272295
273296
echo "Testing with error messages..."
274297
error_output=$(cargo run --features feat_os_unix --bin coreutils -- ls /nonexistent 2>&1 || echo "Expected error occurred")
275298
echo "Error output: $error_output"
276299
300+
# Check for French error messages from ls fr-FR.ftl
301+
if echo "$error_output" | grep -q "impossible d'accéder à"; then
302+
echo "✓ Found French error message: 'impossible d'accéder à'"
303+
french_strings_found=$((french_strings_found + 1))
304+
fi
305+
if echo "$error_output" | grep -q "Aucun fichier ou répertoire de ce type"; then
306+
echo "✓ Found French error text: 'Aucun fichier ou répertoire de ce type'"
307+
french_strings_found=$((french_strings_found + 1))
308+
fi
309+
277310
# Test that the binary works and doesn't crash with French locale
278311
version_output=$(cargo run --features feat_os_unix --bin coreutils -- --version 2>&1 || echo "Version command failed")
279312
echo "Version output: $version_output"
280313
281-
echo "✓ French locale integration test completed - all commands executed without crashes"
314+
# Final validation - ensure we found at least some French strings
315+
echo "French strings found: $french_strings_found"
316+
if [ "$french_strings_found" -gt 0 ]; then
317+
echo "✓ SUCCESS: French locale integration test passed - found $french_strings_found French strings"
318+
else
319+
echo "⚠ WARNING: No French strings were detected, but commands executed successfully"
320+
echo "This may indicate that:"
321+
echo " 1. The localization system is not loading French translations"
322+
echo " 2. The system locale is not being properly detected"
323+
echo " 3. French translations are not available for the tested strings"
324+
exit 1
325+
fi
282326
env:
283327
RUST_BACKTRACE: "1"

0 commit comments

Comments
 (0)