From c49fe9236299d3e2cd1298ee413c2e61033894f1 Mon Sep 17 00:00:00 2001 From: Konstantin Pastbin Date: Fri, 6 Dec 2024 21:14:45 +0300 Subject: [PATCH] [tools] Validate and auto-format more strings files Signed-off-by: Konstantin Pastbin --- tools/unix/generate_localizations.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tools/unix/generate_localizations.sh b/tools/unix/generate_localizations.sh index d33276a851..4b6c97f05a 100755 --- a/tools/unix/generate_localizations.sh +++ b/tools/unix/generate_localizations.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -euxo pipefail +set -euo pipefail # Use ruby from brew on Mac OS X, because system ruby is outdated/broken/will be removed in future releases. case $OSTYPE in @@ -42,15 +42,6 @@ if [ ! -f "$TWINE_PATH/$TWINE_GEM" ]; then ) fi -# Validate and format/sort strings files. -STRINGS_UTILS="$OMIM_PATH/tools/python/strings_utils.py" -"$STRINGS_UTILS" --validate --output -"$STRINGS_UTILS" --types-strings --validate --output - -# Check for unused strings. -CLEAN_STRINGS="$OMIM_PATH/tools/python/clean_strings_txt.py" -"$CLEAN_STRINGS" --validate - # Generate android/iphone/jquery localization files from strings files. TWINE="$(gem contents --show-install-dir twine)/bin/twine" if [[ $TWINE == *".om/bin/twine" ]]; then @@ -63,6 +54,18 @@ fi OMIM_DATA="$OMIM_PATH/data" STRINGS_PATH="$OMIM_DATA/strings" +# Validate and format/sort strings files. +STRINGS_UTILS="$OMIM_PATH/tools/python/strings_utils.py" +"$STRINGS_UTILS" --validate --output +"$STRINGS_UTILS" --types-strings --validate --output +"$STRINGS_UTILS" "$STRINGS_PATH/sound.txt" --validate --output +"$STRINGS_UTILS" "$OMIM_DATA/countries_names.txt" --validate --output +"$STRINGS_UTILS" "$OMIM_PATH/iphone/plist.txt" --validate --output + +# Check for unused strings. +CLEAN_STRINGS="$OMIM_PATH/tools/python/clean_strings_txt.py" +"$CLEAN_STRINGS" --validate + MERGED_FILE="$(mktemp)" cat "$STRINGS_PATH"/{strings,types_strings}.txt> "$MERGED_FILE"