Converting number of Excel column names no longer limited
[phpmyadmin/arisferyanto.git] / scripts / find_unused_messages.sh
blob20a062a36286f5974269f8fca53bdda74de8a379
1 #!/bin/sh
3 export LANG=C
4 set -e
6 # Simple script to find unused message strings by Michal Čihař
8 tmp1=`mktemp`
9 tmp2=`mktemp`
10 grep -o '^\$\<str[A-Z][a-zA-Z0-9_]*\>' lang/english-utf-8.inc.php \
11 | tr -d '$' \
12 | grep -Ev '^str(Transformation_|ShowStatus)' | sort -u > $tmp1
13 grep -ho '\<str[A-Z][a-zA-Z0-9_]*\>' `find . -type f -a -name '*.php' -a -not -path '*/lang/*'` \
14 | grep -Ev '^str(Transformation_|ShowStatus|Lang|Locale|SetupForm_|SetupFormset_)' | sort -u > $tmp2
16 echo Please note that you need to check results of this script, it doesn\'t
17 echo understand PHP, it only tries to find what looks like message name.
19 echo
20 echo Used messages not present in english language file:
21 echo '(this contains generated messages and composed message names, so these'
22 echo 'are not necessary a errors!)'
23 echo
25 # filter out known false positives
26 diff $tmp1 $tmp2 | awk '/^>/ {print $2}' | grep -Ev '(strEncto|strXkana|strDBLink|strPrivDesc|strPrivDescProcess|strTableListOptions|strMissingParameter|strAttribute|strDoSelectAll)'
28 echo
29 echo Not used messages present in english language file:
30 echo
32 diff $tmp1 $tmp2 | awk '/^</ {print $2}' | grep -Ev '(strSetup.*_(desc|name)|strSetupForm_|strSetupFormset_)'
35 rm -f $tmp1 $tmp2