Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI check for additional translations only #289

Merged
merged 1 commit into from
May 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix CI check for additional translations only
  • Loading branch information
thomiceli committed May 27, 2024
commit 1ceb2a0813845528391c03d2267bc091b414508e
9 changes: 1 addition & 8 deletions scripts/check-translations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ sed -i '/^\s*$/d' sorted_reference_keys.txt

for new_file in internal/i18n/locales/*.yml; do
filename=$(basename $new_file)
echo ""
echo "Checking $filename..."

# Extract keys from the current file and sort them
sort <(awk -F':' '{print $1}' $new_file) > sorted_new_keys.txt
Expand All @@ -18,17 +16,12 @@ for new_file in internal/i18n/locales/*.yml; do
comm -3 sorted_reference_keys.txt sorted_new_keys.txt > differences.txt

if [ -s differences.txt ]; then
echo "Error in $filename: The YAML file has differences in keys."
while IFS= read -r line; do
if [[ $line == $'\t'* ]]; then
echo "+ Additional key in $filename: $(echo $line | awk '{$1=$1; print}')"
else
echo "- Missing key in $filename: $(echo $line | awk '{$1=$1; print}')"
differences_found=1
fi
done < differences.txt
differences_found=1
else
echo "All keys in $filename match perfectly."
fi

rm sorted_new_keys.txt
Expand Down
Loading