forked from jpawlowski/freeswitch-sounds-tts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_deprecated.sh
executable file
·46 lines (37 loc) · 1.29 KB
/
check_deprecated.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#
# FreeSwitch
# TTS Voice Prompt Generator
# - Identify potentially deprecated voice prompts -
#
# Copyright (c) 2013, Julian Pawlowski <jp@jps-networks.eu>
# See LICENSE file for details.
#
if [ ! -d input/en ]; then
echo "English voice prompt text files not found in input/en. Aborting ..."
exit 1
fi
if [ x"$1" == x"" ]; then
echo "Paramter missing: locale. Aborting ..."
exit 1
fi
if [ ! -d "./input/$1" ]; then
echo "Locale directory not found in ./input/$1. Aborting ..."
exit 1
fi
LIST_LOCALE="`find ./input/$1 -type f -name "*.txt"`"
echo -e "\n\nThe following files were not found in english language and might be deprecated for this language also:\n(if they are not $1 language specific)\n"
for FILE in $LIST_LOCALE; do
BASENAME="${FILE#.*/}"
FILENAME="${BASENAME%%.*}"
FILENAME_FLAT="${FILENAME#*/}"
FILENAME_FLAT="${FILENAME_FLAT#*/}"
if [ -e input/$1/locale_specific_texts.txt ]; then
WHITELIST="`cat input/$1/locale_specific_texts.txt | grep ${FILENAME_FLAT}`"
else
WHITELIST=""
fi
if [[ ! -e input/en/${FILENAME_FLAT}.txt && x"${WHITELIST}" == x"" && x"${FILENAME_FLAT}" != x"locale_specific_texts" ]]; then
echo "$FILENAME_FLAT"
fi
done
echo -e "\nTo suppress files from this list (e.g. for language specific files) you may add them to input/$1/locale_specific_texts.txt.\n"