tools/check_engine_locale_files.sh
author alfadur
Thu, 25 Oct 2018 20:40:02 +0300
changeset 13972 c471282572c1
parent 13967 a04c86dc685f
child 14221 6b7997406121
permissions -rwxr-xr-x
some more ja.txt fixes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13965
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     1
#!/bin/sh -
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     2
# Script to check all engine locale files (XX.txt)
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     3
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     4
# HOW TO USE:
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     5
# - Run this script in the tools/ directory.
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     6
# Result: All problems and missing translations in .txt files will be reported
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     7
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     8
# SYNTAX:
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     9
#
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    10
#     ./check_engine_locale_files.sh [file_to_check [show_untranslated]]
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    11
#
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    12
# Optional parameters:
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    13
#
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    14
# * file_to_check: Add this if you want to check a single file. Use the special value ALL to check all files.
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    15
# * show_untranslated: Set to 0 if you want to hide the list of untranslated files, set to 1 otherwise
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    16
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    17
SHOW_UNTRANSLATED_STRINGS=1;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    18
CHECKED_FILES=*.txt
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    19
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    20
# Parse command line
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    21
if [[ $# -gt 0 ]]
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    22
then
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    23
	if [ $1 = ALL ]
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    24
	then
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    25
		CHECKED_FILES=*.txt
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    26
	else
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    27
		CHECKED_FILES=$1;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    28
	fi
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    29
fi
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    30
if [[ $# -gt 1 ]]
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    31
then
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    32
	if [[ $2 -eq 1 ]]
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    33
	then
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    34
		SHOW_UNTRANSLATED_STRINGS=1;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    35
	elif [[ $2 -eq 0 ]]
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    36
	then
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    37
		SHOW_UNTRANSLATED_STRINGS=0;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    38
	fi
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    39
fi
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    40
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    41
cd ../share/hedgewars/Data/Locale;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    42
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    43
# Temporary files
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    44
TEMP_SYMBOLS_EN=$(mktemp);
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    45
TEMP_SYMBOLS=$(mktemp);
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    46
TEMP_COMPARE=$(mktemp);
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    47
TEMP_COMPARE_2=$(mktemp);
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    48
TEMP_CHECK=$(mktemp);
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    49
TEMP_TEMP=$(mktemp);
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    50
declare -a TEMP_PARAMS;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    51
for n in 0 1 2 3 4 5 6 7 8 9
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    52
do
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    53
	TEMP_PARAMS[$n]=$(mktemp);
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    54
done
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    55
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    56
# Collect list of string IDs
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    57
echo -n "" > $TEMP_SYMBOLS_EN;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    58
grep -o "^[0-9][0-9]:[0-9][0-9]=" en.txt | cut -c1-5 | sort | uniq > $TEMP_SYMBOLS_EN;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    59
TOTAL_STRINGS=`wc -l < $TEMP_SYMBOLS_EN`;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    60
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    61
# Collect strings with placeholders (only in 01:XX)
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    62
for n in 0 1 2 3 4 5 6 7 8 9
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    63
do
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    64
	grep -o "^01:[0-9][0-9]=.*%$n.*" en.txt | cut -c1-5 | sort | uniq > $TEMP_PARAMS[$n];
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    65
done
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    66
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    67
# Iterate through selected language files
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    68
for CHECKED_LANG_FILE in $CHECKED_FILES;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    69
	# Skip files that don't contain engine strings
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    70
	do
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    71
	if [[ $CHECKED_LANG_FILE == campaigns_* ]] || [[ $CHECKED_LANG_FILE == missions_* ]] || [ $CHECKED_LANG_FILE == CMakeLists.txt ]
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    72
	then
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    73
		continue;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    74
	fi
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    75
	if [ ! -e $CHECKED_LANG_FILE ]
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    76
	then
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    77
		echo "ERROR: $CHECKED_LANG_FILE not found!";
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    78
		continue;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    79
	fi
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    80
	if [ ! -r $CHECKED_LANG_FILE ]
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    81
	then
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    82
		echo "ERROR: No permission to read $CHECKED_LANG_FILE!";
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    83
		continue;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    84
	fi
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    85
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    86
	# Start the tests
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    87
	echo "== $CHECKED_LANG_FILE ==";
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    88
	MISSING_STRINGS=0;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    89
	HAS_PROBLEMS=0;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    90
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    91
	if [ $CHECKED_LANG_FILE != en.txt ]
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    92
	then
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    93
		grep -o "^[0-9][0-9]:[0-9][0-9]=" $CHECKED_LANG_FILE | cut -c1-5 | sort | uniq > $TEMP_SYMBOLS;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    94
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    95
		# Find strings with missing placeholders
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    96
		> $TEMP_COMPARE;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    97
		> $TEMP_COMPARE_2;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    98
		for n in 0 1 2 3 4 5 6 7 8 9
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    99
		do
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   100
			grep -o "^01:[0-9][0-9]=.*%$n.*" $CHECKED_LANG_FILE | cut -c1-5 | sort | uniq > $TEMP_CHECK;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   101
			comm $TEMP_PARAMS[$n] $TEMP_CHECK -2 -3 >> $TEMP_COMPARE;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   102
			comm $TEMP_PARAMS[$n] $TEMP_CHECK -1 -3 >> $TEMP_COMPARE_2;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   103
		done
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   104
		cat $TEMP_COMPARE | cut -c1-5 | sort | uniq > $TEMP_TEMP;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   105
		cat $TEMP_TEMP > $TEMP_COMPARE;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   106
		comm $TEMP_COMPARE $TEMP_SYMBOLS -1 -2 > $TEMP_TEMP;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   107
		if [ -s $TEMP_TEMP ]
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   108
		then
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   109
			echo "ERROR! Missing placeholders in these strings:";
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   110
			cat $TEMP_TEMP;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   111
			HAS_PROBLEMS=1;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   112
		fi
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   113
		cat $TEMP_COMPARE_2 | cut -c1-5 | sort | uniq > $TEMP_TEMP;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   114
		cat $TEMP_TEMP > $TEMP_COMPARE_2;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   115
		comm $TEMP_COMPARE_2 $TEMP_SYMBOLS -1 -2 > $TEMP_TEMP;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   116
		if [ -s $TEMP_TEMP ]
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   117
		then
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   118
			echo "ERROR! Invalid placeholders found in these strings:";
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   119
			cat $TEMP_TEMP;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   120
			HAS_PROBLEMS=1;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   121
		fi
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   122
	
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   123
		# Find superficial strings
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   124
		comm $TEMP_SYMBOLS_EN $TEMP_SYMBOLS -1 -3 > $TEMP_COMPARE;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   125
		if [ -s $TEMP_COMPARE ]
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   126
		then
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   127
			echo "WARNING! Superficial strings that do not exist in en.txt:";
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   128
			cat $TEMP_COMPARE;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   129
			HAS_PROBLEMS=1;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   130
		fi
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   131
	
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   132
		# Find missing translations
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   133
		comm $TEMP_SYMBOLS_EN $TEMP_SYMBOLS -2 -3 > $TEMP_COMPARE;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   134
		if [ -s $TEMP_COMPARE ]
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   135
		then
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   136
			if [ $SHOW_UNTRANSLATED_STRINGS -eq 1 ]
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   137
			then
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   138
				echo "Missing translations:";
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   139
				cat $TEMP_COMPARE;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   140
			fi
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   141
			MISSING_STRINGS=`wc -l < $TEMP_COMPARE`;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   142
		fi
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   143
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   144
		# Print summary
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   145
		if [ $MISSING_STRINGS -ne 0 ]
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   146
		then
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   147
			echo "Missing translations TOTAL: $MISSING_STRINGS/$TOTAL_STRINGS";
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   148
		else
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   149
			echo "All strings translated!";
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   150
		fi
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   151
		if [ $HAS_PROBLEMS -eq 1 ]
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   152
		then
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   153
			echo "Problems have been found.";
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   154
		fi
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   155
	else
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   156
		if [ $HAS_PROBLEMS -eq 0 ]
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   157
		then
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   158
			echo "No problems.";
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   159
		fi
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   160
	fi;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   161
		
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   162
done;
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   163
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   164
# Clean up files
fa9b22311390 Add script to check engine locale files for problems
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   165
rm $TEMP_SYMBOLS $TEMP_SYMBOLS_EN $TEMP_COMPARE $TEMP_COMPARE_2 $TEMP_CHECK $TEMP_TEMP;